![]() ![]() | ![]() |
File: [local] / prex-old / dev / lib / ntohl.c (download)
Revision 1.1, Tue Jun 3 09:38:42 2008 UTC (16 years, 2 months ago) by nbrk
Initial revision |
/* * Written by J.T. Conklin <jtc@NetBSD.org>. * Public domain. */ #include <driver.h> #include <sys/types.h> #undef ntohl uint32_t ntohl(x) uint32_t x; { #if BYTE_ORDER == LITTLE_ENDIAN u_char *s = (u_char *)&x; return (uint32_t)(s[0] << 24 | s[1] << 16 | s[2] << 8 | s[3]); #else return x; #endif }