LLNL / units

A run-time C++ library for working with units of measurement and conversions between them and with string representations of units and measurements
https://units.readthedocs.io/en/latest/
BSD 3-Clause "New" or "Revised" License
146 stars 26 forks source link

come across compile error, if include Windows.h before units.hpp #344

Closed fengfengguo closed 1 month ago

fengfengguo commented 1 month ago

When I include Windows.h and units.hpp in a *.cpp, but Windows.h above units.hpp like image

then come across compile errors image

maybe the definition for time or min conflicts with some define in Windows

please help to resolve the problem, Thanks!

phlptp commented 1 month ago

I think the issue has been resolved in the main branch. I added a test and some fixes. The min unit identifier has been removed. Along with pascal and IN still not sure where those were coming from but they had the same issue as min when default windows.h was included.

fengfengguo commented 1 month ago

thanks very much for the solution!

I think the issue has been resolved in the main branch. I added a test and some fixes. The min unit identifier has been removed. Along with pascal and IN still not sure where those were coming from but they had the same issue as min when default windows.h was included.