These changes help PyOpenCL build with pybind11 on MinGW: https://gitlab.tiker.net/inducer/pyopencl/merge_requests/52/diffs It would likely be useful to incorporate them here as well. cc @isuruf