[PATCH 2.3.2rc1] COMMON: Darwin port Update for Yosemite


Philip Preston
 

Mac OSX 10.10 introduces htonll and ntohll macros in system headers, and as such we get redefine errors when compiling. Changed port.h to only define thefunctions if below Mac OSX 10.10.

Also added 10.10 to the available mac os x versions in scons

Signed-off-by: Phil Preston <philippreston@mac.com>
---
common/c_cpp/src/c/darwin/port.h | 3 +++
site_scons/community/command_line.py | 2 +-
2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/common/c_cpp/src/c/darwin/port.h b/common/c_cpp/src/c/darwin/port.h
index c2458ad..3a56cb4 100644
--- a/common/c_cpp/src/c/darwin/port.h
+++ b/common/c_cpp/src/c/darwin/port.h
@@ -45,6 +45,7 @@
#include <inttypes.h>
#include <pwd.h>
#include <stdlib.h>
+#include <AvailabilityMacros.h>

#include "wConfig.h"

@@ -66,6 +67,7 @@ typedef void* LIB_HANDLE;
#define LIB_EXTENSION ".dylib"

/* Network conversion function */
+#if MAC_OS_X_VERSION_MAX_ALLOWED <= MAC_OS_X_VERSION_10_9
#if __BYTE_ORDER == __LITTLE_ENDIAN
#define htonll(x) \
((uint64_t)htonl((uint32_t)((x)>>32)) | (uint64_t)htonl((uint32_t)(x))<<32)
@@ -75,6 +77,7 @@ typedef void* LIB_HANDLE;
#define htonll(x) ((uint64_t)(x))
#define ntohll(x) ((uint64_t)(x))
#endif
+#endif

/* For delimiting multiple paths in env variables properties */
#define PATH_DELIM ':'
diff --git a/site_scons/community/command_line.py b/site_scons/community/command_line.py
index e1791e2..606e448 100644
--- a/site_scons/community/command_line.py
+++ b/site_scons/community/command_line.py
@@ -79,7 +79,7 @@ def get_command_line_opts( host, products, VERSIONS ):
EnumVariable( 'compiler', 'Compiler to use for building OpenMAMA',
'default', allowed_values=('default', 'clang', 'clang-analyzer')),
EnumVariable('osx_version', 'OS X Version to target build at', 'current',
- allowed_values=('current','10.8','10.9')),
+ allowed_values=('current','10.8','10.9','10.10')),
)

return opts
--
1.9.3 (Apple Git-50)