From: dpage Date: Thu, 10 Sep 2009 08:56:00 +0000 (+0000) Subject: The Sun compiler defines _T which conflicts with wxWidgets use of the X-Git-Url: http://git.postgresql.org/gitweb/static/%7B%7Bpguslink%28?a=commitdiff_plain;h=e0d2e3a6506cbb838b1769914a4eb1e05c119512;p=users%2Fquan74%2Fpgadmin-import.git The Sun compiler defines _T which conflicts with wxWidgets use of the macro, as discussed at http://trac.wxwidgets.org/ticket/10660. This patch removes any issues from pgAdmin [Zdenek Kotala] git-svn-id: svn://svn.pgadmin.org/trunk/pgadmin3@8033 a7884b65-44f6-0310-8a51-81a127f17b15 --- diff --git a/pgadmin/include/pgscript/stack.hh b/pgadmin/include/pgscript/stack.hh index c1f22140a..5b623182f 100644 --- a/pgadmin/include/pgscript/stack.hh +++ b/pgadmin/include/pgscript/stack.hh @@ -35,6 +35,15 @@ #ifndef BISON_STACK_HH # define BISON_STACK_HH +/* The Sun compiler defines _T, which conflicts with wxWidgets, so + we must un-define it if needed. */ +#if defined(__SUNPRO_CC) +#ifdef _T +#undef _T +#define _T_is_defined +#endif +#endif /*__SUNPRO_CC */ + #include namespace pgscript @@ -126,4 +135,18 @@ namespace pgscript }; } +/* Redefine _T if we un-defined it for the Sun compiler. */ +#if defined(__SUNPRO_CC) +#ifdef _T_is_defined +#undef _T_is_defined +/* we need to define it back only if _T already was defined. */ +#if !wxUSE_UNICODE +#define _T(x) x +#else /* Unicode */ +/* use wxCONCAT_HELPER so that x could be expanded if it's a macro */ +#define _T(x) wxCONCAT_HELPER(L, x) +#endif /* ASCII/Unicode */ +#endif /* T_is_defined */ +#endif /*__SUNPRO_CC */ + #endif // not BISON_STACK_HH