@staticmethod
def _patch_for_win_loadlibrary(orig_file, patch_file):
    """ Compiling loadlibrary.c triggers a missing definition of NMHDR.  A
        regular build from python.orgg doesn't have this problem so it is
        likely that the qmake build system is either not defining soemthing it
        should or defining something it shouldn't.  Including Python.h seems
        to work around the problem.
        """
    for line in orig_file:
        minimal = line.strip().replace(' ', '')
        if minimal == '#include<windows.h>':
            patch_file.write('#include <Python.h>\n\n')
        patch_file.write(line)
