From 8e46606ce757e07874cde51fe0ad21ec0078094f Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Sun, 11 May 2014 23:59:26 +0200 Subject: fix build on Windows with newer gcc / other Windows headers. redefining NULL is terrible, perhaps we can remove these lines for all build platforms? (bzr r13358) --- src/prefix.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/prefix.cpp') diff --git a/src/prefix.cpp b/src/prefix.cpp index 99e20171f..126d16a72 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -44,8 +44,11 @@ extern "C" { #endif /* __cplusplus */ -#undef NULL -#define NULL ((void *) 0) + // Why is NULL being redefined?! This breaks compilation on Windows, as it disables the safe assignment of NULL to other pointer types. +#ifndef __WIN32__ +# undef NULL +# define NULL ((void *) 0) +#endif #ifdef __GNUC__ #define br_return_val_if_fail(expr,val) if (!(expr)) {fprintf (stderr, "** BinReloc (%s): assertion %s failed\n", __PRETTY_FUNCTION__, #expr); return val;} -- cgit v1.2.3