From 8d808db43f64110b7f4df6b586579dc927142959 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 20 Mar 2014 19:52:45 +0000 Subject: [PATCH] Put a __cplusplus guard around C++-specific tests in wx/defs.h. This avoids the warning about __cplusplus being undefined in the recently added wxOVERRIDE logic and make the existing wx_xxx_cast<>s definitions simpler. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@76177 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 8f51b1335f..d87008d6b6 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -236,6 +236,8 @@ typedef short int WXTYPE; /* other feature tests */ /* ---------------------------------------------------------------------------- */ +#ifdef __cplusplus + /* Every ride down a slippery slope begins with a single step.. */ /* */ /* Yes, using nested classes is indeed against our coding standards in */ @@ -301,7 +303,7 @@ typedef short int WXTYPE; truncate from a larger to smaller type, static_cast<> can't be used for it as it results in warnings when using some compilers (SGI mipspro for example) */ -#if defined(__INTELC__) && defined(__cplusplus) +#if defined(__INTELC__) template inline T wx_truncate_cast_impl(X x) { @@ -320,7 +322,7 @@ typedef short int WXTYPE; #define wx_truncate_cast(t, x) wx_truncate_cast_impl(x) -#elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310 +#elif defined(__VISUALC__) && __VISUALC__ >= 1310 template inline T wx_truncate_cast_impl(X x) { @@ -405,6 +407,8 @@ typedef short int WXTYPE; #endif #endif /* defined(__has_include) */ +#endif /* __cplusplus */ + /* provide replacement for C99 va_copy() if the compiler doesn't have it */ /* could be already defined by configure or the user */