[fiber] PR: Replace #include "Windows.h" by "windows.h"

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

[fiber] PR: Replace #include "Windows.h" by "windows.h"

Boost - Dev mailing list
Hi,
A #include "Windows.h" causes troubles when cross-compiling on Linux
in C++14 mode with MinGW-W64 with Posix threads.

Can we change it to "windows.h"?

Here is a PR:
https://github.com/boostorg/fiber/pull/134

Thanks,

Frédéric

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fiber] PR: Replace #include "Windows.h" by "windows.h"

Boost - Dev mailing list
On 12 July 2017 at 13:55, Frédéric Bron via Boost <[hidden email]>
wrote:

> Hi,
> A #include "Windows.h" causes troubles when cross-compiling on Linux
> in C++14 mode with MinGW-W64 with Posix threads.
>
> Can we change it to "windows.h"?
>

The file installed by Visual Studio/Windows Kit *is* called "Windows.h"
(has always been).

How does this fare on a system with ReFS (I couldn't find anything
regarding this)?

 degski
--
"*Ihre sogenannte Religion wirkt bloß wie ein Opiat reizend, betäubend,
Schmerzen aus Schwäche stillend.*" - Novalis 1798

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fiber] PR: Replace #include "Windows.h" by "windows.h"

Boost - Dev mailing list
> The file installed by Visual Studio/Windows Kit *is* called "Windows.h"
> (has always been).
>
> How does this fare on a system with ReFS (I couldn't find anything
> regarding this)?

Is ReFS case sensitive?
Maybe we could use lower case windows.h only if __MINGW32__ is defined?

Frédéric

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fiber] PR: Replace #include "Windows.h" by "windows.h"

Boost - Dev mailing list
>> Maybe we could use lower case windows.h only if __MINGW32__ is defined?
>
> It's still a fudge that might break. Isn't it better to get to the bottom of
> the (MinGW-)problem (other headers are affected as well, as Windows.h is not
> the only header starting with a capital)?

That's right, we could look at all #includes in boost. I have just
checked and both mingw and mingw-w64 have only fully lower case
headers.

Frédéric

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: [fiber] PR: Replace #include "Windows.h" by "windows.h"

Boost - Dev mailing list
>> I have just checked and both mingw and mingw-w64 have only fully lower
>> case
>> headers.

I just checked all includes files from boost (1.65.0 beta2) that have
upper case character in their names and are present in mingw or
mingw-w64 in lower case. Here is what I found: 3 files, Activation.h,
Memory.h, Windows.h.

Those are in the following files:
./libs/thread/src/win32/thread.cpp:36:#include <Activation.h>
./libs/iostreams/test/windows_pipe_test.cpp:9:#include <Windows.h>
./libs/process/test/bind_stderr.cpp:32:#   include <Windows.h>
./libs/process/test/bind_stdin.cpp:34:#   include <Windows.h>
./libs/process/test/sparring_partner.cpp:31:#   include <Windows.h>
./libs/process/test/bind_stdout_stderr.cpp:30:#   include <Windows.h>
./libs/process/test/exit_code.cpp:21:#   include <Windows.h>
./libs/process/test/bind_stdout.cpp:32:#   include <Windows.h>
./libs/process/test/group.cpp:32:#   include <Windows.h>
./libs/process/test/spawn.cpp:33:#   include <Windows.h>
./libs/process/test/spawn_fail.cpp:29:#   include <Windows.h>
./libs/process/test/system_test1.cpp:38:#   include <Windows.h>
./tools/build/src/engine/boehm_gc/MacOS.c:19:#include <Memory.h>
./boost/fiber/detail/futex.hpp:21:#include <Windows.h>
./boost/fiber/detail/cpu_relax.hpp:19:# include <Windows.h>

So that is not a lot. For Memory.h, it seems related to MacOS, not Windows.
If people really want to keep the upper case letter, we could then have
#ifdef __MINGW32__
#include "windows.h"
#else
#include "Windows.h"
#endif

Frédéric


Frédéric

_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Loading...