AprilRobotics / apriltag

AprilTag is a visual fiducial system popular for robotics research.
https://april.eecs.umich.edu/software/apriltag
Other
1.47k stars 522 forks source link

Use _WIN32 macro everywhere #337

Closed s-trinh closed 1 week ago

s-trinh commented 1 week ago

Looks like a typo to me.


There is no WIN32 macros (at least with usual compilers):

christian-rauch commented 1 week ago

Are you sure that the WIN32 macro does not exist? It may look like a typo because the other macros are named _WIN32, but WIN32 is indeed a defined macro.

This is definitely not a typo, since the macro exists. But I also find it confusing using WIN32 while all other Windows-specific sections of the code use _WIN32.

Can you rephrase your commit message to make clear that this is not a typo but rather to use a common macro or something similar?

s-trinh commented 1 week ago

I have updated the commit accordingly. Since it could be specific to MSVC, it is better to keep the original code IMO.

Luckily we have online tool... https://godbolt.org/z/8EKTj3sGc

christian-rauch commented 1 week ago

I have updated the commit accordingly. Since it could be specific to MSVC, it is better to keep the original code IMO.

Both macros are defined. But as you pointed out, this looks like a typo since all other Windows-specific sections use a different macro. I prefer to use the same macro for all OS-specific sections to avoid confusion.