'Prepare the C{self.extensions} attribute (used by
L{build_ext.build_ext}) by checking which extensions in
I{conditionalExtensions} should be built.  In addition, if we are
building on NT, define the WIN32 macro to 1.'

def prepare_extensions(self):

    if (os.name == 'nt'):
        self.define_macros = [('WIN32', 1)]
    else:
        self.define_macros = []
    if sys.platform.startswith('sunos'):
        self.define_macros.append(('_XOPEN_SOURCE', 1))
        self.define_macros.append(('_XOPEN_SOURCE_EXTENDED', 1))
    self.extensions = [x for x in self.conditionalExtensions if x.condition(self)]
    for ext in self.extensions:
        ext.define_macros.extend(self.define_macros)
