siphash-c icon indicating copy to clipboard operation
siphash-c copied to clipboard

Compilation fails on FreeBSD

Open fasf opened this issue 12 years ago • 2 comments

endian.h is specific to glibc, you shouldn't try to include it unless GLIBC is defined. I suggest doing hardware check, f.e. like https://code.google.com/p/xxhash/source/browse/trunk/xxhash.c and if it fails, do it in endianess-neutral way (and drop a warning).

fasf avatar Jul 18 '13 18:07 fasf

Sorry for my late response! You're right, some changes addressing this issue were made in the version that is being used in Ruby now - I should backport those!

emboss avatar Jul 24 '13 23:07 emboss

Not sure if you did the backport already, but it doesn't work.

#ifdef _WIN32
  #define BYTE_ORDER __LITTLE_ENDIAN
#elif defined BYTE_ORDER
/* do nothing */
#elif defined(__GLIBC__)
  #include <endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix)
  #include <sys/endian.h>
#endif#ifdef _WIN32
  #define BYTE_ORDER __LITTLE_ENDIAN
#elif defined BYTE_ORDER
/* do nothing */
#elif defined(__GLIBC__)
  #include <endian.h>
#elif defined(__NetBSD__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__minix)
  #include <sys/endian.h>
#endif

does.

fasf avatar Jan 12 '14 12:01 fasf