1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
#if 0 #include <arpa/inet.h> uint32_t htonl(uint32_t hostlong) { union { uint32_t u; unsigned char c[sizeof(uint32_t)]; } u; u.c[0] = (hostlong >> 24) & 0xff; u.c[1] = (hostlong >> 16) & 0xff; u.c[2] = (hostlong >> 8) & 0xff; u.c[3] = (hostlong) & 0xff; return u.u; } #endif