arcapos / luapgsql

Lua binding for PostgreSQL
108 stars 24 forks source link

OS X doesn't seem to have "endian.h" #19

Closed geoffleyland closed 9 years ago

geoffleyland commented 9 years ago

Adding this in luapgsql.c is a bit tacky, but it gets it to compiling and building:

#ifdef __APPLE__
  #include <libkern/OSByteOrder.h>
  #define htobe64(x) OSSwapHostToBigInt64(x)
#else
  #include <endian.h>
#endif

I can fork and make a pull request if you like, but this is pretty minor.

mbalmer commented 9 years ago

Added that, thanks!

yuangu commented 7 years ago

elif _WIN32

include

define htobe64(x) htonll(x)

endif

for windows。

mbalmer commented 7 years ago

this topic is closed, please open a new issue and provide a source code patch.