diff --git a/node/Constants.hpp b/node/Constants.hpp index 1745ef6b5..524a8428d 100644 --- a/node/Constants.hpp +++ b/node/Constants.hpp @@ -34,35 +34,33 @@ // // __LINUX__ // __APPLE__ -// __UNIX_LIKE__ - any "unix like" OS (BSD, posix, etc.) +// __BSD__ (OSX also defines this) +// __UNIX_LIKE__ (Linux, BSD, etc.) // __WINDOWS__ // // Also makes sure __BYTE_ORDER is defined reasonably. // -// Canonicalize Linux... is this necessary? Do it anyway to be defensive. #if defined(__linux__) || defined(linux) || defined(__LINUX__) || defined(__linux) #ifndef __LINUX__ #define __LINUX__ +#endif #ifndef __UNIX_LIKE__ #define __UNIX_LIKE__ #endif -#endif +#include #endif // TODO: Android is what? Linux technically, but does it define it? -// OSX and iOS are unix-like OSes far as we're concerned #ifdef __APPLE__ #include #ifndef __UNIX_LIKE__ #define __UNIX_LIKE__ #endif +#ifndef __BSD__ +#define __BSD__ #endif - -// Linux has endian.h -#ifdef __LINUX__ -#include #endif #if defined(_WIN32) || defined(_WIN64) @@ -74,6 +72,7 @@ #pragma warning(disable : 4996) #pragma warning(disable : 4101) #undef __UNIX_LIKE__ +#undef __BSD__ #define ZT_PATH_SEPARATOR '\\' #define ZT_PATH_SEPARATOR_S "\\" #define ZT_EOL_S "\r\n" @@ -98,9 +97,8 @@ #define ZT_EOL_S "\n" #endif -// Error out if required symbols are missing #ifndef __BYTE_ORDER -error_no_byte_order_defined; +#include #endif /**