Re: [xml] Patch to guard #define WIN32_LEAN_AND_MEAN



On 09/11/2017 16:58, Roumen Petrov wrote:
It is more correct do not define WIN32_LEAN_AND_MEAN in libxml and/or libxslt code. Better is configure.ac and respective configuation file for msvc to define such macro.
Why? Personally, I try to avoid defining macros on the command line wherever 
possible because it's action at a distance and inflexible. In my opinion, it's 
more robust to define the macro in code, having a single source of truth. Note 
that we only define the macro in .c files, so users including the public 
headers won't run into conflicts. I'm aware that there is a bit of redundancy 
right now because the macro is defined every time we include windows.h but 
this could be worked around.
Chromium is an exception since they integrate a static build of the library, 
but `configs -= [ ... ]` seems like a simple solution.
Nick


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]