2 * Copyright (C) 2006-2009 Brian Aker
5 * Use and distribution licensed under the BSD license. See
6 * the COPYING file in the parent directory for full text.
12 #include "byteorder.h"
14 /* Byte swap a 64-bit number. */
15 static inline uint64_t swap64(uint64_t in
)
17 #ifndef WORDS_BIGENDIAN
18 /* Little endian, flip the bytes around until someone makes a faster/better
24 rv
= (rv
<< 8) | (in
& 0xff);
29 /* big-endian machines don't need byte swapping */
34 uint64_t ntohll(uint64_t value
)
39 uint64_t htonll(uint64_t value
)