From 2b764a1b8a2a760144157f32bd69e215c3c2a0bb Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Mon, 28 Nov 2016 01:50:30 +0100 Subject: [PATCH] Avoid clang 4.0 -Wexpansion-to-defined warnings It's not really clear why, but clang 4.0 has decided to start giving warnings about using the result of an expression constructed using the preprocessor "defined" operation in #if checks, so trivially avoid doing this. --- src/unix/uiactionx11.cpp | 6 +++++- src/unix/utilsunx.cpp | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/unix/uiactionx11.cpp b/src/unix/uiactionx11.cpp index 4bf33c93b0..a0912b55c9 100644 --- a/src/unix/uiactionx11.cpp +++ b/src/unix/uiactionx11.cpp @@ -36,7 +36,11 @@ // but it's useless to do it when using GTK+ 3 as it's not going to work with // it anyhow because GTK+ 3 needs XInput2 events and not the "classic" ones we // synthesize here, so don't even compile in this code for wxGTK3 port. -#define wxUSE_PLAINX_IMPL (!defined(__WXGTK3__)) +#ifdef __WXGTK3__ + #define wxUSE_PLAINX_IMPL 0 +#else + #define wxUSE_PLAINX_IMPL 1 +#endif namespace { diff --git a/src/unix/utilsunx.cpp b/src/unix/utilsunx.cpp index fdaa04b17a..aa3e8ddb96 100644 --- a/src/unix/utilsunx.cpp +++ b/src/unix/utilsunx.cpp @@ -20,7 +20,11 @@ #include "wx/utils.h" -#define USE_PUTENV (!defined(HAVE_SETENV) && defined(HAVE_PUTENV)) +#if !defined(HAVE_SETENV) && defined(HAVE_PUTENV) + #define USE_PUTENV 1 +#else + #define USE_PUTENV 0 +#endif #ifndef WX_PRECOMP #include "wx/string.h"