-
Notifications
You must be signed in to change notification settings - Fork 104
Open
Description
When specific Windows headers are selectively included before boost/regex is included, w32_regex_traits.hpp incorrectly assumes LCTYPE and various other symbols are defined.
This appears to be due to the check for BASETYPES:
| #ifndef BASETYPES |
This macro is defined in minwindef.h, But LCTYPE is actually defined in winnls.h. This check only holds if minwindef.h is transitively included through windows.h, which will itself include winnls.h.
As such, the following minimum example code fails to compile with the following error:
#define _AMD64_ // assuming x64
#include <windef.h>
#include <boost/regex.hpp>C:\.conan\3072f8\1\include\boost-1_86\boost\regex\v5\w32_regex_traits.hpp(200): error C2061: syntax error: identifier 'LCTYPE'
// various other errors for unknown identifiers
In my project, this problem appeared after updating CLI11 from 2.1.2 to 2.4.2. In header-only mode, the new version includes only a few Windows headers in its implementation (link).
Metadata
Metadata
Assignees
Labels
No labels