zeromq/zmqpp — pull request #77 by crheckman (2014-11-03 23:03:07+00:00)
Title: Rename htonll/ntohll so zmqpp can build in Yosemite.

Renamed the htonll and ntohll functions because of build errors when running make. Yosemite includes its own `htonll' and `ntohll' functions that clash; this fix simply renames the zmqpp-defined functions.

Another workaround would be to implement a guard checking if these functions are already defined.

In file included from /Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:10:
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:79:17: error: expected ')'
inline uint64_t htonll(uint64_t const hostlonglong)
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:79:17: note: to match this '('
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
In file included from /Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:10:
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:92:17: error: expected ')'
inline uint64_t ntohll(uint64_t const networklonglong)
^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:30: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:92:17: note: to match this '('
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
In file included from /Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:10:
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:92:17: error: redefinition of '__builtin_constant_p'
inline uint64_t ntohll(uint64_t const networklonglong)
^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:79:17: note: previous definition is here
inline uint64_t htonll(uint64_t const hostlonglong)
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:6: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
In file included from /Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:10:
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:145:16: error: unexpected parenthesis after '::'
temp = zmqpp::htonll(temp);
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
In file included from /Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:10:
/Users/crh/tmp/zmqpp/src/zmqpp/inet.hpp:163:16: error: unexpected parenthesis after '::'
temp = zmqpp::ntohll(temp);
^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:141:40: error: unexpected parenthesis after '::'
integer = static_cast(zmqpp::htonll(*network_order));
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:182:28: error: unexpected parenthesis after '::'
unsigned_integer = zmqpp::ntohll(*network_order);
^
/usr/include/sys/_endian.h:140:25: note: expanded from macro 'ntohll'
#define ntohll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:240:34: error: unexpected parenthesis after '::'
uint64_t network_order = zmqpp::htonll(static_cast(integer));
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:275:34: error: unexpected parenthesis after '::'
uint64_t network_order = zmqpp::htonll(unsigned_integer);
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:345:34: error: unexpected parenthesis after '::'
uint64_t network_order = zmqpp::htonll(static_cast(integer));
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
/Users/crh/tmp/zmqpp/src/zmqpp/message.cpp:373:34: error: unexpected parenthesis after '::'
uint64_t network_order = zmqpp::htonll(unsigned_integer);
^
/usr/include/sys/_endian.h:141:25: note: expanded from macro 'htonll'
#define htonll(x) __DARWIN_OSSwapInt64(x)
^
/usr/include/libkern/_OSByteOrder.h:78:5: note: expanded from macro '__DARWIN_OSSwapInt64'
(__builtin_constant_p(x) ? __DARWIN_OSSwapConstInt64(x) : _OSSwapInt64(x))
^
11 errors generated.