X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/4d3845c073617a5849cca7a0aa6b8ee889564b28..9c34a216817028bc533e07873d047208a96b05a2:/include/wx/cpp.h?ds=inline diff --git a/include/wx/cpp.h b/include/wx/cpp.h index 9fed106a76..11cdc03c2f 100644 --- a/include/wx/cpp.h +++ b/include/wx/cpp.h @@ -13,6 +13,8 @@ #ifndef _WX_CPP_H_ #define _WX_CPP_H_ +#include "wx/compiler.h" /* wxCHECK_XXX_VERSION() macros */ + /* wxCONCAT works like preprocessor ## operator but also works with macros */ #define wxCONCAT_HELPER(text, line) text ## line @@ -124,16 +126,24 @@ #endif /* __WXFUNCTION__ already defined */ -#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ - (defined(__cplusplus) && __cplusplus >= 201103L) - #define wxHAS_VARIADIC_MACROS -#elif defined(__GNUC__) && __GNUC__ >= 3 - #define wxHAS_VARIADIC_MACROS -#elif defined(_MSC_VER) && _MSC_VER >= 1400 - #define wxHAS_VARIADIC_MACROS -#endif +/* Auto-detect variadic macros support unless explicitly disabled. */ +#if !defined(HAVE_VARIADIC_MACROS) && !defined(wxNO_VARIADIC_MACROS) + /* Any C99 or C++11 compiler should have them. */ + #if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || \ + (defined(__cplusplus) && __cplusplus >= 201103L) + #define HAVE_VARIADIC_MACROS + #elif wxCHECK_GCC_VERSION(3,0) + #define HAVE_VARIADIC_MACROS + #elif wxCHECK_VISUALC_VERSION(8) + #define HAVE_VARIADIC_MACROS + #elif wxCHECK_WATCOM_VERSION(1,2) + #define HAVE_VARIADIC_MACROS + #endif +#endif /* !HAVE_VARIADIC_MACROS */ + + -#ifdef wxHAS_VARIADIC_MACROS +#ifdef HAVE_VARIADIC_MACROS /* wxCALL_FOR_EACH(what, ...) calls the macro from its first argument, what(pos, x), for every remaining argument 'x', with 'pos' being its 1-based index in @@ -172,7 +182,7 @@ #else #define wxCALL_FOR_EACH Error_wx_CALL_FOR_EACH_requires_variadic_macros_support -#endif /* wxHAS_VARIADIC_MACROS */ +#endif /* HAVE_VARIADIC_MACROS */ #endif /* _WX_CPP_H_ */