Fix sys_ntohl macro; it just replicated the low byte instead of reordering bytes

aper
Ilya Basin 2012-12-01 14:38:00 +04:00
parent b85507a1eb
commit 762747cfb0
1 changed files with 3 additions and 3 deletions

View File

@ -29,9 +29,9 @@
/* To avoid linking with ws2_32.lib, here's the definition of ntohl() */
#define sys_ntohl(l) ((((l) << 24) & 0xff000000) \
| (((l) << 16) & 0xff0000) \
| (((l) << 8) & 0xff00) \
| ((l) & 0xff))
| (((l) << 8) & 0xff0000) \
| (((l) >> 8) & 0xff00) \
| ((l >> 24) & 0xff))
#ifdef _MSC_VER /* MSVS.Net */
#ifndef __cplusplus