changeset 45:159f67b5f856

Support of OS X compilation
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 01 Aug 2015 17:53:36 +0200
parents a4f9432d9173
children 5cb879c4d13d
files Core/PostgreSQLResult.cpp Core/PostgreSQLStatement.cpp NEWS
diffstat 3 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/Core/PostgreSQLResult.cpp	Fri Jul 31 11:19:06 2015 +0200
+++ b/Core/PostgreSQLResult.cpp	Sat Aug 01 17:53:36 2015 +0200
@@ -30,8 +30,12 @@
 #include <c.h>
 #include <catalog/pg_type.h>
 
-#ifdef __FreeBSD__
-#include <arpa/inet.h>    // ntohl()
+#if defined(__FreeBSD__)
+#  include <arpa/inet.h>    // ntohl()
+#elif defined(__APPLE__)
+#  include <libkern/OSByteOrder.h>
+#  define htobe32(x) OSSwapHostToBigInt32(x)
+#  define htobe64(x) OSSwapHostToBigInt64(x)
 #endif
 
 
--- a/Core/PostgreSQLStatement.cpp	Fri Jul 31 11:19:06 2015 +0200
+++ b/Core/PostgreSQLStatement.cpp	Sat Aug 01 17:53:36 2015 +0200
@@ -30,6 +30,12 @@
 #include <c.h>
 #include <catalog/pg_type.h>
 
+#if defined(__APPLE__)
+#  include <libkern/OSByteOrder.h>
+#  define htobe32(x) OSSwapHostToBigInt32(x)
+#  define htobe64(x) OSSwapHostToBigInt64(x)
+#endif
+
 
 namespace OrthancPlugins
 {
--- a/NEWS	Fri Jul 31 11:19:06 2015 +0200
+++ b/NEWS	Sat Aug 01 17:53:36 2015 +0200
@@ -4,6 +4,7 @@
 * Inject version information into Windows binaries
 * Option to prevent compiling the unit tests (if no PostgreSQL test server is available)
 * Update to Boost 1.58.0 for static and Windows builds
+* Support of OS X compilation
 
 
 Release 1.1 (2015/07/03)