Skip to content

Commit

Permalink
Merge pull request #1037 from koeppea/pr1014-msvc-build-fix
Browse files Browse the repository at this point in the history
fix MSVC built when macro ORDER_ADD_{SHORT,LONG} is being used
  • Loading branch information
LocutusOfBorg authored Jul 15, 2020
2 parents 770597c + 32cda87 commit 4998b57
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/ec_inet.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ EC_API_EXTERN void check_tempaddr(const char *iface);
#define htons_inv(x) (u_int16)(x << 8) | (x >> 8)

#define ORDER_ADD_SHORT(a, b) a = a + b
#define ORDER_ADD_LONG(a, b) a = a + b
#define ORDER_ADD_LONG(a, b) a = a + b

#else
/* LITTLE ENDIAN */
Expand All @@ -164,8 +164,8 @@ EC_API_EXTERN void check_tempaddr(const char *iface);
/* return little endian */
#define htons_inv(x) (u_int16)x

#define ORDER_ADD_SHORT(a, b) a = htons(ntohs(a) + (int16)b)
#define ORDER_ADD_LONG(a, b) a = htonl(ntohl(a) + (int32)b)
#define ORDER_ADD_SHORT(a, b) a = htons(ntohs(a) + (int16_t)b)
#define ORDER_ADD_LONG(a, b) a = htonl(ntohl(a) + (int32_t)b)

#endif

Expand Down

0 comments on commit 4998b57

Please sign in to comment.