Trouble compiling tests standalone with cl

Dan Kegel daniel.r.kegel at gmail.com
Sun Oct 2 11:59:17 CDT 2005


While looking at
http://bugs.winehq.org/show_bug.cgi?id=1899
I noticed that dlls/msvcrt/tests/file.c didn't test
O_APPEND, so I thought I'd try building that
test standalone, running it under Windows,
and adding the missing test logic.

(Rather than building under Windows, I used
a shell script that invokes cl.exe --
see http://kegel.com/wine/cl-howto.html --
but that shouldn't matter here.
Just to be clear about what version of cl I'm using, cl -? shows:
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved
I also have the Platform SDK installed, so I have MS's headers, e.g.
/home/dank/.wine/drive_c/Program Files/MicrosoftSDK/include/WinNT.h
and my INCLUDE environment variable is set to
C:\Program Files\msvc2003\include;C:\Program Files\MicrosoftSDK\include
This used to work fine.)

To compile a test standalone, one should be able to do e.g.
  cd dlls/msvcrt/tests
  cl -DSTANDALONE -D_X86_ -I../../../include file.c

The first problem I ran into is that some wine .h files use wine-specific
processor defines, so compilation fails with e.g.
../../../include\basetsd.h(177) : fatal error C1189: #error :  Unknown
CPU architecture!

OK, I can live with one extra define, I guess, so I tried
  cl -DSTANDALONE -D_X86_ -D__i386__ -I../../../include file.c
But that fails with the errors
../../../include\winnt.h(1680) : error C2054: expected '(' to follow 'inline'
../../../include\winnt.h(1681) : error C2085: 'NtCurrentTeb' : not in
formal parameter list
...
../../../include\winbase.h(2271) : error C2054: expected '(' to follow 'inline'

Evidently cl doesn't like the inline functions in winnt.h and winbase.h.

Any suggestions?  It seems a bit strange to be using wine's winnt.h
when I have MS's headers, but I haven't tracked that down yet.
Should Wine's headers build with cl?

Thanks,
Dan



More information about the wine-devel mailing list