boostorg / winapi

Windows API declarations without <windows.h>, for internal Boost use.
62 stars 58 forks source link

basic_types.hpp includes <winerror.h> #81

Closed pdimov closed 4 years ago

pdimov commented 4 years ago

There are reports that <boost/system/error_code.hpp> breaks code using NO_ERROR; the reason is that winapi/error_codes.hpp includes winapi/basic_types.hpp which includes <winerror.h> which defines all error codes as macros, including NO_ERROR.

It's not clear why <winerror.h> is included; winapi/error_codes.hpp defines the error codes as non-macros and does not rely on the macros.

Lastique commented 4 years ago

Every user of Boost.WinAPI must still be prepared for any macros that might be defined by Windows SDK. This is because windows.h may still be included, either by user or by Boost.WinAPI itself.

As to why basic_types.hpp includes winerror.h, I'm not sure. Probably, this is a remnant from times when there was no error_codes.hpp header. I can probably remove that include, although it might break someone. I'll probably do that after the release.

pdimov commented 4 years ago

Reminder.

Lastique commented 4 years ago

Thanks.