Return to test-betoh64.c CVS log | Up to [cvsweb.bsd.lv] / mandoc |
File: [cvsweb.bsd.lv] / mandoc / Attic / test-betoh64.c (download)
Revision 1.1.2.2, Wed Oct 2 21:03:26 2013 UTC (10 years, 11 months ago) by schwarze
DragonFly needs explicit #include <sys/endian.h> to use be64toh(), while most other systems include that indirectly via <sys/types.h>. Reported by Franco Fichtner <franco at lastsummer dot de>. |
#include <sys/types.h> #if defined(__linux__) # include <endian.h> #elif defined(__APPLE__) # include <libkern/OSByteOrder.h> #else # include <sys/endian.h> #endif int main(int argc, char **argv) { u_int64_t hostorder; u_int64_t bigendian = 1; hostorder = betoh64(bigendian); return 0; }