KJK::Hyperion is proud to present "dllimport purity", another landmark commit that you should really build only after a "clean"

Disclaimer: in an uncharacteristic and daring move, I actually built, installed and booted this revision

modified   tools/rbuild/backend/mingw/mingw.cpp
modified   tools/rbuild/backend/mingw/modulehandler.cpp
modified   tools/rbuild/module.cpp
modified   tools/rbuild/project.dtd
modified   tools/rbuild/rbuild.h
modified   include/crt/_mingw.h
   New module attribute iscrt for marking modules that implement a C runtime library
   New module attribute crt for compiling and linking modules to a specific C runtime library. Can be "ntdll" (for ntdll.dll) "msvcrt" (msvcrt.dll), "crt" (statically-linked runtime), "libcntpr" (libcntpr.lib), "dll" (one of the <library> entries specifies a CRT DLL) or "static". Defaults to "msvcrt" for Win32 modules, to "static" for CRT modules themselves, and to "dll" for drivers
   Define _DLL for code that compiles against a dynamically-linked CRT
   Define __MINGW_IMPORT and _CRTIMP according to whether _DLL is defined. We finally use __declspec(dllimport) somewhere, anywhere (SDK headers still don't use it)
   Bonus fix: actually use compiler-specific command line flags when compiling files

modified   lib/3rdparty/adns/adns.rbuild
modified   lib/3rdparty/libxml2/libxml2.rbuild
modified   lib/3rdparty/mingw/mingw.rbuild
   And for the downside: static libraries that will be linked to a module that links to the CRT dynamically have to be compiled for a dynamically-linked CRT, as well. Say it out aloud.

modified   base/applications/wordpad/wordpad.rbuild
modified   base/setup/usetup/usetup.rbuild
modified   dll/3rdparty/dxtn/dxtn.rbuild
modified   dll/3rdparty/freetype/freetype.rbuild
modified   dll/3rdparty/mesa32/mesa32.rbuild
modified   dll/cpl/desk/desk.rbuild
modified   dll/cpl/input/input.rbuild
modified   dll/cpl/intl/intl.rbuild
modified   dll/cpl/joy/joy.rbuild
modified   dll/cpl/main/main.rbuild
modified   dll/cpl/mmsys/mmsys.rbuild
modified   dll/cpl/odbccp32/odbccp32.rbuild
modified   dll/cpl/powercfg/powercfg.rbuild
modified   dll/cpl/sysdm/sysdm.rbuild
modified   dll/cpl/telephon/telephon.rbuild
modified   dll/cpl/timedate/timedate.rbuild
modified   dll/cpl/usrmgr/usrmgr.rbuild
modified   dll/directx/ddraw/ddraw.rbuild
modified   dll/directx/dsound/dsound.rbuild
modified   dll/directx/wine/wined3d/wined3d.rbuild
modified   dll/nls/idndl_redist/idndl_redist.rbuild
modified   dll/nls/normaliz_redist/normaliz_redist.rbuild
modified   dll/shellext/deskadp/deskadp.rbuild
modified   dll/shellext/deskmon/deskmon.rbuild
modified   dll/shellext/fontext/fontext.rbuild
modified   dll/win32/dhcpcsvc/dhcpcsvc.rbuild
modified   dll/win32/dnsapi/dnsapi.rbuild
modified   dll/win32/glu32/glu32.rbuild
modified   dll/win32/icmp/icmp.rbuild
modified   dll/win32/winmm/midimap/midimap.rbuild
modified   drivers/video/displays/framebuf/framebuf.rbuild
modified   drivers/video/displays/framebufacc/framebufacc.rbuild
modified   drivers/video/displays/vga/vgaddi.rbuild
modified   subsystems/win32/csrss/csrss.rbuild
modified   subsystems/win32/csrss/win32csr/win32csr.rbuild
modified   subsystems/win32/win32k/win32k.rbuild
   Don't specify msvcrt explicitely as a <library> if it's going to be linked implicitely as the CRT
   <library>libcntpr</library> -> crt="libcntpr"
   Remove miscellaneous unused <library> entries

modified   dll/win32/crtdll/crtdll.rbuild
modified   dll/win32/msvcrt20/msvcrt20.rbuild
modified   dll/win32/msvcrt40/msvcrt40.rbuild
modified   dll/win32/msvcrt/msvcrt.rbuild
   Mark CRT DLLs as CRT modules

modified   dll/win32/user32/windows/font.c
modified   include/reactos/wine/unicode.h
   Don't redefine or redeclare CRT functions

modified   dll/win32/ws2_32/include/ws2_32.h
   Arch, you idiot, it's defined in <stdlib.h>

modified   include/crt/ctype.h
modified   include/crt/wctype.h
   Don't import ctype routines that were already defined as inlines

modified   include/crt/stdio.h
modified   include/reactos/wine/config.h
   Avoid linking to libmingwex.a if possible

modified   base/applications/taskmgr/taskmgr.rbuild
modified   tools/nci/nci.mak
modified   tools/nci/ncitool.c
modified   dll/ntdll/ntdll.rbuild
   Mark ntdll module as a CRT
   New "ntsys" module to import just Nt/Zw from ntdll.dll. Avoids accidentally linking to ntdll.dll's CRT when importing system calls

modified   include/psdk/winternl.h
   Nope, it doesn't.

modified   base/applications/network/net/help.c
modified   base/applications/network/net/main.c
   Replace printf with puts, or GCC will do it on its own and link to the dllimport thunk for puts

modified   base/applications/network/ping/ping.c
   Removed broken, unnecessary workaround

modified   base/shell/cmd/cmd.rbuild
   Simplify cmd module

This commit dediHAPPY BIRTHDAY STEFAN GINSBERG <3 <3 <3

svn path=/trunk/; revision=37187
This commit is contained in:
KJK::Hyperion 2008-11-04 18:16:58 +00:00
parent 3940878911
commit 00ed4c1394
65 changed files with 707 additions and 446 deletions

View file

@ -19,148 +19,148 @@ INT cmdHelp(INT argc, CHAR **argv)
if (strcmp(argv[0],"ACCOUNTS")==0) if (strcmp(argv[0],"ACCOUNTS")==0)
{ {
printf("ACCOUNTS\n"); puts("ACCOUNTS");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"COMPUTER")==0) if (strcmp(argv[0],"COMPUTER")==0)
{ {
printf("COMPUTER\n"); puts("COMPUTER");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"CONFIG")==0) if (strcmp(argv[0],"CONFIG")==0)
{ {
printf("CONFIG\n"); puts("CONFIG");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"CONTINUE")==0) if (strcmp(argv[0],"CONTINUE")==0)
{ {
printf("CONTINUE\n"); puts("CONTINUE");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"FILE")==0) if (strcmp(argv[0],"FILE")==0)
{ {
printf("FILE\n"); puts("FILE");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"GROUP")==0) if (strcmp(argv[0],"GROUP")==0)
{ {
printf("GROUP\n"); puts("GROUP");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"HELP")==0) if (strcmp(argv[0],"HELP")==0)
{ {
printf("HELP\n"); puts("HELP");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"HELPMSG")==0) if (strcmp(argv[0],"HELPMSG")==0)
{ {
printf("HELPMSG\n"); puts("HELPMSG");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"LOCALGROUP")==0) if (strcmp(argv[0],"LOCALGROUP")==0)
{ {
printf("LOCALGROUP\n"); puts("LOCALGROUP");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"NAME")==0) if (strcmp(argv[0],"NAME")==0)
{ {
printf("NAME\n"); puts("NAME");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"PRINT")==0) if (strcmp(argv[0],"PRINT")==0)
{ {
printf("PRINT\n"); puts("PRINT");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"SEND")==0) if (strcmp(argv[0],"SEND")==0)
{ {
printf("SEND\n"); puts("SEND");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"SESSION")==0) if (strcmp(argv[0],"SESSION")==0)
{ {
printf("SESSION\n"); puts("SESSION");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"SHARE")==0) if (strcmp(argv[0],"SHARE")==0)
{ {
printf("SHARE\n"); puts("SHARE");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"START")==0) if (strcmp(argv[0],"START")==0)
{ {
printf("START\n"); puts("START");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"STATISTICS")==0) if (strcmp(argv[0],"STATISTICS")==0)
{ {
printf("STATISTICS\n"); puts("STATISTICS");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"STOP")==0) if (strcmp(argv[0],"STOP")==0)
{ {
printf("STOP\n"); puts("STOP");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"TIME")==0) if (strcmp(argv[0],"TIME")==0)
{ {
printf("TIME\n"); puts("TIME");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"USE")==0) if (strcmp(argv[0],"USE")==0)
{ {
printf("USE\n"); puts("USE");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"USER")==0) if (strcmp(argv[0],"USER")==0)
{ {
printf("USER\n"); puts("USER");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
if (strcmp(argv[0],"VIEW")==0) if (strcmp(argv[0],"VIEW")==0)
{ {
printf("VIEW\n"); puts("VIEW");
printf("help text\n"); puts("help text");
return 0; return 0;
} }
@ -170,30 +170,30 @@ INT cmdHelp(INT argc, CHAR **argv)
void help() void help()
{ {
printf("NET ACCOUNTS\n"); puts("NET ACCOUNTS");
printf("NET COMPUTER\n"); puts("NET COMPUTER");
printf("NET CONFIG\n"); puts("NET CONFIG");
printf("NET CONFIG SERVER\n"); puts("NET CONFIG SERVER");
printf("NET CONFIG WORKSTATION\n"); puts("NET CONFIG WORKSTATION");
printf("NET CONTINUE\n"); puts("NET CONTINUE");
printf("NET FILE\n"); puts("NET FILE");
printf("NET GROUP\n"); puts("NET GROUP");
printf("NET HELP\n"); puts("NET HELP");
printf("NET HELPMSG\n"); puts("NET HELPMSG");
printf("NET LOCALGROUP\n"); puts("NET LOCALGROUP");
printf("NET NAME\n"); puts("NET NAME");
printf("NET PAUSE\n"); puts("NET PAUSE");
printf("NET PRINT\n"); puts("NET PRINT");
printf("NET SEND\n"); puts("NET SEND");
printf("NET SESSION\n"); puts("NET SESSION");
printf("NET SHARE\n"); puts("NET SHARE");
printf("NET START\n"); puts("NET START");
printf("NET STATISTICS\n"); puts("NET STATISTICS");
printf("NET STOP\n"); puts("NET STOP");
printf("NET TIME\n"); puts("NET TIME");
printf("NET USE\n"); puts("NET USE");
printf("NET USER\n"); puts("NET USER");
printf("NET VIEW\n"); puts("NET VIEW");
} }

View file

@ -114,7 +114,7 @@ int main(int argc, char **argv)
int unimplement() int unimplement()
{ {
printf("This command is not implement yet\n"); puts("This command is not implement yet");
return 1; return 1;
} }

View file

@ -14,19 +14,6 @@
#define NDEBUG #define NDEBUG
#ifndef _MSC_VER
/* Should be in the header files somewhere (exported by ntdll.dll) */
long atol(const char *str);
#ifndef __int64
typedef long long __int64;
#endif
char * _i64toa(__int64 value, char *string, int radix);
#endif /* _MSC_VER */
/* General ICMP constants */ /* General ICMP constants */
#define ICMP_MINSIZE 8 /* Minimum ICMP packet size */ #define ICMP_MINSIZE 8 /* Minimum ICMP packet size */
#define ICMP_MAXSIZE 65535 /* Maximum ICMP packet size */ #define ICMP_MAXSIZE 65535 /* Maximum ICMP packet size */

View file

@ -2,8 +2,7 @@
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="taskmgr" type="win32gui" installbase="system32" installname="taskmgr.exe" unicode="yes"> <module name="taskmgr" type="win32gui" installbase="system32" installname="taskmgr.exe" unicode="yes">
<include base="taskmgr">.</include> <include base="taskmgr">.</include>
<library>msvcrt</library> <library>ntsys</library>
<library>ntdll</library>
<library>kernel32</library> <library>kernel32</library>
<library>advapi32</library> <library>advapi32</library>
<library>user32</library> <library>user32</library>

View file

@ -6,7 +6,6 @@
<library>shell32</library> <library>shell32</library>
<library>user32</library> <library>user32</library>
<library>gdi32</library> <library>gdi32</library>
<library>msvcrt</library>
<library>advapi32</library> <library>advapi32</library>
<library>kernel32</library> <library>kernel32</library>
<library>comctl32</library> <library>comctl32</library>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="usetup" type="nativecui" installbase="system32" installname="usetup.exe" allowwarnings="false"> <module name="usetup" type="nativecui" installbase="system32" installname="usetup.exe" allowwarnings="false" crt="static">
<bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" /> <bootstrap installbase="$(CDOUTPUT)/system32" nameoncd="smss.exe" />
<include base="usetup">.</include> <include base="usetup">.</include>
<include base="zlib">.</include> <include base="zlib">.</include>

View file

@ -1,11 +1,18 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
<group> <group>
<module name="cmd_base" type="objectlibrary" unicode="yes"> <module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
<include base="ReactOS">include/reactos/wine</include> <include base="ReactOS">include/reactos/wine</include>
<include base="cmd_base">.</include> <include base="cmd">.</include>
<define name="ANONYMOUSUNIONS" /> <define name="ANONYMOUSUNIONS" />
<define name="_DEBUG_MEM" /> <define name="_DEBUG_MEM" />
<library>wine</library>
<library>kernel32</library>
<library>advapi32</library>
<library>shell32</library>
<library>user32</library>
<file>cmd.rc</file>
<file>main.c</file>
<pch>precomp.h</pch> <pch>precomp.h</pch>
<compilationunit name="unit.c"> <compilationunit name="unit.c">
<file>alias.c</file> <file>alias.c</file>
@ -67,17 +74,4 @@
<file>window.c</file> <file>window.c</file>
</compilationunit> </compilationunit>
</module> </module>
<module name="cmd" type="win32cui" installbase="system32" installname="cmd.exe" unicode="yes">
<include base="ReactOS">include/reactos/wine</include>
<include base="cmd">.</include>
<define name="ANONYMOUSUNIONS" />
<library>cmd_base</library>
<library>wine</library>
<library>kernel32</library>
<library>advapi32</library>
<library>shell32</library>
<library>user32</library>
<file>cmd.rc</file>
<file>main.c</file>
</module>
</group> </group>

View file

@ -2,9 +2,6 @@
<importlibrary definition="dxtn.def" /> <importlibrary definition="dxtn.def" />
<include base="dxtn">.</include> <include base="dxtn">.</include>
<define name="__USE_W32API" /> <define name="__USE_W32API" />
<library>msvcrt</library>
<file>fxt1.c</file> <file>fxt1.c</file>
<file>dxtn.c</file> <file>dxtn.c</file>
<file>wrapper.c</file> <file>wrapper.c</file>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="freetype" type="kernelmodedll" entrypoint="0" baseaddress="${BASEADDRESS_FREETYPE}" installbase="system32" installname="freetype.dll" allowwarnings="true"> <module name="freetype" type="kernelmodedll" entrypoint="0" baseaddress="${BASEADDRESS_FREETYPE}" installbase="system32" installname="freetype.dll" allowwarnings="true" crt="libcntpr">
<importlibrary definition="freetype.def" /> <importlibrary definition="freetype.def" />
<include base="freetype">include</include> <include base="freetype">include</include>
<define name="_DISABLE_TIDENTS" /> <define name="_DISABLE_TIDENTS" />
@ -14,7 +14,6 @@
<define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" /> <define name="TT_CONFIG_OPTION_BYTECODE_INTERPRETER" />
</if> </if>
<library>ntoskrnl</library> <library>ntoskrnl</library>
<library>libcntpr</library>
<directory name="i386"> <directory name="i386">
<file>setjmplongjmp.s</file> <file>setjmplongjmp.s</file>
</directory> </directory>

View file

@ -5,7 +5,6 @@
<linkerflag>-enable-stdcall-fixup</linkerflag> <linkerflag>-enable-stdcall-fixup</linkerflag>
<library>ntdll</library> <library>ntdll</library>
<library>kernel32</library> <library>kernel32</library>
<library>msvcrt</library>
<library>user32</library> <library>user32</library>
<define name="USE_EXTERNAL_DXTN_LIB" /> <define name="USE_EXTERNAL_DXTN_LIB" />
<!-- The following is autogenrated by Makefile.ReactOS --> <!-- The following is autogenrated by Makefile.ReactOS -->

View file

@ -15,7 +15,6 @@
<library>shell32</library> <library>shell32</library>
<library>ntdll</library> <library>ntdll</library>
<library>msimg32</library> <library>msimg32</library>
<library>msvcrt</library>
<library>uuid</library> <library>uuid</library>
<file>advmon.c</file> <file>advmon.c</file>
<file>appearance.c</file> <file>appearance.c</file>

View file

@ -7,7 +7,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library> <library>comctl32</library>
<library>msvcrt</library>
<library>gdi32</library> <library>gdi32</library>
<file>input.c</file> <file>input.c</file>
<file>settings.c</file> <file>settings.c</file>

View file

@ -8,7 +8,6 @@
<library>comctl32</library> <library>comctl32</library>
<library>advapi32</library> <library>advapi32</library>
<library>setupapi</library> <library>setupapi</library>
<library>msvcrt</library>
<library>shell32</library> <library>shell32</library>
<file>currency.c</file> <file>currency.c</file>
<file>date.c</file> <file>date.c</file>

View file

@ -7,7 +7,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library> <library>comctl32</library>
<library>msvcrt</library>
<library>ole32</library> <library>ole32</library>
<library>uuid</library> <library>uuid</library>
<library>shell32</library> <library>shell32</library>

View file

@ -11,7 +11,6 @@
<library>comdlg32</library> <library>comdlg32</library>
<library>shell32</library> <library>shell32</library>
<library>gdi32</library> <library>gdi32</library>
<library>msvcrt</library>
<file>keyboard.c</file> <file>keyboard.c</file>
<file>main.c</file> <file>main.c</file>
<file>mouse.c</file> <file>mouse.c</file>

View file

@ -6,7 +6,6 @@
<library>kernel32</library> <library>kernel32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library> <library>comctl32</library>
<library>msvcrt</library>
<library>devmgr</library> <library>devmgr</library>
<library>gdi32</library> <library>gdi32</library>
<library>winmm</library> <library>winmm</library>

View file

@ -6,7 +6,6 @@
<library>kernel32</library> <library>kernel32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library> <library>comctl32</library>
<library>msvcrt</library>
<file>odbccp32.c</file> <file>odbccp32.c</file>
<file>odbccp32.rc</file> <file>odbccp32.rc</file>
</module> </module>

View file

@ -9,7 +9,6 @@
<library>powrprof</library> <library>powrprof</library>
<library>comctl32</library> <library>comctl32</library>
<library>shell32</library> <library>shell32</library>
<library>msvcrt</library>
<library>advapi32</library> <library>advapi32</library>
<file>powercfg.c</file> <file>powercfg.c</file>
<file>powershemes.c</file> <file>powershemes.c</file>

View file

@ -6,11 +6,9 @@
<library>kernel32</library> <library>kernel32</library>
<library>advapi32</library> <library>advapi32</library>
<library>setupapi</library> <library>setupapi</library>
<library>msvcrt</library>
<library>user32</library> <library>user32</library>
<library>gdi32</library> <library>gdi32</library>
<library>comctl32</library> <library>comctl32</library>
<library>ntdll</library>
<library>msimg32</library> <library>msimg32</library>
<library>shell32</library> <library>shell32</library>
<library>shlwapi</library> <library>shlwapi</library>

View file

@ -7,7 +7,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>user32</library> <library>user32</library>
<library>comctl32</library> <library>comctl32</library>
<library>msvcrt</library>
<library>ole32</library> <library>ole32</library>
<library>uuid</library> <library>uuid</library>
<library>shell32</library> <library>shell32</library>

View file

@ -10,7 +10,6 @@
<library>comctl32</library> <library>comctl32</library>
<library>ws2_32</library> <library>ws2_32</library>
<library>iphlpapi</library> <library>iphlpapi</library>
<library>msvcrt</library>
<file>clock.c</file> <file>clock.c</file>
<file>dateandtime.c</file> <file>dateandtime.c</file>
<file>internettime.c</file> <file>internettime.c</file>

View file

@ -10,7 +10,6 @@
<library>comctl32</library> <library>comctl32</library>
<library>ntdll</library> <library>ntdll</library>
<library>netapi32</library> <library>netapi32</library>
<library>msvcrt</library>
<file>extra.c</file> <file>extra.c</file>
<file>groupprops.c</file> <file>groupprops.c</file>
<file>groups.c</file> <file>groups.c</file>

View file

@ -11,7 +11,6 @@
<library>ole32</library> <library>ole32</library>
<library>user32</library> <library>user32</library>
<library>advapi32</library> <library>advapi32</library>
<library>msvcrt</library>
<library>pseh</library> <library>pseh</library>
<file>ddraw.rc</file> <file>ddraw.rc</file>

View file

@ -14,7 +14,6 @@
<library>ole32</library> <library>ole32</library>
<library>winmm</library> <library>winmm</library>
<library>dxguid</library> <library>dxguid</library>
<library>msvcrt</library>
<file>version.rc</file> <file>version.rc</file>
<file>buffer.c</file> <file>buffer.c</file>
<file>capture.c</file> <file>capture.c</file>

View file

@ -14,7 +14,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>kernel32</library> <library>kernel32</library>
<library>uuid</library> <library>uuid</library>
<library>msvcrt</library>
<file>ati_fragment_shader.c</file> <file>ati_fragment_shader.c</file>
<file>arb_program_shader.c</file> <file>arb_program_shader.c</file>

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="idndl_redist" type="win32dll" installname="idndl_redist.dll"> <module name="idndl_redist" type="win32dll" installname="idndl_redist.dll" crt="libcntpr">
<library>kernel32</library> <library>kernel32</library>
<library>scripts</library> <library>scripts</library>
<library>libcntpr</library>
<compilerflag compiler="cpp">-fno-exceptions</compilerflag> <compilerflag compiler="cpp">-fno-exceptions</compilerflag>
<compilerflag compiler="cpp">-fno-rtti</compilerflag> <compilerflag compiler="cpp">-fno-rtti</compilerflag>
<linkerflag>--entry=0</linkerflag> <linkerflag>--entry=0</linkerflag>

View file

@ -4,11 +4,10 @@
<include base="icu4ros">icu/source/common</include> <include base="icu4ros">icu/source/common</include>
<directory name="data"><file>icudt38.c</file></directory> <directory name="data"><file>icudt38.c</file></directory>
</module> </module>
<module name="normaliz_redist" type="win32dll" installname="normaliz_redist.dll"> <module name="normaliz_redist" type="win32dll" installname="normaliz_redist.dll" crt="libcntpr">
<library>normalize</library> <library>normalize</library>
<library>idna</library> <library>idna</library>
<library>normaliz_redist_data</library> <library>normaliz_redist_data</library>
<library>libcntpr</library>
<library>kernel32</library> <library>kernel32</library>
<compilerflag compiler="cpp">-fno-exceptions</compilerflag> <compilerflag compiler="cpp">-fno-exceptions</compilerflag>
<compilerflag compiler="cpp">-fno-rtti</compilerflag> <compilerflag compiler="cpp">-fno-rtti</compilerflag>

View file

@ -1,7 +1,10 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../tools/rbuild/project.dtd">
<group> <group>
<module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll"> <module name="ntsys" type="staticlibrary">
<importlibrary definition="def/ntsys.pspec" dllname="ntdll.dll" root="intermediate" />
</module>
<module name="ntdll" type="win32dll" entrypoint="0" baseaddress="${BASEADDRESS_NTDLL}" installbase="system32" installname="ntdll.dll" iscrt="yes">
<bootstrap installbase="$(CDOUTPUT)/system32" /> <bootstrap installbase="$(CDOUTPUT)/system32" />
<importlibrary definition="def/ntdll_$(ARCH).def" /> <importlibrary definition="def/ntdll_$(ARCH).def" />
<include base="ntdll">include</include> <include base="ntdll">include</include>

View file

@ -8,7 +8,6 @@
<library>comctl32</library> <library>comctl32</library>
<library>ole32</library> <library>ole32</library>
<library>uuid</library> <library>uuid</library>
<library>msvcrt</library>
<file>deskadp.c</file> <file>deskadp.c</file>
<file>shxiface.c</file> <file>shxiface.c</file>
<file>deskadp.rc</file> <file>deskadp.rc</file>

View file

@ -8,7 +8,6 @@
<library>comctl32</library> <library>comctl32</library>
<library>ole32</library> <library>ole32</library>
<library>uuid</library> <library>uuid</library>
<library>msvcrt</library>
<file>deskmon.c</file> <file>deskmon.c</file>
<file>shxiface.c</file> <file>shxiface.c</file>
<file>deskmon.rc</file> <file>deskmon.rc</file>

View file

@ -7,7 +7,6 @@
<library>gdi32</library> <library>gdi32</library>
<library>ole32</library> <library>ole32</library>
<library>uuid</library> <library>uuid</library>
<library>msvcrt</library>
<library>shlwapi</library> <library>shlwapi</library>
<library>lz32</library> <library>lz32</library>
<library>advapi32</library> <library>advapi32</library>

View file

@ -1,4 +1,4 @@
<module name="crtdll" type="win32dll" baseaddress="${BASEADDRESS_CRTDLL}" mangledsymbols="true" installbase="system32" installname="crtdll.dll"> <module name="crtdll" type="win32dll" baseaddress="${BASEADDRESS_CRTDLL}" mangledsymbols="true" installbase="system32" installname="crtdll.dll" iscrt="true">
<importlibrary definition="crtdll.def" /> <importlibrary definition="crtdll.def" />
<include base="crtdll">.</include> <include base="crtdll">.</include>
<include base="crt">include</include> <include base="crt">include</include>

View file

@ -4,7 +4,6 @@
<define name="_DISABLE_TIDENTS" /> <define name="_DISABLE_TIDENTS" />
<library>ntdll</library> <library>ntdll</library>
<library>kernel32</library> <library>kernel32</library>
<library>msvcrt</library>
<library>ws2_32</library> <library>ws2_32</library>
<library>iphlpapi</library> <library>iphlpapi</library>
<file>dhcpcsvc.c</file> <file>dhcpcsvc.c</file>

View file

@ -9,7 +9,6 @@
<library>ntdll</library> <library>ntdll</library>
<library>kernel32</library> <library>kernel32</library>
<library>user32</library> <library>user32</library>
<library>msvcrt</library>
<library>ws2_32</library> <library>ws2_32</library>
<library>iphlpapi</library> <library>iphlpapi</library>
<directory name="dnsapi"> <directory name="dnsapi">

View file

@ -14,7 +14,6 @@
<library>opengl32</library> <library>opengl32</library>
<library>kernel32</library> <library>kernel32</library>
<library>gdi32</library> <library>gdi32</library>
<library>msvcrt</library>
<directory name="libnurbs"> <directory name="libnurbs">
<directory name="interface"> <directory name="interface">
<file>bezierEval.cc</file> <file>bezierEval.cc</file>

View file

@ -6,7 +6,6 @@
<library>kernel32</library> <library>kernel32</library>
<library>ws2_32</library> <library>ws2_32</library>
<library>wine</library> <library>wine</library>
<library>msvcrt</library>
<file>icmp_main.c</file> <file>icmp_main.c</file>
<file>icmp.rc</file> <file>icmp.rc</file>
<file>icmp.spec</file> <file>icmp.spec</file>

View file

@ -1,4 +1,4 @@
<module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll"> <module name="msvcrt" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT}" mangledsymbols="true" installbase="system32" installname="msvcrt.dll" iscrt="yes">
<importlibrary definition="msvcrt.def" /> <importlibrary definition="msvcrt.def" />
<include base="msvcrt">.</include> <include base="msvcrt">.</include>
<include base="crt">include</include> <include base="crt">include</include>

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group> <group>
<module name="msvcrt20" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT20}" installbase="system32" installname="msvcrt20.dll" allowwarnings="true" entrypoint="0"> <module name="msvcrt20" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT20}" installbase="system32" installname="msvcrt20.dll" allowwarnings="true" entrypoint="0" iscrt="yes">
<importlibrary definition="msvcrt20.spec" /> <importlibrary definition="msvcrt20.spec" />
<include base="msvcrt20">.</include> <include base="msvcrt20">.</include>
<include base="ReactOS">include/reactos/wine</include> <include base="ReactOS">include/reactos/wine</include>

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<group> <group>
<module name="msvcrt40" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT40}" installbase="system32" installname="msvcrt40.dll"> <module name="msvcrt40" type="win32dll" baseaddress="${BASEADDRESS_MSVCRT40}" installbase="system32" installname="msvcrt40.dll" iscrt="yes">
<importlibrary definition="msvcrt40.spec" /> <importlibrary definition="msvcrt40.spec" />
<include base="msvcrt40">.</include> <include base="msvcrt40">.</include>
<include base="ReactOS">include/reactos/wine</include> <include base="ReactOS">include/reactos/wine</include>

View file

@ -34,7 +34,17 @@
/* FUNCTIONS *****************************************************************/ /* FUNCTIONS *****************************************************************/
void _assert(const char *msg, const char *file, int line) #ifndef NDEBUG
#ifdef assert
#undef assert
#endif
#define assert(e) ((e) ? (void)0 : _font_assert(#e, __FILE__, __LINE__))
#endif
void _font_assert(const char *msg, const char *file, int line)
{ {
/* Assertion failed at foo.c line 45: x<y */ /* Assertion failed at foo.c line 45: x<y */
DbgPrint("Assertion failed at %s line %d: %s\n", file, line, msg); DbgPrint("Assertion failed at %s line %d: %s\n", file, line, msg);

View file

@ -9,7 +9,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>user32</library> <library>user32</library>
<library>winmm</library> <library>winmm</library>
<library>msvcrt</library>
<file>midimap.c</file> <file>midimap.c</file>
<file>midimap.rc</file> <file>midimap.rc</file>
</module> </module>

View file

@ -7,6 +7,8 @@
#ifndef __WS2_32_H #ifndef __WS2_32_H
#define __WS2_32_H #define __WS2_32_H
#include <stdlib.h>
#define WIN32_NO_STATUS #define WIN32_NO_STATUS
#include <winsock2.h> #include <winsock2.h>
#include <ws2spi.h> #include <ws2spi.h>
@ -21,10 +23,6 @@
#include <debug.h> #include <debug.h>
#include <windns.h> // DNS_A_DATA #include <windns.h> // DNS_A_DATA
/* Exported by ntdll.dll, but where is the prototype? */
unsigned long strtoul(const char *nptr, char **endptr, int base);
#define EXPORT STDCALL #define EXPORT STDCALL
extern HINSTANCE g_hInstDll; extern HINSTANCE g_hInstDll;

View file

@ -1,10 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="framebuf" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="framebuf.dll"> <module name="framebuf" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="framebuf.dll" crt="libcntpr">
<importlibrary definition="framebuf.spec" /> <importlibrary definition="framebuf.spec" />
<include base="framebuf">.</include> <include base="framebuf">.</include>
<library>win32k</library> <library>win32k</library>
<library>libcntpr</library>
<file>enable.c</file> <file>enable.c</file>
<file>palette.c</file> <file>palette.c</file>
<file>pointer.c</file> <file>pointer.c</file>

View file

@ -1,10 +1,9 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="framebufacc" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="framebuf.dll"> <module name="framebufacc" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="framebuf.dll" crt="libcntpr">
<importlibrary definition="framebufacc.spec" /> <importlibrary definition="framebufacc.spec" />
<include base="framebufacc">.</include> <include base="framebufacc">.</include>
<library>win32k</library> <library>win32k</library>
<library>libcntpr</library>
<file>enable.c</file> <file>enable.c</file>
<file>palette.c</file> <file>palette.c</file>
<file>pointer.c</file> <file>pointer.c</file>

View file

@ -1,9 +1,8 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
<module name="vgaddi" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="vgaddi.dll"> <module name="vgaddi" type="kernelmodedll" entrypoint="DrvEnableDriver@12" installbase="system32" installname="vgaddi.dll" crt="libcntpr">
<importlibrary definition="vgaddi.spec" /> <importlibrary definition="vgaddi.spec" />
<include base="vgaddi">.</include> <include base="vgaddi">.</include>
<library>libcntpr</library>
<library>win32k</library> <library>win32k</library>
<directory name="main"> <directory name="main">
<file>enable.c</file> <file>enable.c</file>

View file

@ -51,28 +51,46 @@
/* Try to avoid problems with outdated checks for GCC __attribute__ support. */ /* Try to avoid problems with outdated checks for GCC __attribute__ support. */
#undef __attribute__ #undef __attribute__
#ifndef __GNUC__ #if defined(_MSC_VER)
# ifdef _DLL
# ifndef __MINGW_IMPORT # ifndef __MINGW_IMPORT
# define __MINGW_IMPORT __declspec(dllimport) # define __MINGW_IMPORT __declspec(dllimport)
# endif # endif
# ifndef _CRTIMP # ifndef _CRTIMP
# define _CRTIMP __declspec(dllimport) # define _CRTIMP __declspec(dllimport)
# endif # endif
# else
# ifndef __MINGW_IMPORT
# define __MINGW_IMPORT
# endif
# ifndef _CRTIMP
# define _CRTIMP
# endif
# endif
# define __DECLSPEC_SUPPORTED # define __DECLSPEC_SUPPORTED
# define __attribute__(x) /* nothing */ # define __attribute__(x) /* nothing */
#else /* __GNUC__ */ # define __restrict__ /* nothing */
#elif defined(__GNUC__)
# ifdef __declspec # ifdef __declspec
# ifndef __MINGW_IMPORT # ifndef __MINGW_IMPORT
# ifdef _DLL
/* Note the extern. This is needed to work around GCC's /* Note the extern. This is needed to work around GCC's
limitations in handling dllimport attribute. */ limitations in handling dllimport attribute. */
# define __MINGW_IMPORT extern __attribute__ ((__dllimport__)) # define __MINGW_IMPORT extern __attribute__ ((__dllimport__))
# else
# define __MINGW_IMPORT extern
# endif
# endif # endif
# ifndef _CRTIMP # ifndef _CRTIMP
# ifdef __USE_CRTIMP # ifdef __USE_CRTIMP
# ifdef _DLL
# define _CRTIMP __attribute__ ((dllimport)) # define _CRTIMP __attribute__ ((dllimport))
# else # else
# define _CRTIMP # define _CRTIMP
# endif # endif
# else
# define _CRTIMP
# endif
# endif # endif
# define __DECLSPEC_SUPPORTED # define __DECLSPEC_SUPPORTED
# else /* __declspec */ # else /* __declspec */
@ -82,6 +100,12 @@
# define _CRTIMP # define _CRTIMP
# endif # endif
# endif /* __declspec */ # endif /* __declspec */
/*
The next two defines can cause problems if user code adds the __cdecl attribute
like so:
void __attribute__ ((__cdecl)) foo(void);
*/
# ifndef __cdecl # ifndef __cdecl
# define __cdecl __attribute__ ((__cdecl__)) # define __cdecl __attribute__ ((__cdecl__))
# endif # endif
@ -106,6 +130,15 @@
# ifndef __hyper # ifndef __hyper
# define __hyper long long # define __hyper long long
# endif # endif
#else
# ifndef __MINGW_IMPORT
# define __MINGW_IMPORT __declspec(dllimport)
# endif
# ifndef _CRTIMP
# define _CRTIMP __declspec(dllimport)
# endif
# define __DECLSPEC_SUPPORTED
# define __attribute__(x) /* nothing */
#endif /* __GNUC__ */ #endif /* __GNUC__ */
#if defined (__GNUC__) && defined (__GNUC_MINOR__) #if defined (__GNUC__) && defined (__GNUC_MINOR__)
@ -116,10 +149,20 @@
#define __MINGW_GNUC_PREREQ(major, minor) 0 #define __MINGW_GNUC_PREREQ(major, minor) 0
#endif #endif
#if defined (_MSC_VER)
#define __MINGW_MSC_PREREQ(major, minor) \
((_MSC_VER / 100) > (major) \
|| ((_MSC_VER / 100) == (major) && (_MSC_VER % 100) >= (minor)))
#else
#define __MINGW_MSC_PREREQ(major, minor) 0
#endif
#ifdef __cplusplus #ifdef __cplusplus
# define __CRT_INLINE inline # define __CRT_INLINE inline
#else #else
# if __GNUC_STDC_INLINE__ # if defined(_MSC_VER)
# define __CRT_INLINE __inline
# elif __GNUC_STDC_INLINE__
# define __CRT_INLINE extern inline __attribute__((__gnu_inline__)) # define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
# else # else
# define __CRT_INLINE extern __inline__ # define __CRT_INLINE extern __inline__
@ -139,14 +182,32 @@
#ifdef __GNUC__ #ifdef __GNUC__
#define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__)) #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
#define __MINGW_ATTRIB_CONST __attribute__ ((__const__)) #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
#elif __MINGW_MSC_PREREQ(12, 0)
#define __MINGW_ATTRIB_NORETURN __declspec(noreturn)
#define __MINGW_ATTRIB_CONST
#else #else
#define __MINGW_ATTRIB_NORETURN #define __MINGW_ATTRIB_NORETURN
#define __MINGW_ATTRIB_CONST #define __MINGW_ATTRIB_CONST
#endif #endif
#if defined(__GNUC__)
#define __mingw_va_start(v,l) __builtin_va_start(v,l)
#define __mingw_va_end(v) __builtin_va_end(v)
#define __mingw_va_arg(v,l) __builtin_va_arg(v,l)
#define __mingw_va_copy(d,s) __builtin_va_copy(d,s)
#elif defined(_MSC_VER)
#define __mingw_va_start(v,l) __msc_va_start(v,l)
#define __mingw_va_end(v) __msc_va_end(v)
#define __mingw_va_arg(v,l) __msc_va_arg(v,l)
#define __mingw_va_copy(d,s) __msc_va_copy(d,s)
#endif
#if __MINGW_GNUC_PREREQ (3, 0) #if __MINGW_GNUC_PREREQ (3, 0)
#define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__)) #define __MINGW_ATTRIB_MALLOC __attribute__ ((__malloc__))
#define __MINGW_ATTRIB_PURE __attribute__ ((__pure__)) #define __MINGW_ATTRIB_PURE __attribute__ ((__pure__))
#elif __MINGW_MSC_PREREQ (14, 0)
#define __MINGW_ATTRIB_MALLOC __declspec(noalias) __declspec(restrict)
#define __MINGW_ATTRIB_PURE
#else #else
#define __MINGW_ATTRIB_MALLOC #define __MINGW_ATTRIB_MALLOC
#define __MINGW_ATTRIB_PURE #define __MINGW_ATTRIB_PURE
@ -163,35 +224,28 @@
#if __MINGW_GNUC_PREREQ (3, 1) #if __MINGW_GNUC_PREREQ (3, 1)
#define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__)) #define __MINGW_ATTRIB_DEPRECATED __attribute__ ((__deprecated__))
#elif __MINGW_MSC_PREREQ (12, 0)
#define __MINGW_ATTRIB_DEPRECATED __declspec (deprecated)
#else #else
#define __MINGW_ATTRIB_DEPRECATED #define __MINGW_ATTRIB_DEPRECATED
#endif /* GNUC >= 3.1 */ #endif
#if __MINGW_GNUC_PREREQ (3, 3) #if __MINGW_GNUC_PREREQ (3, 3)
#define __MINGW_NOTHROW __attribute__ ((__nothrow__)) #define __MINGW_NOTHROW __attribute__ ((__nothrow__))
#elif __MINGW_MSC_PREREQ (12, 0) && defined (__cplusplus)
#define __MINGW_NOTHROW __declspec (nothrow)
#else #else
#define __MINGW_NOTHROW #define __MINGW_NOTHROW
#endif /* GNUC >= 3.3 */ #endif
/* TODO: Mark (almost) all CRT functions as __MINGW_NOTHROW. This will
allow GCC to optimize away some EH unwind code, at least in DW2 case. */
#ifndef __MSVCRT_VERSION__ #ifndef __MSVCRT_VERSION__
/* High byte is the major version, low byte is the minor. */ /* High byte is the major version, low byte is the minor. */
# define __MSVCRT_VERSION__ 0x0600 # define __MSVCRT_VERSION__ 0x0600
#endif #endif
#ifndef _SIZE_T_DEFINED
#define _SIZE_T_DEFINED
#undef size_t
#ifdef _WIN64
#if defined(__GNUC__) && defined(__STRICT_ANSI__)
typedef unsigned int size_t __attribute__ ((mode (DI)));
#else
typedef unsigned __int64 size_t;
#endif
#else
typedef unsigned int size_t;
#endif
#endif
#define __MINGW32_VERSION 3.13 #define __MINGW32_VERSION 3.13
#define __MINGW32_MAJOR_VERSION 3 #define __MINGW32_MAJOR_VERSION 3
#define __MINGW32_MINOR_VERSION 13 #define __MINGW32_MINOR_VERSION 13

View file

@ -190,20 +190,8 @@ typedef wchar_t wctype_t;
#define _WCTYPE_T_DEFINED #define _WCTYPE_T_DEFINED
#endif #endif
_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); _CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t);
_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ _CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */
_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__ || defined __cplusplus || !defined __STRICT_ANSI__ || defined __cplusplus
@ -243,6 +231,21 @@ __CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc)
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
#ifndef __WCTYPE_INLINES_DEFINED
_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
#endif
#ifndef __STRICT_ANSI__ #ifndef __STRICT_ANSI__
int __cdecl __MINGW_NOTHROW __isascii (int); int __cdecl __MINGW_NOTHROW __isascii (int);
int __cdecl __MINGW_NOTHROW __toascii (int); int __cdecl __MINGW_NOTHROW __toascii (int);

