reassign 675801 mingw-w64-dev
found 675801 2.0.3-1
thanks

Hi Stefan,

On Sun, 03 Jun 2012 14:46:56 +0200, Stefan Bühler <stbueh...@lighttpd.net>
wrote:
> $ printf '#include <BaseTsd.h>\nint main() { return 0; }\n' | 
> i686-w64-mingw32-gcc -o /dev/stdout -E - # 1 "<stdin>"
> # 1 "<built-in>"
> # 1 "<command-line>"
> # 1 "<stdin>"
> <stdin>:1:21: fatal error: BaseTsd.h: No such file or directory
> compilation terminated.
> 
> Same problem with x86_64-w64-mingw32-gcc; <basetsd.h> works, but according
> to my windows box "BaseTsd.h" is the correct name.

Sorry I didn't get back to you sooner!

This is a difficult problem to solve nicely. Since Windows is
case-insensitive as far as file names are concerned, Windows compilers are
case-insensitive as far as header files are concerned; on Linux (and in
general Unix-like) systems that isn't the case. The solution advocated
generally is just to use lower case, which is what most Windows developers do
anyway - if you do a web search for basetsd.h you'll notice that it turns up
most frequently all in lower case.

In fact Microsoft's documentation and usage itself is inconsistent:
http://msdn.microsoft.com/en-us/library/windows/desktop/aa383751%28v=vs.85%29.aspx
uses "BaseTsd.h",
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384267%28v=vs.85%29.aspx
and
http://msdn.microsoft.com/en-us/library/windows/desktop/aa384268%28v=vs.85%29.aspx
mention "Basetsd.h", the header file identifies itself as "basetsd.h" and the
header files in the Windows 7 SDK which include it use "basetsd.h" too (see
Fci.h, Fdi.h, MMC.h, MMC.idl, MSClus.h, MSCluc.idl etc.).

So I'd suggest just using "basetsd.h" since that's what's practiced on
Windows, and it works on all platforms.

There is an alternative solution: if you add a header.gcc file
in /usr/i686-w64-mingw32/include/ containing

BaseTsd.h basetsd.h

you can use the -remap option to ask gcc to remap the header file names:

% printf '#include <BaseTsd.h>\nint main() { return 0; }\n' | 
i686-w64-mingw32-gcc -o /dev/stdout -E - # 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
<stdin>:1:21: fatal error: BaseTsd.h: No such file or directory
compilation terminated.

still fails as expected, but

% printf '#include <BaseTsd.h>\nint main() { return 0; }\n' | 
i686-w64-mingw32-gcc -remap -o /dev/stdout -E - # 1 "<stdin>"
# 1 "<built-in>"
# 1 "<command-line>"
# 1 "<stdin>"
# 1
"/usr/lib/gcc/i686-w64-mingw32/4.6/../../../../i686-w64-mingw32/include/basetsd.h"
1 3

etc.

works.

Regards,

Stephen

Attachment: signature.asc
Description: PGP signature

Reply via email to