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 From 41ab3bd526807e0a092466e7d4e979f12bab81ff Mon Sep 17 00:00:00 2001 From: "Johan B. C. Engelen" Date: Tue, 13 May 2014 21:17:06 +0200 Subject: fix windows 64bit build. (changes already committed to trunk) (bzr r13341.1.19) --- src/prefix.cpp | 3 --- 1 file changed, 3 deletions(-) (limited to 'src/prefix.cpp') diff --git a/src/prefix.cpp b/src/prefix.cpp index 99e20171f..630d6caa8 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -44,9 +44,6 @@ extern "C" { #endif /* __cplusplus */ -#undef NULL -#define NULL ((void *) 0) - #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;} #else -- cgit v1.2.3 From 6762be8823131f9426c39013816f38f6a21e1482 Mon Sep 17 00:00:00 2001 From: "Liam P. White" Date: Mon, 1 Sep 2014 11:34:28 -0400 Subject: BinReloc: fix -Wwrite-strings (bzr r13538) --- src/prefix.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/prefix.cpp') diff --git a/src/prefix.cpp b/src/prefix.cpp index 126d16a72..dd8872a1d 100644 --- a/src/prefix.cpp +++ b/src/prefix.cpp @@ -192,7 +192,7 @@ br_locate_prefix (void *symbol) * br_prepend_prefix (&argc, "/share/foo/data.png"); --> Returns "/usr/share/foo/data.png" */ char * -br_prepend_prefix (void *symbol, char *path) +br_prepend_prefix (void *symbol, char const *path) { char *tmp, *newpath; -- cgit v1.2.3