wxPython on Win64

Hi all,

As some of you may know the choice of compiler and runtime options is important for the wxPython builds on Windows. If I want wxPython to be usable with the stock distributions of Python then I need to build with the same (or compatible) compiler, compile options, and runtime libraries that are used for the Python builds.

I've run into a bit of an odd combination that will require some tweaks in wx. Python 2.5 is built with MSVC 7.1 (VisStudio.Net 2003) but since that tool doesn't provide a 64-bit compiler the Python folks used the compiler available with the Platform SDK for the 64-bit build. Getting that set up and working wasn't too hard, once I figured out what they had done. The tricky part is that the PSDK compiler is actually a version of VC 8, but it appears it is using a runtime library that is similar to the one shipped with VC 7.1.

Surprisingly (to me at least) I've only run into one place in wx where this odd combination is a problem, and that's in datetime.cpp with this code:

     #elif defined(__VISUALC8__)
         // _timezone is not present in VC8 static run-time library but
         // _get_timezone() is so just use it for all builds
         static long wxGetTimeZone()
         {
             static long s_timezone = LONG_MAX; // invalid timezone
             if ( s_timezone == LONG_MAX )
                 _get_timezone(&s_timezone);

             return s_timezone;
         }
         #define WX_TIMEZONE wxGetTimeZone()
     #else // unknown platform - try timezone
         #define WX_TIMEZONE timezone
     #endif

I get an undefined symbol error for _get_timezone. So my questions are, does anybody have a better suggestion for a workaround for the above besides just letting it fall through to the #else case? And does anybody know what symbols/values should be checked in an #if to detect this compiler/runtime combo at compile time?

There is also one place where I needed to turn off optimizations in order to avoid an internal compiler error, but that is easily dealt with by using a #pragma once I figure out how to wrap it in an #if/#endif.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!