Re: Re: fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw
Albrecht Schlosser
Apr 24, 2023
On 4/24/23 11:34 imacarthur wrote:
On Friday, 21 April 2023 at 15:05:03 UTC+1
Albrecht Schlosser wrote:
I propose to define _WIN32_IE (as in your example) right
before '#include <shlobj.h>' to avoid other potential
side effects. Please test attached diff if it works for you.
Tested in various configs; seems to be working fine, at
least for me!
Thanks for testing!
There's one issue with this patch though: it could
happen that it would #undef _WIN32_IE if it's not defined.
Is this acceptable or would it perhaps issue compiler
warnings? I tested such a case with 'gcc -Wall -W
-Wpedantic -Wextra' and didn't get warnings, but I don't
know if the standard "allows" it and didn't test with MS
compilers. We could make sure that this doesn't happen with
another #if defined(_WIN32_IE) but if it's not necessary we
could just use my patch as-is.
I do not know for sure - I have never (as far as I can
recall, anyway!) ever seen a warning from #undef'ing a macro
that was not actually defined, but TBH I have no idea what the
standards say, or whether there may be some compiler that
would complain.
OK, I left it as-is. Let's see if someone complains.
Ian, if you test the patch and it works, would it be OK
if I committed it?
I'm happy with the patch, so go ahead with the commit.
If you are interested in a trivial "improvement" it might
be to adjust the comment:
// notably header versions 5.3.0 and earlier, whereas
5.4.2 seems to define _WIN32_IE as needed.
Because I see it fail with mingw32 header version 5.0.2
also. But that's a minor observation so feel free to ignore!
Thanks again, done in commit 6f77f40aadaaec8a including your
modification.
Comments are owned by the poster. All other content is copyright 1998-2025 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.