From 9f1b14f84990009673fb766223b351fb3b6aae70 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 17 Jan 2016 02:17:55 +0100 Subject: [PATCH] Fix compilation under OS X together with Core Foundation headers /usr/include/MacTypes.h included by many (all?) Core Foundation headers defines "nil" as "NULL" breaking compilation of msgpack code. Undo this definition in the header included before all the other ones to allow using msgpack and Core Foundation together. --- include/msgpack/cpp_config.hpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/msgpack/cpp_config.hpp b/include/msgpack/cpp_config.hpp index 8d33f8b40..97431246e 100644 --- a/include/msgpack/cpp_config.hpp +++ b/include/msgpack/cpp_config.hpp @@ -121,4 +121,10 @@ MSGPACK_API_VERSION_NAMESPACE(v1) { #endif // MSGPACK_USE_CPP03 +// Core Foundation headers under OS X define nil as NULL breaking compilation +// of msgpack/adaptor/nil.hpp and all the headers including it. +#ifdef nil +#undef nil +#endif + #endif /* msgpack/cpp_config.hpp */