View file

@ -205,15 +205,27 @@ _CRTIMP int __cdecl __MINGW_NOTHROW vprintf (const char*, __VALIST);
_CRTIMP int __cdecl __MINGW_NOTHROW vsprintf (char*, const char*, __VALIST); _CRTIMP int __cdecl __MINGW_NOTHROW vsprintf (char*, const char*, __VALIST);
_CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST); _CRTIMP int __cdecl __MINGW_NOTHROW _vsnprintf (char*, size_t, const char*, __VALIST);
#ifndef __NO_ISOCEXT /* externs in libmingwex.a */ #ifndef __NO_ISOCEXT
int __cdecl __MINGW_NOTHROW snprintf(char *, size_t, const char *, ...); __CRT_INLINE int __cdecl __MINGW_NOTHROW snprintf(char * s, size_t n, const char * f, ...)
int __cdecl __MINGW_NOTHROW vsnprintf (char *, size_t, const char *, __VALIST); {
int r;
__VALIST a;
__mingw_va_start(a, f);
r = _vsnprintf (s, n, f, a);
__mingw_va_end(a);
return r;
}
int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__, __VALIST); __CRT_INLINE int __cdecl __MINGW_NOTHROW vsnprintf (char * s, size_t n, const char * f, __VALIST a)
int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__, const char * __restrict__, {
__VALIST); return _vsnprintf (s, n, f, a);
int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__, }
const char * __restrict__, __VALIST);
int __cdecl __MINGW_NOTHROW vscanf (const char * __restrict__ f, __VALIST a);
int __cdecl __MINGW_NOTHROW vfscanf (FILE * __restrict__ o, const char * __restrict__ f,
__VALIST a);
int __cdecl __MINGW_NOTHROW vsscanf (const char * __restrict__ s,
const char * __restrict__ f, __VALIST a);
#endif #endif
/* /*

View file

@ -64,20 +64,8 @@ typedef wchar_t wctype_t;
#endif #endif
/* Wide character equivalents - also in ctype.h */ /* Wide character equivalents - also in ctype.h */
_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t); _CRTIMP int __cdecl __MINGW_NOTHROW iswctype(wint_t, wctype_t);
_CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */ _CRTIMP int __cdecl __MINGW_NOTHROW is_wctype(wint_t, wctype_t); /* Obsolete! */
_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
#if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \ #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
|| !defined __STRICT_ANSI__ || defined __cplusplus || !defined __STRICT_ANSI__ || defined __cplusplus
@ -146,6 +134,21 @@ __CRT_INLINE int __cdecl __MINGW_NOTHROW iswblank (wint_t wc)
#endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */ #endif /* !(defined(__NO_CTYPE_INLINES) || defined(__WCTYPE_INLINES_DEFINED)) */
#ifndef __WCTYPE_INLINES_DEFINED
_CRTIMP int __cdecl __MINGW_NOTHROW iswalnum(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswalpha(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswascii(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswcntrl(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswdigit(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswgraph(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswlower(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswprint(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswpunct(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswspace(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswupper(wint_t);
_CRTIMP int __cdecl __MINGW_NOTHROW iswxdigit(wint_t);
#endif
typedef wchar_t wctrans_t; typedef wchar_t wctrans_t;
/* These are resolved by libmingwex.a. Note, that they are also exported /* These are resolved by libmingwex.a. Note, that they are also exported

View file

@ -1662,9 +1662,6 @@ typedef enum _SYSDBG_COMMAND {
* Function declarations * Function declarations
*/ */
extern LPSTR _strlwr(LPSTR str); /* FIXME: Doesn't belong here */
extern LPSTR _strupr(LPSTR str); /* FIXME: Doesn't belong here */
#if defined(__i386__) && defined(__GNUC__) #if defined(__i386__) && defined(__GNUC__)
static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); } static inline void WINAPI DbgBreakPoint(void) { __asm__ __volatile__("int3"); }
static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); } static inline void WINAPI DbgUserBreakPoint(void) { __asm__ __volatile__("int3"); }

View file

@ -797,7 +797,7 @@
#define HAVE_VA_COPY 1 #define HAVE_VA_COPY 1
/* Define to 1 if you have the `vsnprintf' function. */ /* Define to 1 if you have the `vsnprintf' function. */
//#define HAVE_VSNPRINTF 1 #define HAVE_VSNPRINTF 1
/* Define to 1 if you have the `wait4' function. */ /* Define to 1 if you have the `wait4' function. */
/* #undef HAVE_WAIT4 */ /* #undef HAVE_WAIT4 */

View file

@ -2,6 +2,8 @@
#define _WINE_UNICODE_H #define _WINE_UNICODE_H
#include <stdarg.h> #include <stdarg.h>
#include <stdlib.h>
#include <wchar.h>
#include <windef.h> #include <windef.h>
#include <winbase.h> #include <winbase.h>
@ -53,12 +55,6 @@
#endif #endif
#endif /* defined __VALIST */ #endif /* defined __VALIST */
int __cdecl _wtoi (const wchar_t *);
long __cdecl _wtol (const wchar_t *);
int __cdecl swprintf (wchar_t*, const wchar_t*, ...);
int __cdecl _snwprintf (wchar_t*, size_t, const wchar_t*, ...);
int __cdecl _vsnwprintf (wchar_t*, size_t, const wchar_t*, __VALIST);
static __inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept ) static __inline WCHAR *strpbrkW( const WCHAR *str, const WCHAR *accept )
{ {
for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str; for ( ; *str; str++) if (strchrW( accept, *str )) return (WCHAR *)str;

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="adns" type="staticlibrary" allowwarnings="true"> <module name="adns" type="staticlibrary" allowwarnings="true" crt="dll">
<include base="adns">src</include> <include base="adns">src</include>
<include base="adns">adns_win32</include> <include base="adns">adns_win32</include>
<define name="ADNS_JGAA_WIN32" /> <define name="ADNS_JGAA_WIN32" />

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE module SYSTEM "../../../tools/rbuild/project.dtd">
<module name="libxml2" type="staticlibrary" allowwarnings="true"> <module name="libxml2" type="staticlibrary" allowwarnings="true" crt="dll">
<define name="HAVE_CONFIG_H" /> <define name="HAVE_CONFIG_H" />
<define name="WIN32" /> <define name="WIN32" />
<define name="_WINDOWS" /> <define name="_WINDOWS" />

View file

@ -1,7 +1,7 @@
<?xml version="1.0"?> <?xml version="1.0"?>
<!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd"> <!DOCTYPE group SYSTEM "../../../tools/rbuild/project.dtd">
<group> <group>
<module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true"> <module name="mingw_common" type="staticlibrary" isstartuplib="true" underscoresymbols="true" crt="dll">
<importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" /> <importlibrary definition="moldname-msvcrt.def" dllname="msvcrt.dll" />
<include base="mingw_common">include</include> <include base="mingw_common">include</include>
<file>cpu_features.c</file> <file>cpu_features.c</file>
@ -19,19 +19,19 @@
<file>pseudo-reloc.c</file> <file>pseudo-reloc.c</file>
</if> </if>
</module> </module>
<module name="mingw_main" type="staticlibrary" isstartuplib="true" allowwarnings="true"> <module name="mingw_main" type="staticlibrary" isstartuplib="true" allowwarnings="true" crt="dll">
<include base="mingw_common">include</include> <include base="mingw_common">include</include>
<file>binmode.c</file> <file>binmode.c</file>
<file>crt1.c</file> <file>crt1.c</file>
<file>main.c</file> <file>main.c</file>
</module> </module>
<module name="mingw_wmain" type="staticlibrary" isstartuplib="true" allowwarnings="true"> <module name="mingw_wmain" type="staticlibrary" isstartuplib="true" allowwarnings="true" crt="dll">
<include base="mingw_common">include</include> <include base="mingw_common">include</include>
<file>wbinmode.c</file> <file>wbinmode.c</file>
<file>wcrt1.c</file> <file>wcrt1.c</file>
<file>wmain.c</file> <file>wmain.c</file>
</module> </module>
<module name="mingw_dllmain" type="staticlibrary" isstartuplib="true"> <module name="mingw_dllmain" type="staticlibrary" isstartuplib="true" crt="dll">
<include base="mingw_common">include</include> <include base="mingw_common">include</include>
<file>dllcrt1.c</file> <file>dllcrt1.c</file>
</module> </module>

View file

@ -9,7 +9,6 @@
<library>nt</library> <library>nt</library>
<library>ntdll</library> <library>ntdll</library>
<library>smdll</library> <library>smdll</library>
<library>msvcrt</library>
<directory name="api"> <directory name="api">
<file>handle.c</file> <file>handle.c</file>
<file>process.c</file> <file>process.c</file>

View file

@ -15,8 +15,6 @@
<library>advapi32</library> <library>advapi32</library>
<library>win32ksys</library> <library>win32ksys</library>
<library>psapi</library> <library>psapi</library>
<library>msvcrt</library>
<library>psapi</library>
<library>shell32</library> <library>shell32</library>
<pch>w32csr.h</pch> <pch>w32csr.h</pch>
<file>alias.c</file> <file>alias.c</file>

View file

@ -184,12 +184,11 @@
<file>stubs.c</file> <file>stubs.c</file>
</directory> </directory>
</module> </module>
<module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" allowwarnings="true"> <module name="win32k" type="kernelmodedriver" installbase="system32" installname="win32k.sys" allowwarnings="true" crt="libcntpr">
<importlibrary definition="win32k.pspec" /> <importlibrary definition="win32k.pspec" />
<library>win32k_base</library> <library>win32k_base</library>
<library>pseh</library> <library>pseh</library>
<library>ntoskrnl</library> <library>ntoskrnl</library>
<library>libcntpr</library>
<library>hal</library> <library>hal</library>
<library>freetype</library> <library>freetype</library>
<library>dxguid</library> <library>dxguid</library>

View file

@ -56,13 +56,15 @@ KERNEL_SVC_DB = ntoskrnl$(SEP)sysfuncs.lst
KERNEL_SERVICE_TABLE = $(INTERMEDIATE_)ntoskrnl$(SEP)include$(SEP)internal$(SEP)napi.h KERNEL_SERVICE_TABLE = $(INTERMEDIATE_)ntoskrnl$(SEP)include$(SEP)internal$(SEP)napi.h
NTDLL_STUBS = $(INTERMEDIATE_)lib$(SEP)ntdllsys$(SEP)ntdll.S NTDLL_STUBS = $(INTERMEDIATE_)lib$(SEP)ntdllsys$(SEP)ntdll.S
KERNEL_STUBS = $(INTERMEDIATE_)ntoskrnl$(SEP)ex$(SEP)zw.S KERNEL_STUBS = $(INTERMEDIATE_)ntoskrnl$(SEP)ex$(SEP)zw.S
NT_SPEC = $(INTERMEDIATE_)dll$(SEP)ntdll$(SEP)def$(SEP)ntsys.pspec
NCI_SERVICE_FILES = \ NCI_SERVICE_FILES = \
$(KERNEL_SERVICE_TABLE) \ $(KERNEL_SERVICE_TABLE) \
$(WIN32K_SERVICE_TABLE) \ $(WIN32K_SERVICE_TABLE) \
$(NTDLL_STUBS) \ $(NTDLL_STUBS) \
$(KERNEL_STUBS) \ $(KERNEL_STUBS) \
$(WIN32K_STUBS) $(WIN32K_STUBS) \
$(NT_SPEC)
$(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB) $(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB)
$(ECHO_NCI) $(ECHO_NCI)
@ -71,6 +73,7 @@ $(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB)
${mkdir} $(INTERMEDIATE_)ntoskrnl$(SEP)ex$(SEP) 2>$(NUL) ${mkdir} $(INTERMEDIATE_)ntoskrnl$(SEP)ex$(SEP) 2>$(NUL)
${mkdir} $(INTERMEDIATE_)subsystems$(SEP)win32$(SEP)win32k$(SEP)include 2>$(NUL) ${mkdir} $(INTERMEDIATE_)subsystems$(SEP)win32$(SEP)win32k$(SEP)include 2>$(NUL)
${mkdir} $(INTERMEDIATE_)lib$(SEP)win32ksys 2>$(NUL) ${mkdir} $(INTERMEDIATE_)lib$(SEP)win32ksys 2>$(NUL)
${mkdir} $(INTERMEDIATE_)dll$(SEP)ntdll$(SEP)def 2>$(NUL)
$(Q)$(NCI_TARGET) -arch $(ARCH) \ $(Q)$(NCI_TARGET) -arch $(ARCH) \
$(KERNEL_SVC_DB) \ $(KERNEL_SVC_DB) \
@ -79,7 +82,8 @@ $(NCI_SERVICE_FILES): $(NCI_TARGET) $(KERNEL_SVC_DB) $(WIN32K_SVC_DB)
$(WIN32K_SERVICE_TABLE) \ $(WIN32K_SERVICE_TABLE) \
$(NTDLL_STUBS) \ $(NTDLL_STUBS) \
$(KERNEL_STUBS) \ $(KERNEL_STUBS) \
$(WIN32K_STUBS) $(WIN32K_STUBS) \
$(NT_SPEC)
.PHONY: nci_service_files_clean .PHONY: nci_service_files_clean
nci_service_files_clean: nci_service_files_clean:

View file

@ -21,26 +21,29 @@
/* DEFINES ****************************************************************/ /* DEFINES ****************************************************************/
#define INPUT_BUFFER_SIZE 255 #define INPUT_BUFFER_SIZE 255
#define Arguments 7 #define Arguments 8
/******* Table Indexes ************/ /******* Table Indexes ************/
#define MAIN_INDEX 0x0 #define MAIN_INDEX 0x0
#define WIN32K_INDEX 0x1000 #define WIN32K_INDEX 0x1000
/******* Argument List ************/ /******* Argument List ************/
/* First, define the Databases */ /* Databases */
#define NativeSystemDb 0 #define NativeSystemDb 0
#define NativeGuiDb 1 #define NativeGuiDb 1
/* Now the Service Tables */ /* Service Tables */
#define NtosServiceTable 2 #define NtosServiceTable 2
#define Win32kServiceTable 3 #define Win32kServiceTable 3
/* And finally, the stub files. */ /* Stub Files */
#define NtosUserStubs 4 #define NtosUserStubs 4
#define NtosKernelStubs 5 #define NtosKernelStubs 5
#define Win32kStubs 6 #define Win32kStubs 6
/* Spec Files */
#define NtSpec 7
/********** Stub Code ************/ /********** Stub Code ************/
/* /*
@ -534,6 +537,108 @@ CreateSystemServiceTable(FILE *SyscallDb,
fprintf(SyscallTable, "ULONG %sNumberOfSysCalls = %d;\n", Name, SyscallId); fprintf(SyscallTable, "ULONG %sNumberOfSysCalls = %d;\n", Name, SyscallId);
} }
/*++
* WriteSpec
*
* Prints out the Spec Entry for a System Call.
*
* Params:
* SpecFile - Spec File to which to write the header.
*
* SyscallName - Name of System Call for which to add the stub.
*
* CountArguments - Number of arguments to the System Call.
*
* Returns:
* None.
*
* Remarks:
* None.
*
*--*/
void
WriteSpec(FILE* StubFile,
char* SyscallName,
unsigned CountArguments)
{
unsigned i;
fprintf(StubFile, "@ stdcall %s", SyscallName);
fputc ('(', StubFile);
for (i = 0; i < CountArguments; ++ i)
fputs ("ptr ", StubFile);
fputc (')', StubFile);
fputc ('\n', StubFile);
}
/*++
* CreateSpec
*
* Parses a System Call Database and creates a spec file for all the entries.
*
* Params:
* SyscallDb - System Call Database to parse.
*
* Files - Array of Spec Files to which to write.
*
* CountFiles - Number of Spec Files to create
*
* UseZw - Use Zw prefix?
*
* Returns:
* None.
*
* Remarks:
* None.
*
*--*/
void
CreateSpec(FILE * SyscallDb,
FILE * Files[],
unsigned CountFiles,
unsigned UseZw)
{
char Line[INPUT_BUFFER_SIZE];
char *NtSyscallName;
char *SyscallArguments;
unsigned CountArguments;
/* We loop until the end of the file */
while ((!feof(SyscallDb)) && (fgets(Line, sizeof(Line), SyscallDb) != NULL)) {
/* Extract the Name and Arguments */
GetNameAndArgumentsFromDb(Line, &NtSyscallName, &SyscallArguments);
CountArguments = strtoul(SyscallArguments, NULL, 0);
/* Make sure we really extracted something */
if (NtSyscallName) {
int i;
for (i= 0; i < CountFiles; i++) {
if (!UseZw) {
WriteSpec(Files[i],
NtSyscallName,
CountArguments);
}
if (UseZw && NtSyscallName[0] == 'N' && NtSyscallName[1] == 't') {
NtSyscallName[0] = 'Z';
NtSyscallName[1] = 'w';
WriteSpec(Files[i],
NtSyscallName,
CountArguments);
}
}
}
}
}
void usage(char * argv0) void usage(char * argv0)
{ {
printf("Usage: %s [-arch <arch>] sysfuncs.lst w32ksvc.db napi.h ssdt.h napi.S zw.S win32k.S win32k.S\n" printf("Usage: %s [-arch <arch>] sysfuncs.lst w32ksvc.db napi.h ssdt.h napi.S zw.S win32k.S win32k.S\n"
@ -545,6 +650,7 @@ void usage(char * argv0)
" zw.S NTOSKRNL Zw stubs\n" " zw.S NTOSKRNL Zw stubs\n"
" win32k.S GDI32 stubs\n" " win32k.S GDI32 stubs\n"
" win32k.S USER32 stubs\n" " win32k.S USER32 stubs\n"
" nt.pspec NTDLL exports\n"
" -arch is optional, default is %s\n", " -arch is optional, default is %s\n",
argv0, argv0,
ncitool_data[0].arch ncitool_data[0].arch
@ -619,21 +725,32 @@ int main(int argc, char* argv[])
1, 1,
0); 0);
/* Rewind the databases */
rewind(Files[NativeSystemDb]);
rewind(Files[NativeGuiDb]);
/* Create the Service Tables */ /* Create the Service Tables */
rewind(Files[NativeSystemDb]);
CreateSystemServiceTable(Files[NativeSystemDb], CreateSystemServiceTable(Files[NativeSystemDb],
Files[NtosServiceTable], Files[NtosServiceTable],
"Main", "Main",
argv[NtosServiceTable + ArgOffset]); argv[NtosServiceTable + ArgOffset]);
rewind(Files[NativeGuiDb]);
CreateSystemServiceTable(Files[NativeGuiDb], CreateSystemServiceTable(Files[NativeGuiDb],
Files[Win32kServiceTable], Files[Win32kServiceTable],
"Win32k", "Win32k",
argv[Win32kServiceTable + ArgOffset]); argv[Win32kServiceTable + ArgOffset]);
/* Create the Spec Files */
rewind(Files[NativeSystemDb]);
CreateSpec(Files[NativeSystemDb],
&Files[NtSpec],
1,
0);
rewind(Files[NativeSystemDb]);
CreateSpec(Files[NativeSystemDb],
&Files[NtSpec],
1,
1);
/* Close all files */ /* Close all files */
for (FileNumber = 0; FileNumber < Arguments-ArgOffset; FileNumber++) { for (FileNumber = 0; FileNumber < Arguments-ArgOffset; FileNumber++) {

View file

@ -450,7 +450,44 @@ MingwBackend::GenerateProjectGccOptionsMacro ( const char* assignmentOperation,
} }
} }
fprintf ( fMakefile, "\n" ); fputs ( "\n", fMakefile );
// TODO: reference these from somewhere
fprintf (
fMakefile,
"PROJECT_GCC_CFLAGS %s",
assignmentOperation );
for ( i = 0; i < data.compilerFlags.size(); i++ )
{
if ( data.compilerFlags[i]->compiler == CompilerTypeCC )
{
fprintf (
fMakefile,
" %s",
data.compilerFlags[i]->flag.c_str() );
}
}
fputs ( "\n", fMakefile );
fprintf (
fMakefile,
"PROJECT_GCC_CXXFLAGS %s",
assignmentOperation );
for ( i = 0; i < data.compilerFlags.size(); i++ )
{
if ( data.compilerFlags[i]->compiler == CompilerTypeCPP )
{
fprintf (
fMakefile,
" %s",
data.compilerFlags[i]->flag.c_str() );
}
}
fputs ( "\n", fMakefile );
} }
void void

View file

@ -1059,7 +1059,7 @@ Rule wmcRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext).rc
Rule winebuildPDefRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).auto.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n" Rule winebuildPDefRule ( "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).auto.def: $(source)$(dependencies) $(WINEBUILD_TARGET) | $(INTERMEDIATE)$(SEP)$(source_dir)\n"
"\t$(ECHO_WINEBLD)\n" "\t$(ECHO_WINEBLD)\n"
"\t${gcc} -xc -E ${$(module_name)_RCFLAGS} $(source) > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec\n" "\t${gcc} -xc -E ${$(module_name)_RCFLAGS} $(source) > $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec\n"
"\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_path)$(SEP)$(source_name_noext)_$(module_name).auto.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec\n\n", "\t$(Q)$(WINEBUILD_TARGET) $(WINEBUILD_FLAGS) -o $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).auto.def --def -E $(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec\n\n",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).def.spec",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).auto.def", "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)$(source_name_noext)_$(module_name).auto.def",
"$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL ); "$(INTERMEDIATE)$(SEP)$(source_dir)$(SEP)", NULL );
@ -1650,10 +1650,11 @@ MingwModuleHandler::GenerateObjectFileTargets ()
backend->GetFullPath ( *pchFilename ).c_str() ); backend->GetFullPath ( *pchFilename ).c_str() );
fprintf ( fMakefile, "\t$(ECHO_PCH)\n" ); fprintf ( fMakefile, "\t$(ECHO_PCH)\n" );
fprintf ( fMakefile, fprintf ( fMakefile,
"\t%s -o %s %s -g %s\n\n", "\t%s -o %s %s %s -g %s\n\n",
module.cplusplus ? cppc.c_str() : cc.c_str(), module.cplusplus ? cppc.c_str() : cc.c_str(),
backend->GetFullName ( *pchFilename ).c_str(), backend->GetFullName ( *pchFilename ).c_str(),
cflagsMacro.c_str(), cflagsMacro.c_str(),
GenerateCompilerParametersFromVector ( module.non_if_data.compilerFlags, module.cplusplus ? CompilerTypeCPP : CompilerTypeCC ).c_str(),
backend->GetFullName ( baseHeaderFile ).c_str() ); backend->GetFullName ( baseHeaderFile ).c_str() );
delete pchFilename; delete pchFilename;
} }
@ -1886,7 +1887,11 @@ MingwModuleHandler::GenerateOtherMacros ()
string globalCflags = ""; string globalCflags = "";
if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse ) if ( ModuleHandlerInformations[module.type].DefaultHost == HostFalse )
{
globalCflags += " $(PROJECT_CFLAGS)"; globalCflags += " $(PROJECT_CFLAGS)";
if ( module.dynamicCRT )
globalCflags += " -D_DLL -D__USE_CRTIMP";
}
else else
globalCflags += " -Wall -Wpointer-arith"; globalCflags += " -Wall -Wpointer-arith";
globalCflags += " -g"; globalCflags += " -g";
@ -2378,6 +2383,38 @@ MingwAddDebugSupportLibraries ( Module& module, DebugSupportType type )
module.non_if_data.libraries.push_back(pLibrary); module.non_if_data.libraries.push_back(pLibrary);
} }
static void
MingwAddCRTLibrary( Module &module )
{
const char * crtAttr = module.CRT.c_str ();
const char * crtLib = NULL;
if ( stricmp ( crtAttr, "libc" ) == 0 )
crtLib = "crt";
else if ( stricmp ( crtAttr, "msvcrt" ) == 0 )
crtLib = "msvcrt";
else if ( stricmp ( crtAttr, "libcntpr" ) == 0 )
crtLib = "libcntpr";
else if ( stricmp ( crtAttr, "ntdll" ) == 0 )
crtLib = "ntdll";
if ( crtLib )
{
Library* pLibrary = new Library ( module, std::string ( crtLib ) );
if ( pLibrary->importedModule == NULL)
{
throw XMLInvalidBuildFileException (
module.node.location,
"module '%s' trying to import non-existant C runtime module '%s'",
module.name.c_str(),
crtLib );
}
module.non_if_data.libraries.push_back ( pLibrary );
}
}
MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module& module_ ) MingwBuildToolModuleHandler::MingwBuildToolModuleHandler ( const Module& module_ )
: MingwModuleHandler ( module_ ) : MingwModuleHandler ( module_ )
{ {
@ -2479,6 +2516,7 @@ MingwKernelModeDLLModuleHandler::MingwKernelModeDLLModuleHandler (
void void
MingwKernelModeDLLModuleHandler::AddImplicitLibraries ( Module& module ) MingwKernelModeDLLModuleHandler::AddImplicitLibraries ( Module& module )
{ {
MingwAddCRTLibrary ( module );
MingwAddDebugSupportLibraries ( module, DebugKernelMode ); MingwAddDebugSupportLibraries ( module, DebugKernelMode );
} }
@ -2527,6 +2565,7 @@ MingwNativeDLLModuleHandler::MingwNativeDLLModuleHandler (
void void
MingwNativeDLLModuleHandler::AddImplicitLibraries ( Module& module ) MingwNativeDLLModuleHandler::AddImplicitLibraries ( Module& module )
{ {
MingwAddCRTLibrary ( module );
MingwAddDebugSupportLibraries ( module, DebugUserMode ); MingwAddDebugSupportLibraries ( module, DebugUserMode );
} }
@ -2575,6 +2614,7 @@ MingwNativeCUIModuleHandler::MingwNativeCUIModuleHandler (
void void
MingwNativeCUIModuleHandler::AddImplicitLibraries ( Module& module ) MingwNativeCUIModuleHandler::AddImplicitLibraries ( Module& module )
{ {
MingwAddCRTLibrary ( module );
MingwAddDebugSupportLibraries ( module, DebugUserMode ); MingwAddDebugSupportLibraries ( module, DebugUserMode );
} }
@ -2627,23 +2667,10 @@ MingwWin32OCXModuleHandler::MingwWin32OCXModuleHandler (
{ {
} }
static bool
LinksToCrt( Module &module )
{
for ( size_t i = 0; i < module.non_if_data.libraries.size (); i++ )
{
Library& library = *module.non_if_data.libraries[i];
if ( library.name == "libcntpr" || library.name == "crt" )
return true;
}
return false;
}
static void static void
MingwAddImplicitLibraries( Module &module ) MingwAddImplicitLibraries( Module &module )
{ {
Library* pLibrary; Library* pLibrary;
bool links_to_crt;
if ( module.type != Win32DLL if ( module.type != Win32DLL
&& module.type != Win32OCX && module.type != Win32OCX
@ -2651,31 +2678,11 @@ MingwAddImplicitLibraries( Module &module )
&& module.type != Win32GUI && module.type != Win32GUI
&& module.type != Win32SCR) && module.type != Win32SCR)
{ {
// no implicit libraries
return; return;
} }
links_to_crt = LinksToCrt ( module ); if ( module.isDefaultEntryPoint )
if ( !module.isDefaultEntryPoint )
{ {
if ( module.GetEntryPoint(false) == "0" )
{
if ( !links_to_crt )
{
pLibrary = new Library ( module, "mingw_common" );
module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin() , pLibrary );
pLibrary = new Library ( module, "msvcrt" );
module.non_if_data.libraries.push_back ( pLibrary );
links_to_crt = true;
}
}
pLibrary = new Library ( module, "debugsup_ntdll" );
module.non_if_data.libraries.push_back(pLibrary);
return;
}
if ( module.IsDLL () ) if ( module.IsDLL () )
{ {
//pLibrary = new Library ( module, "__mingw_dllmain" ); //pLibrary = new Library ( module, "__mingw_dllmain" );
@ -2686,19 +2693,13 @@ MingwAddImplicitLibraries( Module &module )
pLibrary = new Library ( module, module.isUnicode ? "mingw_wmain" : "mingw_main" ); pLibrary = new Library ( module, module.isUnicode ? "mingw_wmain" : "mingw_main" );
module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary ); module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin(), pLibrary );
} }
pLibrary = new Library ( module, "mingw_common" );
module.non_if_data.libraries.insert ( module.non_if_data.libraries.begin() + 1, pLibrary );
if ( !links_to_crt )
{
// always link in msvcrt to get the basic routines
pLibrary = new Library ( module, "msvcrt" );
module.non_if_data.libraries.push_back ( pLibrary );
} }
pLibrary = new Library ( module, "debugsup_ntdll" ); pLibrary = new Library ( module, "mingw_common" );
module.non_if_data.libraries.push_back(pLibrary); module.non_if_data.libraries.push_back ( pLibrary );
MingwAddCRTLibrary ( module );
MingwAddDebugSupportLibraries ( module, DebugUserMode );
} }
void void

View file

@ -232,6 +232,28 @@ void IfableData::ProcessXML ()
compilationUnits[i]->ProcessXML (); compilationUnits[i]->ProcessXML ();
} }
bool Module::GetBooleanAttribute ( const XMLElement& moduleNode, const char * name, bool default_value )
{
const XMLAttribute* att = moduleNode.GetAttribute ( name, false );
if ( att != NULL )
{
const char* p = att->value.c_str();
if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
return true;
else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
return false;
else
{
throw InvalidAttributeValueException (
moduleNode.location,
name,
att->value );
}
}
else
return default_value;
}
Module::Module ( const Project& project, Module::Module ( const Project& project,
const XMLElement& moduleNode, const XMLElement& moduleNode,
const string& modulePath ) const string& modulePath )
@ -282,24 +304,7 @@ Module::Module ( const Project& project,
else else
extension = GetDefaultModuleExtension (); extension = GetDefaultModuleExtension ();
att = moduleNode.GetAttribute ( "unicode", false ); isUnicode = GetBooleanAttribute ( moduleNode, "unicode" );
if ( att != NULL )
{
const char* p = att->value.c_str();
if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
isUnicode = true;
else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
isUnicode = false;
else
{
throw InvalidAttributeValueException (
moduleNode.location,
"unicode",
att->value );
}
}
else
isUnicode = false;
if (isUnicode) if (isUnicode)
{ {
@ -337,24 +342,7 @@ Module::Module ( const Project& project,
else else
baseaddress = GetDefaultModuleBaseaddress (); baseaddress = GetDefaultModuleBaseaddress ();
att = moduleNode.GetAttribute ( "mangledsymbols", false ); mangledSymbols = GetBooleanAttribute ( moduleNode, "mangledsymbols" );
if ( att != NULL )
{
const char* p = att->value.c_str();
if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
mangledSymbols = true;
else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
mangledSymbols = false;
else
{
throw InvalidAttributeValueException (
moduleNode.location,
"mangledsymbols",
att->value );
}
}
else
mangledSymbols = false;
att = moduleNode.GetAttribute ( "underscoresymbols", false ); att = moduleNode.GetAttribute ( "underscoresymbols", false );
if ( att != NULL ) if ( att != NULL )
@ -362,24 +350,50 @@ Module::Module ( const Project& project,
else else
underscoreSymbols = false; underscoreSymbols = false;
att = moduleNode.GetAttribute ( "isstartuplib", false ); isStartupLib = GetBooleanAttribute ( moduleNode, "isstartuplib" );
if ( att != NULL ) isCRT = GetBooleanAttribute ( moduleNode, "iscrt", GetDefaultModuleIsCRT () );
att = moduleNode.GetAttribute ( "crt", false );
if ( att != NULL)
{ {
const char* p = att->value.c_str(); CRT = att->value;
if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
isStartupLib = true; if ( stricmp ( CRT.c_str (), "auto" ) == 0 )
else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) ) CRT = GetDefaultModuleCRT ();
isStartupLib = false; }
else
CRT = GetDefaultModuleCRT ();
const char * crtAttr = CRT.c_str ();
if ( crtAttr == NULL || stricmp ( crtAttr, "none" ) == 0 )
dynamicCRT = false;
else if ( stricmp ( crtAttr, "libc" ) == 0 )
dynamicCRT = false;
else if ( stricmp ( crtAttr, "msvcrt" ) == 0 )
dynamicCRT = true;
else if ( stricmp ( crtAttr, "libcntpr" ) == 0 )
dynamicCRT = false;
else if ( stricmp ( crtAttr, "ntdll" ) == 0 )
dynamicCRT = true;
else if ( stricmp ( crtAttr, "static" ) == 0 )
dynamicCRT = false;
else if ( stricmp ( crtAttr, "dll" ) == 0 )
dynamicCRT = true;
else else
{ {
throw InvalidAttributeValueException ( throw InvalidAttributeValueException (
moduleNode.location, moduleNode.location,
"isstartuplib", "crt",
att->value ); std::string ( crtAttr ) );
} }
if ( isCRT && dynamicCRT )
{
throw XMLInvalidBuildFileException (
moduleNode.location,
"C runtime module '%s' cannot be compiled for a dynamically-linked C runtime",
name.c_str() );
} }
else
isStartupLib = false;
att = moduleNode.GetAttribute ( "prefix", false ); att = moduleNode.GetAttribute ( "prefix", false );
if ( att != NULL ) if ( att != NULL )
@ -1155,6 +1169,67 @@ Module::GetDefaultModuleBaseaddress () const
__LINE__ ); __LINE__ );
} }
std::string
Module::GetDefaultModuleCRT () const
{
if ( isCRT )
return "static";
switch ( type )
{
case Kernel:
return "static";
case Win32DLL:
case Win32OCX:
return "msvcrt";
case NativeDLL:
case NativeCUI:
return "ntdll";
case Win32CUI:
case Win32SCR:
case Win32GUI:
return "msvcrt";
case Test:
return "msvcrt"; // BUGBUG: not sure about this
case KeyboardLayout:
return "none";
case KernelModeDLL:
case KernelModeDriver:
return "dll";
case BootLoader:
return "libcntpr";
case ElfExecutable:
case BuildTool:
case StaticLibrary:
case HostStaticLibrary:
case ObjectLibrary:
case BootSector:
case Iso:
case LiveIso:
case IsoRegTest:
case LiveIsoRegTest:
case RpcServer:
case RpcClient:
case RpcProxy:
case Alias:
case BootProgram:
case IdlHeader:
case MessageHeader:
case EmbeddedTypeLib:
case Cabinet:
case TypeDontCare:
return "none";
}
throw InvalidOperationException ( __FILE__,
__LINE__ );
}
bool
Module::GetDefaultModuleIsCRT () const
{
return type == Kernel;
}
bool bool
Module::HasImportLibrary () const Module::HasImportLibrary () const
{ {

View file

@ -127,6 +127,8 @@
unicode (true|yes|false|no) "no" unicode (true|yes|false|no) "no"
isstartuplib (true) #IMPLIED isstartuplib (true) #IMPLIED
buildtype %Text; #FIXED "OFWLDR" buildtype %Text; #FIXED "OFWLDR"
iscrt (true|yes|false|no) "no"
crt (libc|msvcrt|libcntpr|ntdll|static|dll|none|auto) "auto"
> >
<!ELEMENT pch (#PCDATA)> <!ELEMENT pch (#PCDATA)>

View file

@ -368,6 +368,9 @@ public:
bool allowWarnings; bool allowWarnings;
bool enabled; bool enabled;
bool isStartupLib; bool isStartupLib;
bool isCRT;
std::string CRT;
bool dynamicCRT;
FileLocation *output; // "path/foo.exe" FileLocation *output; // "path/foo.exe"
FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a" FileLocation *dependency; // "path/foo.exe" or "path/libfoo.a"
FileLocation *install; FileLocation *install;
@ -398,11 +401,16 @@ private:
std::string GetDefaultModuleExtension () const; std::string GetDefaultModuleExtension () const;
std::string GetDefaultModuleEntrypoint () const; std::string GetDefaultModuleEntrypoint () const;
std::string GetDefaultModuleBaseaddress () const; std::string GetDefaultModuleBaseaddress () const;
std::string GetDefaultModuleCRT () const;
bool GetDefaultModuleIsCRT () const;
std::string entrypoint; std::string entrypoint;
void ProcessXMLSubElement ( const XMLElement& e, void ProcessXMLSubElement ( const XMLElement& e,
DirectoryLocation directory, DirectoryLocation directory,
const std::string& relative_path, const std::string& relative_path,
ParseContext& parseContext ); ParseContext& parseContext );
bool GetBooleanAttribute ( const XMLElement& moduleNode,
const char * name,
bool default_value = false );
}; };