Comment 1 for bug 277481

Revision history for this message
Alexander Belchenko (bialix) wrote : Re: [Bug 277481] [NEW] compiling C-extensions with MSVC produce warning

Oh, it's a known Pyrex bug.
Workaround is the same as I do for walkdirs_win32: define macros WIN32.
Here the patch:

--- setup.py 2008-10-02 15:36:12 +0000
+++ setup.py 2008-10-03 09:59:46 +0000
@@ -226,18 +226,21 @@
              ext_modules.append(Extension(module_name, [c_name], **kwargs))

-add_pyrex_extension('bzrlib._btree_serializer_c')
  add_pyrex_extension('bzrlib._knit_load_data_c')
  if sys.platform == 'win32':
- add_pyrex_extension('bzrlib._dirstate_helpers_c',
- libraries=['Ws2_32']
- )
      # pyrex uses the macro WIN32 to detect the platform, even though it should
      # be using something like _WIN32 or MS_WINDOWS, oh well, we can give it the
      # right value.
+ add_pyrex_extension('bzrlib._btree_serializer_c',
+ define_macros=[('WIN32', None)])
+ add_pyrex_extension('bzrlib._dirstate_helpers_c',
+ libraries=['Ws2_32'],
+ define_macros=[('WIN32', None)],
+ )
      add_pyrex_extension('bzrlib._walkdirs_win32',
                          define_macros=[('WIN32', None)])
  else:
+ add_pyrex_extension('bzrlib._btree_serializer_c')
      if have_pyrex and pyrex_version == '0.9.4.1':
          # Pyrex 0.9.4.1 fails to compile this extension correctly
          # The code it generates re-uses a "local" pointer and