On Tue, Feb 1, 2011 at 12:26 AM, Peter Geoghegan
<peter.geoghegan86@gmail.com> wrote:
> On 31 January 2011 20:27, Dave Page <dpage@pgadmin.org> wrote:
>> I tried it on VC++ and it didn't complain. Didn't test gcc though.
>
> Can you produce a test case? I wasn't aware that it is possible to use
> the preprocessor to define C++ member function macros.
I was suggesting to use it instead of the ugly cast, not to define a
member function - eg.
diff --git a/pgadmin/pgAdmin3.cpp b/pgadmin/pgAdmin3.cpp
index 603c0fd..1b7105f 100644
--- a/pgadmin/pgAdmin3.cpp
+++ b/pgadmin/pgAdmin3.cpp
@@ -311,10 +311,11 @@ bool pgAdmin3::OnInit()
// Setup logging
InitLogger();
+#define cstr(x) ((const wxChar *)x)
wxString msg;
msg << wxT("# ") << appearanceFactory->GetLongAppName() <<
wxT(" Version ") << VERSION_STR << wxT(" Startup");
wxLogInfo(wxT("##############################################################"));
- wxLogInfo(wxT("%s"), msg.c_str());
+ wxLogInfo(wxT("%s"), cstr(msg));
wxLogInfo(wxT("##############################################################"));
#ifdef SSL
(which works fine on GCC too it seems).
>> OK - please send the updated patch and I'll test it again.
>
> Will do.
Thanks.
--
Dave Page
Blog: http://pgsnake.blogspot.com
Twitter: @pgsnake
EnterpriseDB UK: http://www.enterprisedb.com
The Enterprise PostgreSQL Company