diff options
Diffstat (limited to 'src/lib/libc/net/ntohs.c')
-rw-r--r-- | src/lib/libc/net/ntohs.c | 21 |
1 files changed, 0 insertions, 21 deletions
diff --git a/src/lib/libc/net/ntohs.c b/src/lib/libc/net/ntohs.c deleted file mode 100644 index 8f345e84ad..0000000000 --- a/src/lib/libc/net/ntohs.c +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | /* $OpenBSD: ntohs.c,v 1.8 2005/08/06 20:30:03 espie Exp $ */ | ||
2 | /* | ||
3 | * Written by J.T. Conklin <jtc@netbsd.org>. | ||
4 | * Public domain. | ||
5 | */ | ||
6 | |||
7 | #include <sys/types.h> | ||
8 | #include <machine/endian.h> | ||
9 | |||
10 | #undef ntohs | ||
11 | |||
12 | u_int16_t | ||
13 | ntohs(u_int16_t x) | ||
14 | { | ||
15 | #if BYTE_ORDER == LITTLE_ENDIAN | ||
16 | u_char *s = (u_char *) &x; | ||
17 | return (u_int16_t)(s[0] << 8 | s[1]); | ||
18 | #else | ||
19 | return x; | ||
20 | #endif | ||
21 | } | ||