FLTK logo

Re: [fltk.coredev] Re: fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw

FLTK matrix user chat room
(using Element browser app)   FLTK gitter user chat room   GitHub FLTK Project   FLTK News RSS Feed  
  FLTK Apps      FLTK Library      Forums      Links     Login 
 All Forums  |  Back to fltk.coredev  ]
 
Previous Message ]New Message | Reply ]Next Message ]

Re: Re: fltk-1.4 build error in Fl_WinAPI_System_Driver.cxx with 32-bit mingw imacarthur Apr 24, 2023  
 
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!
 
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.
 
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!

--
You received this message because you are subscribed to the Google Groups "fltk.coredev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to fltkcoredev+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/fltkcoredev/61f410bd-db63-4f6c-95e1-34242d025016n%40googlegroups.com.
Direct Link to Message ]
 
     
Previous Message ]New Message | Reply ]Next Message ]
 
 

Comments are owned by the poster. All other content is copyright 1998-2024 by Bill Spitzak and others. This project is hosted by The FLTK Team. Please report site problems to 'erco@seriss.com'.