mpusz / mp-units

The quantities and units library for C++
https://mpusz.github.io/mp-units/
MIT License
1.07k stars 85 forks source link

Work around Windows macro #459

Closed HazardyKnusperkeks closed 1 year ago

HazardyKnusperkeks commented 1 year ago

MinGW defines pascal: https://sourceforge.net/p/mingw-w64/mingw-w64/ci/master/tree/mingw-w64-headers/include/minwindef.h Same as the Windows SDK: https://github.com/tpn/winsdk-10/blob/master/Include/10.0.16299.0/shared/minwindef.h#L98

This at least protects the units header from that macro, users could still face the issue, but I don't think #undefing the macro globally should be done in a library header.

gitpod-io[bot] commented 1 year ago

mpusz commented 1 year ago

WOW! That is hilarious! 😅 I would never expect to have pascal macro in the C++ language. Thanks!

HazardyKnusperkeks commented 1 year ago

WOW! That is hilarious! 😅 I would never expect to have pascal macro in the C++ language. Thanks!

I was surprised too, my wrapper library with its test suite compiled fine, when I started developing on a different product I got a confusing error message and had to look at the preprocessed output.