sync to trunk r38300
authorTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 1 Jan 2009 14:45:53 +0000 (14:45 +0000)
committerTimo Kreuzer <timo.kreuzer@reactos.org>
Thu, 1 Jan 2009 14:45:53 +0000 (14:45 +0000)
svn path=/branches/ros-amd64-bringup/; revision=38498

125 files changed:
reactos/ReactOS-generic.rbuild
reactos/base/applications/network/ftp/fake.h
reactos/base/applications/network/net/main.c
reactos/base/applications/network/net/net.h
reactos/base/applications/network/net/process.c
reactos/base/applications/network/telnet/telnet.rbuild
reactos/base/services/dhcp/include/rosdhcp.h
reactos/base/services/umpnpmgr/umpnpmgr.c
reactos/base/shell/cmd/batch.c
reactos/base/shell/cmd/batch.h
reactos/base/shell/cmd/cmd.c
reactos/base/shell/cmd/cmd.h
reactos/base/shell/cmd/cmdtable.c
reactos/base/shell/cmd/if.c
reactos/base/shell/cmd/internal.c
reactos/base/shell/cmd/parser.c
reactos/base/system/services/rpcserver.c
reactos/base/system/userinit/userinit.c
reactos/config.template.rbuild
reactos/dll/cpl/mmsys/sounds.c
reactos/dll/cpl/sysdm/startrec.c
reactos/dll/win32/msgina/msgina.rbuild
reactos/dll/win32/netcfgx/netcfg_iface.c
reactos/dll/win32/netcfgx/tcpipconf_notify.c
reactos/dll/win32/netshell/connectmanager.c
reactos/dll/win32/netshell/lanconnectui.c
reactos/dll/win32/netshell/lanstatusui.c
reactos/dll/win32/newdev/newdev.c
reactos/dll/win32/newdev/wizard.c
reactos/dll/win32/ntmarta/ntmarta.rbuild
reactos/dll/win32/shell32/pidl.c
reactos/dll/win32/shell32/shelllink.c
reactos/dll/win32/shell32/shlexec.c
reactos/dll/win32/shell32/shv_item_new.c
reactos/dll/win32/user32/windows/icon.c
reactos/dll/win32/winspool/winspool.rbuild
reactos/hal/hal.rbuild
reactos/include/crt/_mingw.h
reactos/include/crt/assert.h
reactos/include/crt/complex.h
reactos/include/crt/conio.h
reactos/include/crt/crtdbg.h
reactos/include/crt/crtdefs.h
reactos/include/crt/ctype.h
reactos/include/crt/direct.h
reactos/include/crt/dirent.h
reactos/include/crt/dos.h
reactos/include/crt/dvec.h
reactos/include/crt/eh.h
reactos/include/crt/errno.h
reactos/include/crt/excpt.h
reactos/include/crt/fcntl.h
reactos/include/crt/float.h
reactos/include/crt/fpieee.h
reactos/include/crt/fvec.h
reactos/include/crt/inttypes.h
reactos/include/crt/io.h
reactos/include/crt/libgen.h
reactos/include/crt/limits.h
reactos/include/crt/locale.h
reactos/include/crt/malloc.h
reactos/include/crt/math.h
reactos/include/crt/mbctype.h
reactos/include/crt/mbstring.h
reactos/include/crt/memory.h
reactos/include/crt/new.h
reactos/include/crt/process.h
reactos/include/crt/rtcapi.h
reactos/include/crt/search.h
reactos/include/crt/setjmp.h
reactos/include/crt/share.h
reactos/include/crt/signal.h
reactos/include/crt/stddef.h
reactos/include/crt/stdexcpt.h
reactos/include/crt/stdint.h
reactos/include/crt/stdio.h
reactos/include/crt/stdlib.h
reactos/include/crt/string.h
reactos/include/crt/sys/locking.h
reactos/include/crt/sys/stat.h
reactos/include/crt/sys/timeb.h
reactos/include/crt/sys/types.h
reactos/include/crt/sys/utime.h
reactos/include/crt/tchar.h
reactos/include/crt/time.h
reactos/include/crt/typeinfo.h
reactos/include/crt/vadefs.h
reactos/include/crt/wchar.h
reactos/include/crt/wctype.h
reactos/include/crt/yvals.h
reactos/include/reactos/libs/pseh/pseh2.h
reactos/include/reactos/win32k/ntuser.h
reactos/include/reactos/wine/config.h
reactos/include/reactos/wine/exception.h
reactos/lib/pseh/framebased-gcchack.c
reactos/lib/pseh/i386/framebased-gcchack.S
reactos/lib/sdk/crt/except/cpp.c
reactos/lib/sdk/crt/except/cppexcept.c
reactos/lib/sdk/crt/include/internal/wine/cppexcept.h
reactos/lib/sdk/crt/locale/locale.c
reactos/lib/sdk/crt/mbstring/ismblead.c
reactos/lib/sdk/crt/precomp.h
reactos/lib/sdk/crt/wine/undname.c
reactos/ntoskrnl/config/cmparse.c
reactos/ntoskrnl/include/internal/cm.h
reactos/ntoskrnl/include/internal/i386/asmmacro.S
reactos/subsystems/win32/win32k/include/text.h
reactos/subsystems/win32/win32k/ntuser/desktop.c
reactos/subsystems/win32/win32k/ntuser/painting.c
reactos/subsystems/win32/win32k/ntuser/winsta.c
reactos/subsystems/win32/win32k/objects/font.c
reactos/subsystems/win32/win32k/objects/freetype.c
reactos/tools/rbuild/automaticdependency.cpp
reactos/tools/rbuild/backend/backend.cpp
reactos/tools/rbuild/backend/codeblocks/codeblocks.cpp
reactos/tools/rbuild/backend/mingw/mingw.cpp
reactos/tools/rbuild/backend/mingw/modulehandler.cpp
reactos/tools/rbuild/backend/msvc/msvc.cpp
reactos/tools/rbuild/backend/msvc/msvcmaker.cpp
reactos/tools/rbuild/backend/msvc/vcprojmaker.cpp
reactos/tools/rbuild/compilationunit.cpp
reactos/tools/rbuild/directory.cpp
reactos/tools/rbuild/module.cpp
reactos/tools/rbuild/rbuild.vcproj
reactos/tools/rbuild/testsupportcode.cpp

index ec0ef2f..f4915c9 100644 (file)
        </directory>
        <directory name="ntoskrnl">
                <xi:include href="ntoskrnl/ntoskrnl.rbuild" />
        </directory>
        <directory name="ntoskrnl">
                <xi:include href="ntoskrnl/ntoskrnl.rbuild" />
-               <xi:include href="ntoskrnl/ntkrnlmp.rbuild" />
+               <if property="BUILD_MP" value="1">
+                       <xi:include href="ntoskrnl/ntkrnlmp.rbuild" />
+               </if>
        </directory>
        <directory name="subsystems">
                <xi:include href="subsystems/subsystems.rbuild" />
        </directory>
        <directory name="subsystems">
                <xi:include href="subsystems/subsystems.rbuild" />
index 68c94cc..f622c40 100644 (file)
@@ -6,8 +6,8 @@
 
 #define getwd getcwd
 
 
 #define getwd getcwd
 
-#define strcasecmp strcmp
-#define strncasecmp strnicmp
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
 
 struct timezone {
     int tz_minuteswest; /* minutes W of Greenwich */
 
 struct timezone {
     int tz_minuteswest; /* minutes W of Greenwich */
index 425b0db..f8adf73 100644 (file)
@@ -20,91 +20,91 @@ int main(int argc, char **argv)
       return 1;
        }
 
       return 1;
        }
 
-    if (stricmp(argv[1],"ACCOUNTS")==0)
+    if (_stricmp(argv[1],"ACCOUNTS")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"COMPUTER")==0)
+    if (_stricmp(argv[1],"COMPUTER")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"CONFIG")==0)
+    if (_stricmp(argv[1],"CONFIG")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"CONTINUE")==0)
+    if (_stricmp(argv[1],"CONTINUE")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
 
     }
 
-    if (stricmp(argv[1],"FILE")==0)
+    if (_stricmp(argv[1],"FILE")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"GROUP")==0)
+    if (_stricmp(argv[1],"GROUP")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"HELP")==0)
+    if (_stricmp(argv[1],"HELP")==0)
     {
         return cmdHelp(argc,&argv[1]);
     }
     {
         return cmdHelp(argc,&argv[1]);
     }
-    if (stricmp(argv[1],"HELPMSG")==0)
+    if (_stricmp(argv[1],"HELPMSG")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"LOCALGROUP")==0)
+    if (_stricmp(argv[1],"LOCALGROUP")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"NAME")==0)
+    if (_stricmp(argv[1],"NAME")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"PRINT")==0)
+    if (_stricmp(argv[1],"PRINT")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"SEND")==0)
+    if (_stricmp(argv[1],"SEND")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"SESSION")==0)
+    if (_stricmp(argv[1],"SESSION")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"SHARE")==0)
+    if (_stricmp(argv[1],"SHARE")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
 
     }
 
-    if (stricmp(argv[1],"START")==0)
+    if (_stricmp(argv[1],"START")==0)
     {
        return cmdStart(argc, &argv[1]);
     }
     {
        return cmdStart(argc, &argv[1]);
     }
-    if (stricmp(argv[1],"STATISTICS")==0)
+    if (_stricmp(argv[1],"STATISTICS")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"STOP")==0)
+    if (_stricmp(argv[1],"STOP")==0)
     {
                return cmdStop(argc, &argv[1]);
     }
     {
                return cmdStop(argc, &argv[1]);
     }
-    if (stricmp(argv[1],"TIME")==0)
+    if (_stricmp(argv[1],"TIME")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"USE")==0)
+    if (_stricmp(argv[1],"USE")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"USER")==0)
+    if (_stricmp(argv[1],"USER")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
     }
-    if (stricmp(argv[1],"VIEW")==0)
+    if (_stricmp(argv[1],"VIEW")==0)
     {
     {
-               return unimplement();
+               return unimplemented();
     }
 
     help();
     }
 
     help();
@@ -112,9 +112,9 @@ int main(int argc, char **argv)
 }
 
 
 }
 
 
-int unimplement()
+int unimplemented()
 {
 {
-       puts("This command is not implement yet");
+       puts("This command is not implemented yet");
        return 1;
 }
 
        return 1;
 }
 
index e450dff..d86af56 100644 (file)
@@ -14,7 +14,7 @@
 #include <windows.h>
 
 void help();
 #include <windows.h>
 
 void help();
-int unimplement();
+int unimplemented();
 
 
 INT cmdHelp(INT argc, CHAR **argv);
 
 
 INT cmdHelp(INT argc, CHAR **argv);
index 1b57a3d..4ce29b2 100644 (file)
@@ -208,7 +208,7 @@ INT row_scanner_service(CHAR *buffer, LONG* pos, LONG size,
        }
 
        /* Compare now */
        }
 
        /* Compare now */
-       if (strnicmp(name,&buffer[t],strlen(&buffer[t]))==0)
+       if (_strnicmp(name,&buffer[t],strlen(&buffer[t]))==0)
        {
                if (save != NULL)
                {
        {
                if (save != NULL)
                {
index c4a8b3f..312eae3 100644 (file)
@@ -1,10 +1,11 @@
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
 <?xml version="1.0"?>
 <!DOCTYPE module SYSTEM "../../../../tools/rbuild/project.dtd">
-<module name="telnet" type="win32cui" installbase="system32" installname="telnet.exe" allowwarnings ="true">
+<module name="telnet" type="win32cui" installbase="system32" installname="telnet.exe" >
        <include base="telnet">.</include>
        <library>kernel32</library>
        <library>ws2_32</library>
        <library>user32</library>
        <include base="telnet">.</include>
        <library>kernel32</library>
        <library>ws2_32</library>
        <library>user32</library>
+       <define name="_CRT_NONSTDC_NO_DEPRECATE" />
        <directory name="src">
                <file>ansiprsr.cpp</file>
                <file>keytrans.cpp</file>
        <directory name="src">
                <file>ansiprsr.cpp</file>
                <file>keytrans.cpp</file>
index 7d115a9..bcb0b4c 100644 (file)
 #define _PATH_DHCLIENT_PID "\\systemroot\\system32\\drivers\\etc\\dhclient.pid"
 typedef void *VOIDPTR;
 
 #define _PATH_DHCLIENT_PID "\\systemroot\\system32\\drivers\\etc\\dhclient.pid"
 typedef void *VOIDPTR;
 
+#ifndef _SSIZE_T_DEFINED
+#define _SSIZE_T_DEFINED
+#undef ssize_t
+#ifdef _WIN64
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+  typedef int ssize_t __attribute__ ((mode (DI)));
+#else
+  typedef __int64 ssize_t;
+#endif
+#else
+  typedef int ssize_t;
+#endif
+#endif
+
 typedef u_int32_t uintTIME;
 #define TIME uintTIME
 #include "dhcpd.h"
 typedef u_int32_t uintTIME;
 #define TIME uintTIME
 #include "dhcpd.h"
index 39c9e14..19dfdb1 100644 (file)
@@ -2062,7 +2062,7 @@ IsConsoleBoot(VOID)
         NextOption = wcschr(CurrentOption, L' ');
         if (NextOption)
             *NextOption = L'\0';
         NextOption = wcschr(CurrentOption, L' ');
         if (NextOption)
             *NextOption = L'\0';
-        if (wcsicmp(CurrentOption, L"CONSOLE") == 0)
+        if (_wcsicmp(CurrentOption, L"CONSOLE") == 0)
         {
             DPRINT("Found %S. Switching to console boot\n", CurrentOption);
             ConsoleBoot = TRUE;
         {
             DPRINT("Found %S. Switching to console boot\n", CurrentOption);
             ConsoleBoot = TRUE;
index ef28268..93fc56d 100644 (file)
@@ -269,7 +269,6 @@ BOOL Batch (LPTSTR fullname, LPTSTR firstword, LPTSTR param, BOOL forcenew)
        SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN);
        bc->bEcho = bEcho; /* Preserve echo across batch calls */
        bc->shiftlevel = 0;
        SetFilePointer (bc->hBatchFile, 0, NULL, FILE_BEGIN);
        bc->bEcho = bEcho; /* Preserve echo across batch calls */
        bc->shiftlevel = 0;
-       bc->bCmdBlock = -1;
        
        bc->ffind = NULL;
        bc->forvar = _T('\0');
        
        bc->ffind = NULL;
        bc->forvar = _T('\0');
@@ -445,39 +444,6 @@ LPTSTR ReadBatchLine ()
 
                first = textline;
 
 
                first = textline;
 
-               /* cmd block over multiple lines (..) */
-               if (bc->bCmdBlock >= 0)
-               {
-                       if (*first == _T(')'))
-                       {
-                               first++;
-                               /* Strip leading spaces and trailing space/control chars */
-                               while(_istspace (*first))
-                                       first++;
-                               if ((_tcsncicmp (first, _T("else"), 4) == 0) && (_tcschr(first, _T('('))))
-                               {
-                                       bc->bExecuteBlock[bc->bCmdBlock] = !bc->bExecuteBlock[bc->bCmdBlock];
-                               }
-                               else
-                               {
-                                       bc->bCmdBlock--;
-                               }
-                               continue;
-                       }
-                       if (bc->bCmdBlock < MAX_PATH)
-                               if (!bc->bExecuteBlock[bc->bCmdBlock])
-                               {
-                                       /* increase the bCmdBlock count when there is another conditon which opens a new bracket */
-                                       if ((_tcsncicmp (first, _T("if"), 2) == 0)  && _tcschr(first, _T('(')))
-                                       {
-                                               bc->bCmdBlock++;
-                                               if ((bc->bCmdBlock > 0) && (bc->bCmdBlock < MAX_PATH))
-                                                       bc->bExecuteBlock[bc->bCmdBlock] = bc->bExecuteBlock[bc->bCmdBlock - 1];
-                                       }
-                                       continue;
-                               }
-               }
-
                break;
        }
 
                break;
        }
 
index 998f85c..74be92f 100644 (file)
@@ -21,8 +21,6 @@ typedef struct tagBATCHCONTEXT
        HANDLE hFind;        /* Preserve find handle when doing a for */
        REDIRECTION *RedirList;
        TCHAR forvar;
        HANDLE hFind;        /* Preserve find handle when doing a for */
        REDIRECTION *RedirList;
        TCHAR forvar;
-       INT   bCmdBlock;
-       BOOL  bExecuteBlock[MAX_PATH];
 } BATCH_CONTEXT, *LPBATCH_CONTEXT;
 
 
 } BATCH_CONTEXT, *LPBATCH_CONTEXT;
 
 
index 116066c..3959310 100644 (file)
@@ -879,7 +879,7 @@ ExecuteCommand(PARSED_COMMAND *Cmd)
                if(bc)
                        bNewBatch = FALSE;
 
                if(bc)
                        bNewBatch = FALSE;
 
-               Success = DoCommand(Cmd->CommandLine);
+               Success = DoCommand(Cmd->Command.CommandLine);
 
                if(bNewBatch && bc)
                        AddBatchRedirection(&Cmd->Redirections);
 
                if(bNewBatch && bc)
                        AddBatchRedirection(&Cmd->Redirections);
@@ -903,6 +903,9 @@ ExecuteCommand(PARSED_COMMAND *Cmd)
        case C_PIPE:
                ExecutePipeline(Cmd);
                break;
        case C_PIPE:
                ExecutePipeline(Cmd);
                break;
+       case C_IF:
+               Success = ExecuteIf(Cmd);
+               break;
        }
 
        UndoRedirection(Cmd->Redirections, NULL);
        }
 
        UndoRedirection(Cmd->Redirections, NULL);
index e89c3ae..5a243b8 100644 (file)
@@ -258,6 +258,15 @@ INT CommandHistory (LPTSTR param);
 #endif
 
 
 #endif
 
 
+/* Prototypes for IF.C */
+#define IFFLAG_NEGATE 1     /* NOT */
+#define IFFLAG_IGNORECASE 2 /* /I  */
+enum { IF_CMDEXTVERSION, IF_DEFINED, IF_ERRORLEVEL, IF_EXIST,
+       IF_STRINGEQ,         /* == */
+       IF_EQU, IF_GTR, IF_GEQ, IF_LSS, IF_LEQ, IF_NEQ };
+BOOL ExecuteIf(struct _PARSED_COMMAND *Cmd);
+
+
 /* Prototypes for INTERNAL.C */
 VOID InitLastPath (VOID);
 VOID FreeLastPath (VOID);
 /* Prototypes for INTERNAL.C */
 VOID InitLastPath (VOID);
 VOID FreeLastPath (VOID);
@@ -330,15 +339,28 @@ INT CommandMsgbox (LPTSTR);
 
 
 /* Prototypes from PARSER.C */
 
 
 /* Prototypes from PARSER.C */
-enum { C_COMMAND, C_QUIET, C_BLOCK, C_MULTI, C_IFFAILURE, C_IFSUCCESS, C_PIPE };
+enum { C_COMMAND, C_QUIET, C_BLOCK, C_MULTI, C_IFFAILURE, C_IFSUCCESS, C_PIPE, C_IF };
 typedef struct _PARSED_COMMAND
 {
        struct _PARSED_COMMAND *Subcommands;
        struct _PARSED_COMMAND *Next;
        struct _REDIRECTION *Redirections;
 typedef struct _PARSED_COMMAND
 {
        struct _PARSED_COMMAND *Subcommands;
        struct _PARSED_COMMAND *Next;
        struct _REDIRECTION *Redirections;
-       TCHAR *Tail;
        BYTE Type;
        BYTE Type;
-       TCHAR CommandLine[];
+       union
+       {
+               struct
+               {
+                       TCHAR *Tail;
+                       TCHAR CommandLine[];
+               } Command;
+               struct
+               {
+                       BYTE Flags;
+                       BYTE Operator;
+                       TCHAR *LeftArg;
+                       TCHAR *RightArg;
+               } If;
+       };
 } PARSED_COMMAND;
 PARSED_COMMAND *ParseCommand(LPTSTR Line);
 VOID EchoCommand(PARSED_COMMAND *Cmd);
 } PARSED_COMMAND;
 PARSED_COMMAND *ParseCommand(LPTSTR Line);
 VOID EchoCommand(PARSED_COMMAND *Cmd);
index 516844f..9fc7cd2 100644 (file)
@@ -120,7 +120,7 @@ COMMAND cmds[] =
        {_T("history"), 0, CommandHistory},
 #endif
 
        {_T("history"), 0, CommandHistory},
 #endif
 
-       {_T("if"), 0, cmd_if},
+//     {_T("if"), 0, cmd_if},
 
 #ifdef INCLUDE_CMD_LABEL
        {_T("label"), 0, cmd_label},
 
 #ifdef INCLUDE_CMD_LABEL
        {_T("label"), 0, cmd_label},
index 061173b..c462ce0 100644 (file)
 
 #include <precomp.h>
 
 
 #include <precomp.h>
 
+static INT GenericCmp(INT (*StringCmp)(LPCTSTR, LPCTSTR),
+                      LPCTSTR Left, LPCTSTR Right)
+{
+       TCHAR *end;
+       INT nLeft = _tcstol(Left, &end, 0);
+       if (*end == _T('\0'))
+       {
+               INT nRight = _tcstol(Right, &end, 0);
+               if (*end == _T('\0'))
+               {
+                       /* both arguments are numeric */
+                       return (nLeft < nRight) ? -1 : (nLeft > nRight);
+               }
+       }
+       return StringCmp(Left, Right);
+}
 
 
-#define X_EXEC 1
-#define X_EMPTY 0x80
-
-INT cmd_if (LPTSTR param)
+BOOL ExecuteIf(PARSED_COMMAND *Cmd)
 {
 {
-       INT x_flag = 0; /* when set cause 'then' clause to be executed */
-       LPTSTR pp;
+       INT result = FALSE; /* when set cause 'then' clause to be executed */
+       LPTSTR param;
 
 
+#if 0
+       /* FIXME: need to handle IF /?; will require special parsing */
        TRACE ("cmd_if: (\'%s\')\n", debugstr_aw(param));
 
        if (!_tcsncmp (param, _T("/?"), 2))
        TRACE ("cmd_if: (\'%s\')\n", debugstr_aw(param));
 
        if (!_tcsncmp (param, _T("/?"), 2))
@@ -48,178 +63,89 @@ INT cmd_if (LPTSTR param)
                ConOutResPaging(TRUE,STRING_IF_HELP1);
                return 0;
        }
                ConOutResPaging(TRUE,STRING_IF_HELP1);
                return 0;
        }
+#endif
 
 
-       /* First check if param string begins with 'not' */
-       if (!_tcsnicmp (param, _T("not"), 3) && _istspace (*(param + 3)))
+       if (Cmd->If.Operator == IF_CMDEXTVERSION)
        {
        {
-               x_flag = X_EXEC;            /* Remember 'NOT' */
-               param += 3;                 /* Step over 'NOT' */
-               while (_istspace (*param))  /* And subsequent spaces */
-                       param++;
-       }
-
-       /* Check for 'exist' form */
-       if (!_tcsnicmp (param, _T("exist"), 5) && _istspace (*(param + 5)))
-       {
-               UINT i;
-               BOOL bInside = FALSE;
-
-               param += 5;
-               while (_istspace (*param))
-                       param++;
-
-               pp = param;
-
-               /* find the whole path to the file */
-               for(i = 0; i < _tcslen(param); i++)
+               /* IF CMDEXTVERSION n: check if Command Extensions version
+                * is greater or equal to n */
+               DWORD n = _tcstoul(Cmd->If.RightArg, &param, 10);
+               if (*param != _T('\0'))
                {
                {
-                       if(param[i] == _T('\"'))
-                               bInside = !bInside;
-                       if((param[i] == _T(' ')) && !bInside)
-                       {
-                               break;
-                       }
-                       pp++;
-               }
-               *pp++ = _T('\0');
-               i = 0;
-               /* remove quotes */
-               while(i < _tcslen(param))
-               {
-                       if(param[i] == _T('\"'))
-                               memmove(&param[i],&param[i + 1], _tcslen(&param[i]) * sizeof(TCHAR));
-                       else
-                               i++;
-               }
-
-               if (*pp)
-               {
-                       WIN32_FIND_DATA f;
-                       HANDLE hFind;
-
-                       hFind = FindFirstFile (param, &f);
-                       x_flag ^= (hFind == INVALID_HANDLE_VALUE) ? 0 : X_EXEC;
-                       if (hFind != INVALID_HANDLE_VALUE)
-                       {
-                               FindClose (hFind);
-                       }
+                       error_syntax(Cmd->If.RightArg);
+                       return FALSE;
                }
                }
-               else
-                       return 0;
+               result = (2 >= n);
        }
        }
-       else if (!_tcsnicmp (param, _T("defined"), 7) && _istspace (*(param + 7)))
+       else if (Cmd->If.Operator == IF_DEFINED)
        {
        {
-               /* Check for 'defined' form */
-               TCHAR Value [1];
-               INT   ValueSize = 0;
-
-               param += 7;
-               /* IF [NOT] DEFINED var COMMAND */
-               /*                 ^            */
-               while (_istspace (*param))
-                       param++;
-               /* IF [NOT] DEFINED var COMMAND */
-               /*                  ^           */
-               pp = param;
-               while (*pp && !_istspace (*pp))
-                       pp++;
-               /* IF [NOT] DEFINED var COMMAND */
-               /*                     ^        */
-               if (*pp)
+               /* IF DEFINED var: check if environment variable exists */
+               result = (GetEnvVarOrSpecial(Cmd->If.RightArg) != NULL);
+       }
+       else if (Cmd->If.Operator == IF_ERRORLEVEL)
+       {
+               /* IF ERRORLEVEL n: check if last exit code is greater or equal to n */
+               INT n = _tcstol(Cmd->If.RightArg, &param, 10);
+               if (*param != _T('\0'))
                {
                {
-                       *pp++ = _T('\0');
-                       ValueSize = GetEnvironmentVariable(param, Value, sizeof(Value) / sizeof(Value[0]));
-                       x_flag ^= (0 == ValueSize)
-                                       ? 0
-                                       : X_EXEC;
-                       x_flag |= X_EMPTY;
+                       error_syntax(Cmd->If.RightArg);
+                       return FALSE;
                }
                }
-               else
-                       return 0;
+               result = (nErrorLevel >= n);
        }
        }
-       else if (!_tcsnicmp (param, _T("errorlevel"), 10) && _istspace (*(param + 10)))
+       else if (Cmd->If.Operator == IF_EXIST)
        {
        {
-               /* Check for 'errorlevel' form */
-               INT n = 0;
-
-               pp = param + 10;
-               while (_istspace (*pp))
-                       pp++;
+               /* IF EXIST filename: check if file exists (wildcards allowed) */
+               WIN32_FIND_DATA f;
+               HANDLE hFind;
 
 
-               while (_istdigit (*pp))
-                       n = n * 10 + (*pp++ - _T('0'));
+               StripQuotes(Cmd->If.RightArg);
 
 
-               x_flag ^= (nErrorLevel != n) ? 0 : X_EXEC;
-
-               x_flag |= X_EMPTY;          /* Syntax error if comd empty */
+               hFind = FindFirstFile(Cmd->If.RightArg, &f);
+               if (hFind != INVALID_HANDLE_VALUE)
+               {
+                       result = TRUE;
+                       FindClose(hFind);
+               }
        }
        else
        {
        }
        else
        {
-               BOOL bInQuote = FALSE;
-               INT p1len;
-               pp = param;
-               while ( *pp && ( bInQuote || *pp != _T('=') ) )
-               {
-                       if ( *pp == _T('\"') )
-                               bInQuote = !bInQuote;
-                       ++pp;
-               }
-               p1len = pp-param;
-               /* check for "==" */
-               if ( *pp++ != _T('=') || *pp++ != _T('=') )
-               {
-                       error_syntax ( NULL );
-                       return 1;
-               }
-               while (_istspace (*pp)) /* Skip subsequent spaces */
-                       pp++;
-
-               /* are the two sides equal*/
-               if ( !_tcsncmp(param,pp,p1len))
-                       x_flag ^= X_EXEC;
-               pp += p1len;
+               /* Do case-insensitive string comparisons if /I specified */
+               INT (*StringCmp)(LPCTSTR, LPCTSTR) =
+                       (Cmd->If.Flags & IFFLAG_IGNORECASE) ? _tcsicmp : _tcscmp;
 
 
-               if ( x_flag )
+               if (Cmd->If.Operator == IF_STRINGEQ)
                {
                {
-                       x_flag |= X_EMPTY;
+                       /* IF str1 == str2 */
+                       result = StringCmp(Cmd->If.LeftArg, Cmd->If.RightArg) == 0;
                }
                }
-       }
-
-       while (_istspace (*pp)) /* skip spaces */
-               pp++;
-
-       if (*pp == _T('('))
-       {
-               if (bc)
+               else
                {
                {
-                       pp++;
-                       bc->bCmdBlock++;
-                       if ((bc->bCmdBlock >= 0) && (bc->bCmdBlock < MAX_PATH))
-                               bc->bExecuteBlock[bc->bCmdBlock] = x_flag & X_EXEC;
-                       /* commands are in the next lines */
-                       if (*pp == _T('\0'))
-                               return 0;
+                       result = GenericCmp(StringCmp, Cmd->If.LeftArg, Cmd->If.RightArg);
+                       switch (Cmd->If.Operator)
+                       {
+                       case IF_EQU: result = (result == 0); break;
+                       case IF_NEQ: result = (result != 0); break;
+                       case IF_LSS: result = (result < 0); break;
+                       case IF_LEQ: result = (result <= 0); break;
+                       case IF_GTR: result = (result > 0); break;
+                       case IF_GEQ: result = (result >= 0); break;
+                       }
                }
        }
 
                }
        }
 
-       if (x_flag & X_EMPTY)
+       if (result ^ ((Cmd->If.Flags & IFFLAG_NEGATE) != 0))
        {
        {
-               while (_istspace (*pp)) /* Then skip spaces */
-                       pp++;
-
-               if (*pp == _T('\0'))    /* If nothing left then syntax err */
-               {
-                       error_syntax (NULL);
-                       return 1;
-               }
+               /* full condition was true, do the command */
+               return ExecuteCommand(Cmd->Subcommands);
        }
        }
-
-       if (x_flag & X_EXEC)
+       else
        {
        {
-               ParseCommandLine (pp);
+               /* full condition was false, do the "else" command if there is one */
+               if (Cmd->Subcommands->Next)
+                       return ExecuteCommand(Cmd->Subcommands->Next);
+               return TRUE;
        }
        }
-
-       return 0;
 }
 
 /* EOF */
 }
 
 /* EOF */
index afc553c..bbbb86d 100644 (file)
@@ -431,6 +431,12 @@ MakeFullPath(TCHAR * DirPath)
     TCHAR *p = DirPath;
     INT  n;
 
     TCHAR *p = DirPath;
     INT  n;
 
+    if (CreateDirectory(DirPath, NULL))
+        return TRUE;
+    else if (GetLastError() != ERROR_PATH_NOT_FOUND)
+        return FALSE;
+
+    /* got ERROR_PATH_NOT_FOUND, so try building it up one component at a time */
     if (p[0] && p[1] == _T(':'))
         p += 2;
     while (*p == _T('\\'))
     if (p[0] && p[1] == _T(':'))
         p += 2;
     while (*p == _T('\\'))
@@ -445,8 +451,6 @@ MakeFullPath(TCHAR * DirPath)
            (GetLastError() != ERROR_ALREADY_EXISTS))
            return FALSE;
     } while (p != NULL);
            (GetLastError() != ERROR_ALREADY_EXISTS))
            return FALSE;
     } while (p != NULL);
-    if (GetLastError() == ERROR_ALREADY_EXISTS)
-       SetLastError(ERROR_SUCCESS);
 
     return TRUE;
 }
 
     return TRUE;
 }
@@ -457,55 +461,42 @@ MakeFullPath(TCHAR * DirPath)
  */
 INT cmd_mkdir (LPTSTR param)
 {
  */
 INT cmd_mkdir (LPTSTR param)
 {
-       LPTSTR dir;             /* pointer to the directory to change to */
-       LPTSTR *p = NULL;
-       INT argc;
-       nErrorLevel = 0;
+       LPTSTR *p;
+       INT argc, i;
        if (!_tcsncmp (param, _T("/?"), 2))
        {
                ConOutResPaging(TRUE,STRING_MKDIR_HELP);
                return 0;
        }
 
        if (!_tcsncmp (param, _T("/?"), 2))
        {
                ConOutResPaging(TRUE,STRING_MKDIR_HELP);
                return 0;
        }
 
-
-               p = split (param, &argc, FALSE);
-               if (argc > 1)
-               {
-                       /*JPP 20-Jul-1998 use standard error message */
-                       error_too_many_parameters (param);
-                       freep (p);
-                       return 1;
-               }
-               else
-                       dir = p[0];
-
-       if (!dir)
+       p = split (param, &argc, FALSE);
+       if (argc == 0)
        {
        {
-               ConErrResPuts (STRING_ERROR_REQ_PARAM_MISSING);
+               ConErrResPuts(STRING_ERROR_REQ_PARAM_MISSING);
                nErrorLevel = 1;
                nErrorLevel = 1;
-               if(p != NULL)
-                       freep (p);
+               freep(p);
                return 1;
        }
 
                return 1;
        }
 
-    if (!MakeFullPath(dir))
-    {
-        if(GetLastError() == ERROR_PATH_NOT_FOUND)
-        {
-            ConErrResPuts(STRING_MD_ERROR2);
-        }
-        else
-        {
-            ErrorMessage (GetLastError(), _T("MD"));
-        }
-        nErrorLevel = 1;
-        freep (p);
-        return 1;
-    }
+       nErrorLevel = 0;
+       for (i = 0; i < argc; i++)
+       {
+               if (!MakeFullPath(p[i]))
+               {
+                       if(GetLastError() == ERROR_PATH_NOT_FOUND)
+                       {
+                               ConErrResPuts(STRING_MD_ERROR2);
+                       }
+                       else
+                       {
+                               ErrorMessage (GetLastError(), _T("MD"));
+                       }
+                       nErrorLevel = 1;
+               }
+       }
 
        freep (p);
 
        freep (p);
-
-       return 0;
+       return nErrorLevel;
 }
 #endif
 
 }
 #endif
 
index 287110a..7c35a57 100644 (file)
@@ -1,3 +1,8 @@
+/*
+ *  PARSER.C - command parsing.
+ *
+ */
+
 #include <precomp.h>
 
 #define C_OP_LOWEST C_MULTI
 #include <precomp.h>
 
 #define C_OP_LOWEST C_MULTI
@@ -6,10 +11,28 @@ static const TCHAR OpString[][3] = { _T("&"), _T("||"), _T("&&"), _T("|") };
 
 static const TCHAR RedirString[][3] = { _T("<"), _T(">"), _T(">>") };
 
 
 static const TCHAR RedirString[][3] = { _T("<"), _T(">"), _T(">>") };
 
+static const TCHAR *const IfOperatorString[] = {
+       _T("cmdextversion"),
+       _T("defined"),
+       _T("errorlevel"),
+       _T("exist"),
+#define IF_MAX_UNARY IF_EXIST
+       _T("=="),
+       _T("equ"),
+       _T("gtr"),
+       _T("geq"),
+       _T("lss"),
+       _T("leq"),
+       _T("neq"),
+#define IF_MAX_COMPARISON IF_NEQ
+};
+
+/* These three characters act like spaces to the parser in most contexts */
+#define STANDARD_SEPS _T(",;=")
+
 static BOOL IsSeparator(TCHAR Char)
 {
 static BOOL IsSeparator(TCHAR Char)
 {
-       /* These three characters act like spaces to the parser */
-       return _istspace(Char) || (Char && _tcschr(_T(",;="), Char));
+       return _istspace(Char) || (Char && _tcschr(STANDARD_SEPS, Char));
 }
 
 enum { TOK_END, TOK_NORMAL, TOK_OPERATOR, TOK_REDIRECTION,
 }
 
 enum { TOK_END, TOK_NORMAL, TOK_OPERATOR, TOK_REDIRECTION,
@@ -70,36 +93,44 @@ static void ParseError()
 
 /* Yes, cmd has a Lexical Analyzer. Whenever the parser gives an "xxx was
  * unexpected at this time." message, it shows what the last token read was */
 
 /* Yes, cmd has a Lexical Analyzer. Whenever the parser gives an "xxx was
  * unexpected at this time." message, it shows what the last token read was */
-static int ParseToken(TCHAR ExtraEnd, BOOL PreserveSpace)
+static int ParseToken(TCHAR ExtraEnd, TCHAR *Separators)
 {
        TCHAR *Out = CurrentToken;
 {
        TCHAR *Out = CurrentToken;
-       TCHAR Char = CurChar;
+       TCHAR Char;
        int Type;
        BOOL bInQuote = FALSE;
 
        int Type;
        BOOL bInQuote = FALSE;
 
-       if (!PreserveSpace)
-       {
-               while (Char != _T('\n') && IsSeparator(Char))
-                       Char = ParseChar();
-       }
-
-       while (Char && Char != _T('\n'))
+       for (Char = CurChar; Char && Char != _T('\n'); Char = ParseChar())
        {
                bInQuote ^= (Char == _T('"'));
                if (!bInQuote)
                {
        {
                bInQuote ^= (Char == _T('"'));
                if (!bInQuote)
                {
-                       /* Check for all the myriad ways in which this token
-                        * may be brought to an untimely end. */
+                       if (Separators != NULL)
+                       {
+                               if (_istspace(Char) || _tcschr(Separators, Char))
+                               {
+                                       /* Skip leading separators */
+                                       if (Out == CurrentToken)
+                                               continue;
+                                       break;
+                               }
+                       }
+               
+                       /* Check for numbered redirection */
                        if ((Char >= _T('0') && Char <= _T('9') &&
                               (ParsePos == &ParseLine[1] || IsSeparator(ParsePos[-2]))
                        if ((Char >= _T('0') && Char <= _T('9') &&
                               (ParsePos == &ParseLine[1] || IsSeparator(ParsePos[-2]))
-                              && (*ParsePos == _T('<') || *ParsePos == _T('>')))
-                           || _tcschr(_T(")&|<>") + (InsideBlock ? 0 : 1), Char)
-                           || (!PreserveSpace && IsSeparator(Char))
-                           || (Char == ExtraEnd))
+                              && (*ParsePos == _T('<') || *ParsePos == _T('>'))))
                        {
                                break;
                        }
 
                        {
                                break;
                        }
 
+                       if (Char == ExtraEnd)
+                               break;
+                       if (InsideBlock && Char == _T(')'))
+                               break;
+                       if (_tcschr(_T("&|<>"), Char))
+                               break;
+
                        if (Char == _T('^'))
                        {
                                Char = ParseChar();
                        if (Char == _T('^'))
                        {
                                Char = ParseChar();
@@ -112,7 +143,6 @@ static int ParseToken(TCHAR ExtraEnd, BOOL PreserveSpace)
                if (Out == &CurrentToken[CMDLINE_LENGTH - 1])
                        break;
                *Out++ = Char;
                if (Out == &CurrentToken[CMDLINE_LENGTH - 1])
                        break;
                *Out++ = Char;
-               Char = ParseChar();
        }
 
        /* Check if we got at least one character before reaching a special one.
        }
 
        /* Check if we got at least one character before reaching a special one.
@@ -214,7 +244,7 @@ static BOOL ParseRedirection(REDIRECTION **List)
        if (!*Tok)
        {
                /* The file name was not part of this token, so it'll be the next one */
        if (!*Tok)
        {
                /* The file name was not part of this token, so it'll be the next one */
-               if (ParseToken(0, FALSE) != TOK_NORMAL)
+               if (ParseToken(0, STANDARD_SEPS) != TOK_NORMAL)
                        goto fail;
                Tok = CurrentToken;
        }
                        goto fail;
                Tok = CurrentToken;
        }
@@ -284,7 +314,7 @@ static PARSED_COMMAND *ParseBlock(REDIRECTION *RedirList)
        InsideBlock--;
 
        /* Process any trailing redirections */
        InsideBlock--;
 
        /* Process any trailing redirections */
-       while (ParseToken(0, FALSE) == TOK_REDIRECTION)
+       while (ParseToken(0, STANDARD_SEPS) == TOK_REDIRECTION)
        {
                if (!ParseRedirection(&Cmd->Redirections))
                {
        {
                if (!ParseRedirection(&Cmd->Redirections))
                {
@@ -295,6 +325,94 @@ static PARSED_COMMAND *ParseBlock(REDIRECTION *RedirList)
        return Cmd;
 }
 
        return Cmd;
 }
 
+/* Parse an IF statement */
+static PARSED_COMMAND *ParseIf(void)
+{
+       PARSED_COMMAND *Cmd = cmd_alloc(sizeof(PARSED_COMMAND));
+       memset(Cmd, 0, sizeof(PARSED_COMMAND));
+       Cmd->Type = C_IF;
+
+       int Type = ParseToken(0, STANDARD_SEPS);
+       if (_tcsicmp(CurrentToken, _T("/I")) == 0)
+       {
+               Cmd->If.Flags |= IFFLAG_IGNORECASE;
+               Type = ParseToken(0, STANDARD_SEPS);
+       }
+       if (_tcsicmp(CurrentToken, _T("not")) == 0)
+       {
+               Cmd->If.Flags |= IFFLAG_NEGATE;
+               Type = ParseToken(0, STANDARD_SEPS);
+       }
+
+       if (Type != TOK_NORMAL)
+       {
+               FreeCommand(Cmd);
+               ParseError();
+               return NULL;
+       }
+
+       /* Check for unary operators */
+       for (; Cmd->If.Operator <= IF_MAX_UNARY; Cmd->If.Operator++)
+       {
+               if (_tcsicmp(CurrentToken, IfOperatorString[Cmd->If.Operator]) == 0)
+               {
+                       if (ParseToken(0, STANDARD_SEPS) != TOK_NORMAL)
+                       {
+                               FreeCommand(Cmd);
+                               ParseError();
+                               return NULL;
+                       }
+                       Cmd->If.RightArg = cmd_dup(CurrentToken);
+                       goto condition_done;
+               }
+       }
+
+       /* It must be a two-argument (comparison) operator. It could be ==, so
+        * the equals sign can't be treated as whitespace here. */
+       Cmd->If.LeftArg = cmd_dup(CurrentToken);
+       ParseToken(0, _T(",;"));
+
+       /* The right argument can come immediately after == */
+       if (_tcsnicmp(CurrentToken, _T("=="), 2) == 0 && CurrentToken[2])
+       {
+               Cmd->If.RightArg = cmd_dup(&CurrentToken[2]);
+               goto condition_done;
+       }
+
+       for (; Cmd->If.Operator <= IF_MAX_COMPARISON; Cmd->If.Operator++)
+       {
+               if (_tcsicmp(CurrentToken, IfOperatorString[Cmd->If.Operator]) == 0)
+               {
+                       if (ParseToken(0, STANDARD_SEPS) != TOK_NORMAL)
+                               break;
+                       Cmd->If.RightArg = cmd_dup(CurrentToken);
+                       goto condition_done;
+               }
+       }
+       FreeCommand(Cmd);
+       ParseError();
+       return NULL;
+
+condition_done:
+       Cmd->Subcommands = ParseCommandOp(C_OP_LOWEST);
+       if (Cmd->Subcommands == NULL)
+       {
+               FreeCommand(Cmd);
+               return NULL;
+       }
+       if (_tcsicmp(CurrentToken, _T("else")) == 0)
+       {
+               Cmd->Subcommands->Next = ParseCommandOp(C_OP_LOWEST);
+               if (Cmd->Subcommands->Next == NULL)
+               {
+                       FreeCommand(Cmd);
+                       return NULL;
+               }
+       }
+
+       return Cmd;
+}
+
 static PARSED_COMMAND *ParseCommandPart(void)
 {
        TCHAR ParsedLine[CMDLINE_LENGTH];
 static PARSED_COMMAND *ParseCommandPart(void)
 {
        TCHAR ParsedLine[CMDLINE_LENGTH];
@@ -318,7 +436,7 @@ static PARSED_COMMAND *ParseCommandPart(void)
        {
                /* "Ignore" the rest of the line.
                 * (Line continuations will still be parsed, though.) */
        {
                /* "Ignore" the rest of the line.
                 * (Line continuations will still be parsed, though.) */
-               while (ParseToken(0, TRUE) != TOK_END)
+               while (ParseToken(0, NULL) != TOK_END)
                        ;
                return NULL;
        }
                        ;
                return NULL;
        }
@@ -339,7 +457,7 @@ static PARSED_COMMAND *ParseCommandPart(void)
        /* Get the head of the command */
        while (1)
        {
        /* Get the head of the command */
        while (1)
        {
-               Type = ParseToken(_T('('), FALSE);
+               Type = ParseToken(_T('('), STANDARD_SEPS);
                if (Type == TOK_NORMAL)
                {
                        Pos = _stpcpy(ParsedLine, CurrentToken);
                if (Type == TOK_NORMAL)
                {
                        Pos = _stpcpy(ParsedLine, CurrentToken);
@@ -367,12 +485,22 @@ static PARSED_COMMAND *ParseCommandPart(void)
        }
        TailOffset = Pos - ParsedLine;
 
        }
        TailOffset = Pos - ParsedLine;
 
-       /* FIXME: FOR, IF, and REM need special processing by the parser. */
+       /* Check for special forms */
+       if (_tcsicmp(ParsedLine, _T("if")) == 0)
+       {
+               if (RedirList)
+               {
+                       ParseError();
+                       FreeRedirection(RedirList);
+                       return NULL;
+               }
+               return ParseIf();
+       }
 
        /* Now get the tail */
        while (1)
        {
 
        /* Now get the tail */
        while (1)
        {
-               Type = ParseToken(0, TRUE);
+               Type = ParseToken(0, NULL);
                if (Type == TOK_NORMAL)
                {
                        if (Pos + _tcslen(CurrentToken) >= &ParsedLine[CMDLINE_LENGTH])
                if (Type == TOK_NORMAL)
                {
                        if (Pos + _tcslen(CurrentToken) >= &ParsedLine[CMDLINE_LENGTH])
@@ -394,13 +522,13 @@ static PARSED_COMMAND *ParseCommandPart(void)
                }
        }
 
                }
        }
 
-       Cmd = cmd_alloc(FIELD_OFFSET(PARSED_COMMAND, CommandLine[Pos + 1 - ParsedLine]));
+       Cmd = cmd_alloc(FIELD_OFFSET(PARSED_COMMAND, Command.CommandLine[Pos + 1 - ParsedLine]));
        Cmd->Type = C_COMMAND;
        Cmd->Next = NULL;
        Cmd->Subcommands = NULL;
        Cmd->Redirections = RedirList;
        Cmd->Type = C_COMMAND;
        Cmd->Next = NULL;
        Cmd->Subcommands = NULL;
        Cmd->Redirections = RedirList;
-       _tcscpy(Cmd->CommandLine, ParsedLine);
-       Cmd->Tail = Cmd->CommandLine + TailOffset;
+       _tcscpy(Cmd->Command.CommandLine, ParsedLine);
+       Cmd->Command.Tail = Cmd->Command.CommandLine + TailOffset;
        return Cmd;
 }
 
        return Cmd;
 }
 
@@ -487,7 +615,7 @@ EchoCommand(PARSED_COMMAND *Cmd)
        switch (Cmd->Type)
        {
        case C_COMMAND:
        switch (Cmd->Type)
        {
        case C_COMMAND:
-               ConOutPrintf(_T("%s"), Cmd->CommandLine);
+               ConOutPrintf(_T("%s"), Cmd->Command.CommandLine);
                break;
        case C_QUIET:
                return;
                break;
        case C_QUIET:
                return;
@@ -509,6 +637,23 @@ EchoCommand(PARSED_COMMAND *Cmd)
                ConOutPrintf(_T(" %s "), OpString[Cmd->Type - C_OP_LOWEST]);
                EchoCommand(Sub->Next);
                break;
                ConOutPrintf(_T(" %s "), OpString[Cmd->Type - C_OP_LOWEST]);
                EchoCommand(Sub->Next);
                break;
+       case C_IF:
+               ConOutPrintf(_T("if"));
+               if (Cmd->If.Flags & IFFLAG_IGNORECASE)
+                       ConOutPrintf(_T(" /I"));
+               if (Cmd->If.Flags & IFFLAG_NEGATE)
+                       ConOutPrintf(_T(" not"));
+               if (Cmd->If.LeftArg)
+                       ConOutPrintf(_T(" %s"), Cmd->If.LeftArg);
+               ConOutPrintf(_T(" %s %s "), IfOperatorString[Cmd->If.Operator], Cmd->If.RightArg);
+               Sub = Cmd->Subcommands;
+               EchoCommand(Sub);
+               if (Sub->Next)
+               {
+                       ConOutPrintf(_T(" else "));
+                       EchoCommand(Sub->Next);
+               }
+               break;
        }
 
        for (Redir = Cmd->Redirections; Redir; Redir = Redir->Next)
        }
 
        for (Redir = Cmd->Redirections; Redir; Redir = Redir->Next)
@@ -526,5 +671,10 @@ FreeCommand(PARSED_COMMAND *Cmd)
        if (Cmd->Next)
                FreeCommand(Cmd->Next);
        FreeRedirection(Cmd->Redirections);
        if (Cmd->Next)
                FreeCommand(Cmd->Next);
        FreeRedirection(Cmd->Redirections);
+       if (Cmd->Type == C_IF)
+       {
+               cmd_free(Cmd->If.LeftArg);
+               cmd_free(Cmd->If.RightArg);
+       }
        cmd_free(Cmd);
 }
        cmd_free(Cmd);
 }
index 38d7e23..96d1e9e 100644 (file)
@@ -151,12 +151,12 @@ ScmCreateManagerHandle(LPWSTR lpDatabaseName,
     if (lpDatabaseName == NULL)
         lpDatabaseName = SERVICES_ACTIVE_DATABASEW;
 
     if (lpDatabaseName == NULL)
         lpDatabaseName = SERVICES_ACTIVE_DATABASEW;
 
-    if (wcsicmp(lpDatabaseName,SERVICES_FAILED_DATABASEW)==0)
+    if (_wcsicmp(lpDatabaseName,SERVICES_FAILED_DATABASEW)==0)
     {
         DPRINT1("Database %S, does not exist\n",lpDatabaseName);
         return ERROR_DATABASE_DOES_NOT_EXIST;
     }
     {
         DPRINT1("Database %S, does not exist\n",lpDatabaseName);
         return ERROR_DATABASE_DOES_NOT_EXIST;
     }
-    else if (wcsicmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0)
+    else if (_wcsicmp(lpDatabaseName, SERVICES_ACTIVE_DATABASEW) != 0)
     {
         DPRINT1("Invalid Database name %S.\n",lpDatabaseName);
         return ERROR_INVALID_NAME;
     {
         DPRINT1("Invalid Database name %S.\n",lpDatabaseName);
         return ERROR_INVALID_NAME;
@@ -332,7 +332,7 @@ Int_EnumDependentServicesW(HKEY hServicesKey,
             /* Can be more than one Dependencies in the DependOnService string */
             while (wcslen(lpszValueBuf + dwDependServiceStrPtr) > 0)
             {
             /* Can be more than one Dependencies in the DependOnService string */
             while (wcslen(lpszValueBuf + dwDependServiceStrPtr) > 0)
             {
-                if (wcsicmp(lpszValueBuf + dwDependServiceStrPtr, lpService->lpServiceName) == 0)
+                if (_wcsicmp(lpszValueBuf + dwDependServiceStrPtr, lpService->lpServiceName) == 0)
                 {
                     /* Get the current enumed service pointer */
                     lpCurrentService = ScmGetServiceEntryByName(lpszNameBuf);
                 {
                     /* Get the current enumed service pointer */
                     lpCurrentService = ScmGetServiceEntryByName(lpszNameBuf);
@@ -1344,7 +1344,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
 
     /* First check, if it's already good */
     if (ServiceNameLen > 12 &&
 
     /* First check, if it's already good */
     if (ServiceNameLen > 12 &&
-        !wcsnicmp(L"\\SystemRoot\\", CanonName, 12))
+        !_wcsnicmp(L"\\SystemRoot\\", CanonName, 12))
     {
         *RelativeName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR) + sizeof(WCHAR));
         if (*RelativeName == NULL)
     {
         *RelativeName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR) + sizeof(WCHAR));
         if (*RelativeName == NULL)
@@ -1362,7 +1362,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
 
     /* If it has %SystemRoot% prefix, substitute it to \System*/
     if (ServiceNameLen > 13 &&
 
     /* If it has %SystemRoot% prefix, substitute it to \System*/
     if (ServiceNameLen > 13 &&
-        !wcsnicmp(L"%SystemRoot%\\", CanonName, 13))
+        !_wcsnicmp(L"%SystemRoot%\\", CanonName, 13))
     {
         /* There is no +sizeof(wchar_t) because the name is less by 1 wchar */
         *RelativeName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR));
     {
         /* There is no +sizeof(wchar_t) because the name is less by 1 wchar */
         *RelativeName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR));
@@ -1432,7 +1432,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
     Expanded[ExpandedLen] = 0;
 
     if (ServiceNameLen > ExpandedLen &&
     Expanded[ExpandedLen] = 0;
 
     if (ServiceNameLen > ExpandedLen &&
-        !wcsnicmp(Expanded, CanonName, ExpandedLen))
+        !_wcsnicmp(Expanded, CanonName, ExpandedLen))
     {
         /* Only \SystemRoot\ is missing */
         *RelativeName = LocalAlloc(LMEM_ZEROINIT,
     {
         /* Only \SystemRoot\ is missing */
         *RelativeName = LocalAlloc(LMEM_ZEROINIT,
@@ -1504,7 +1504,7 @@ ScmConvertToBootPathName(wchar_t *CanonName, wchar_t **RelativeName)
 
                 ExpandedLen = LinkTarget.Length / sizeof(WCHAR);
                 if ((ServiceNameLen > ExpandedLen) &&
 
                 ExpandedLen = LinkTarget.Length / sizeof(WCHAR);
                 if ((ServiceNameLen > ExpandedLen) &&
-                    !wcsnicmp(LinkTarget.Buffer, CanonName, ExpandedLen))
+                    !_wcsnicmp(LinkTarget.Buffer, CanonName, ExpandedLen))
                 {
                     *RelativeName = LocalAlloc(LMEM_ZEROINIT,
                        (ServiceNameLen - ExpandedLen) * sizeof(WCHAR) + 13*sizeof(WCHAR));
                 {
                     *RelativeName = LocalAlloc(LMEM_ZEROINIT,
                        (ServiceNameLen - ExpandedLen) * sizeof(WCHAR) + 13*sizeof(WCHAR));
@@ -1584,7 +1584,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
 
     /* 12 is wcslen(L"\\SystemRoot\\") */
     if (ServiceNameLen > 12 &&
 
     /* 12 is wcslen(L"\\SystemRoot\\") */
     if (ServiceNameLen > 12 &&
-        !wcsnicmp(L"\\SystemRoot\\", lpServiceName, 12))
+        !_wcsnicmp(L"\\SystemRoot\\", lpServiceName, 12))
     {
         /* SystemRoot prefix is already included */
 
     {
         /* SystemRoot prefix is already included */
 
@@ -1609,7 +1609,7 @@ ScmCanonDriverImagePath(DWORD dwStartType,
 
     /* Check if it has %SystemRoot% (len=13) */
     if (ServiceNameLen > 13 &&
 
     /* Check if it has %SystemRoot% (len=13) */
     if (ServiceNameLen > 13 &&
-        !wcsnicmp(L"%%SystemRoot%%\\", lpServiceName, 13))
+        !_wcsnicmp(L"%%SystemRoot%%\\", lpServiceName, 13))
     {
         /* Substitute %SystemRoot% with \\SystemRoot\\ */
         *lpCanonName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR) + sizeof(WCHAR));
     {
         /* Substitute %SystemRoot% with \\SystemRoot\\ */
         *lpCanonName = LocalAlloc(LMEM_ZEROINIT, ServiceNameLen * sizeof(WCHAR) + sizeof(WCHAR));
@@ -1828,7 +1828,7 @@ DWORD RCreateServiceW(
     /* Fill the display name */
     if (lpDisplayName != NULL &&
         *lpDisplayName != 0 &&
     /* Fill the display name */
     if (lpDisplayName != NULL &&
         *lpDisplayName != 0 &&
-        wcsicmp(lpService->lpDisplayName, lpDisplayName) != 0)
+        _wcsicmp(lpService->lpDisplayName, lpDisplayName) != 0)
     {
         lpService->lpDisplayName = (WCHAR*) HeapAlloc(GetProcessHeap(), 0,
                                              (wcslen(lpDisplayName) + 1) * sizeof(WCHAR));
     {
         lpService->lpDisplayName = (WCHAR*) HeapAlloc(GetProcessHeap(), 0,
                                              (wcslen(lpDisplayName) + 1) * sizeof(WCHAR));
index 5c43608..7825bac 100644 (file)
@@ -120,7 +120,7 @@ BOOL IsConsoleShell(VOID)
         NextOption = wcschr(CurrentOption, L' ');
         if (NextOption)
             *NextOption = L'\0';
         NextOption = wcschr(CurrentOption, L' ');
         if (NextOption)
             *NextOption = L'\0';
-        if (wcsicmp(CurrentOption, L"CONSOLE") == 0)
+        if (_wcsicmp(CurrentOption, L"CONSOLE") == 0)
         {
             TRACE("Found 'CONSOLE' boot option\n");
             ret = TRUE;
         {
             TRACE("Found 'CONSOLE' boot option\n");
             ret = TRUE;
index b751cf9..ae5fba3 100644 (file)
@@ -85,4 +85,9 @@
 -->
 <property name="_ELF_" value="0" />
 
 -->
 <property name="_ELF_" value="0" />
 
+<!--
+       Whether to compile the multi processor versions for ntoskrnl and hal.
+-->
+<property name="BUILD_MP" value="1" />
+
 </group>
 </group>
index 5f3596c..897116a 100644 (file)
@@ -697,7 +697,7 @@ LoadSoundFiles(HWND hwndDlg)
         if (lResult != CB_ERR)
         {
             wcscpy(&szPath[length-1], FileData.cFileName);
         if (lResult != CB_ERR)
         {
             wcscpy(&szPath[length-1], FileData.cFileName);
-            SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)wcsdup(szPath));
+            SendDlgItemMessageW(hwndDlg, IDC_SOUND_LIST, CB_SETITEMDATA, (WPARAM)lResult, (LPARAM)_wcsdup(szPath));
         }
     }while(FindNextFileW(hFile, &FileData) != 0);
 
         }
     }while(FindNextFileW(hFile, &FileData) != 0);
 
index 5a36c1a..4339951 100644 (file)
@@ -140,9 +140,9 @@ ReadFreeldrSection(HINF hInf, WCHAR *szSectionName)
             break;
         }
 
             break;
         }
 
-        if (!wcsnicmp(szName, L"BootType", 8))
+        if (!_wcsnicmp(szName, L"BootType", 8))
         {
         {
-            if (!wcsnicmp(szValue, L"ReactOS", 7))
+            if (!_wcsnicmp(szValue, L"ReactOS", 7))
             {
                 //FIXME store as enum
                 pRecord->BootType = 1;
             {
                 //FIXME store as enum
                 pRecord->BootType = 1;
@@ -152,11 +152,11 @@ ReadFreeldrSection(HINF hInf, WCHAR *szSectionName)
                 pRecord->BootType = 0;
             }
         }
                 pRecord->BootType = 0;
             }
         }
-        else if (!wcsnicmp(szName, L"SystemPath", 10))
+        else if (!_wcsnicmp(szName, L"SystemPath", 10))
         {
             wcscpy(pRecord->szBootPath, szValue);
         }
         {
             wcscpy(pRecord->szBootPath, szValue);
         }
-        else if (!wcsnicmp(szName, L"Options", 7))
+        else if (!_wcsnicmp(szName, L"Options", 7))
         {
             //FIXME store flags as values
             wcscpy(pRecord->szOptions, szValue);
         {
             //FIXME store flags as values
             wcscpy(pRecord->szOptions, szValue);
@@ -329,12 +329,12 @@ LoadBootSettings(HINF hInf, HWND hwndDlg)
             return FALSE;
         }
 
             return FALSE;
         }
 
-        if (!wcsnicmp(szName, L"timeout", 7))
+        if (!_wcsnicmp(szName, L"timeout", 7))
         {
             TimeOut = _wtoi(szValue);
         }
 
         {
             TimeOut = _wtoi(szValue);
         }
 
-        if (!wcsnicmp(szName, L"default", 7))
+        if (!_wcsnicmp(szName, L"default", 7))
         {
             wcscpy(szDefaultOS, szValue);
         }
         {
             wcscpy(szDefaultOS, szValue);
         }
index bb8049d..5baa2bc 100644 (file)
@@ -2,6 +2,7 @@
        <importlibrary definition="msgina.spec" />
        <include base="msgina">.</include>
        <include base="msgina">include</include>
        <importlibrary definition="msgina.spec" />
        <include base="msgina">.</include>
        <include base="msgina">include</include>
+       <include base="ReactOS">include/reactos/wine</include>
        <library>ntdll</library>
        <library>wine</library>
        <library>kernel32</library>
        <library>ntdll</library>
        <library>wine</library>
        <library>kernel32</library>
index 845bf72..5dc52ec 100644 (file)
@@ -430,7 +430,7 @@ FindNetworkComponent(
 {
     while(pHead)
     {
 {
     while(pHead)
     {
-        if (!wcsicmp(pHead->szId, pszwComponentId))
+        if (!_wcsicmp(pHead->szId, pszwComponentId))
         {
             return INetCfgComponent_Constructor(NULL, &IID_INetCfgComponent, (LPVOID*)pComponent, pHead, iface);
         }
         {
             return INetCfgComponent_Constructor(NULL, &IID_INetCfgComponent, (LPVOID*)pComponent, pHead, iface);
         }
index 5145cdb..91c57ec 100644 (file)
@@ -2812,7 +2812,7 @@ Initialize(TcpipConfNotifyImpl * This)
         {
             szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
         }
         {
             szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
         }
-        if (!wcsicmp(szBuffer, pStr))
+        if (!_wcsicmp(szBuffer, pStr))
         {
             bFound = TRUE;
             break;
         {
             bFound = TRUE;
             break;
index a0d4da6..bb0f0ad 100644 (file)
@@ -527,7 +527,7 @@ GetAdapterIndexFromNetCfgInstanceId(PIP_ADAPTER_INFO pAdapterInfo, LPWSTR szNetC
         {
             szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
         }
         {
             szBuffer[(sizeof(szBuffer)/sizeof(WCHAR))-1] = L'\0';
         }
-        if (!wcsicmp(szBuffer, szNetCfg))
+        if (!_wcsicmp(szBuffer, szNetCfg))
         {
             *pIndex = pCurrentAdapter->Index;
             return TRUE;
         {
             *pIndex = pCurrentAdapter->Index;
             return TRUE;
index 1e4b9ce..4db5aa2 100644 (file)
@@ -97,7 +97,7 @@ GetINetCfgComponent(INetCfg * pNCfg, INetConnectionPropertyUiImpl * This, INetCf
        hr = INetCfgComponent_GetDisplayName(pNCg, &pName);
        if (SUCCEEDED(hr))
        {
        hr = INetCfgComponent_GetDisplayName(pNCg, &pName);
        if (SUCCEEDED(hr))
        {
-           if (!wcsicmp(pName, This->pProperties->pszwDeviceName))
+           if (!_wcsicmp(pName, This->pProperties->pszwDeviceName))
            {
                *pOut = pNCg;
                IEnumNetCfgComponent_Release(pEnumCfg);
            {
                *pOut = pNCg;
                IEnumNetCfgComponent_Release(pEnumCfg);
index 6bcf7ed..fc267d0 100644 (file)
@@ -591,7 +591,7 @@ FindNetworkAdapter(HDEVINFO hInfo, SP_DEVINFO_DATA *pDevInfo, LPWSTR pGuid)
             break;
         }
         RegCloseKey(hSubKey);
             break;
         }
         RegCloseKey(hSubKey);
-        if (!wcsicmp(pGuid, szNetCfg))
+        if (!_wcsicmp(pGuid, szNetCfg))
         {
             return TRUE;
         }
         {
             return TRUE;
         }
index 685598a..88e6222 100644 (file)
@@ -383,7 +383,7 @@ SearchDriverRecursive(
                {
                        LPCWSTR pszExtension = GetFileExt(FileName);
 
                {
                        LPCWSTR pszExtension = GetFileExt(FileName);
 
-                       if ((wcsicmp(pszExtension, L".inf") == 0) && (wcscmp(LastDirPath, DirPath) != 0))
+                       if ((_wcsicmp(pszExtension, L".inf") == 0) && (wcscmp(LastDirPath, DirPath) != 0))
                        {
                                wcscpy(LastDirPath, DirPath);
 
                        {
                                wcscpy(LastDirPath, DirPath);
 
index 8f2d458..df97d7b 100644 (file)
@@ -365,7 +365,7 @@ SaveCustomPath(
                        TRACE("ComboBox_GetLBText() failed\n");
                        goto cleanup;
                }
                        TRACE("ComboBox_GetLBText() failed\n");
                        goto cleanup;
                }
-               else if (UseCustomPath && wcsicmp(CustomPath, pBuffer) == 0)
+               else if (UseCustomPath && _wcsicmp(CustomPath, pBuffer) == 0)
                        UseCustomPath = FALSE;
                pBuffer += 1 + Length;
        }
                        UseCustomPath = FALSE;
                pBuffer += 1 + Length;
        }
index 0bc6d67..e04fa19 100644 (file)
@@ -1,6 +1,7 @@
 <module name="ntmarta" type="win32dll" baseaddress="${BASEADDRESS_NTMARTA}" installbase="system32" installname="ntmarta.dll" unicode="yes">
        <importlibrary definition="ntmarta.spec" />
        <include base="ntmarta">.</include>
 <module name="ntmarta" type="win32dll" baseaddress="${BASEADDRESS_NTMARTA}" installbase="system32" installname="ntmarta.dll" unicode="yes">
        <importlibrary definition="ntmarta.spec" />
        <include base="ntmarta">.</include>
+       <define name="__WINESRC__" />
        <define name="_WIN32_WINNT">0x600</define>
        <library>ntdll</library>
        <library>kernel32</library>
        <define name="_WIN32_WINNT">0x600</define>
        <library>ntdll</library>
        <library>kernel32</library>
index b146c92..9fe9314 100644 (file)
@@ -2261,7 +2261,7 @@ void _ILGetFileType(LPCITEMIDLIST pidl, LPSTR pOut, UINT uOutSize)
             }
             /* display Ext-file as description */
             strcpy(pOut, sType);
             }
             /* display Ext-file as description */
             strcpy(pOut, sType);
-            strupr(pOut);
+            _strupr(pOut);
             /* load localized file string */
             sTemp[0] = '\0';
             if(LoadStringA(shell32_hInstance, IDS_SHV_COLUMN1, sTemp, 64))
             /* load localized file string */
             sTemp[0] = '\0';
             if(LoadStringA(shell32_hInstance, IDS_SHV_COLUMN1, sTemp, 64))
index ce03347..ad7f79a 100644 (file)
@@ -2637,7 +2637,7 @@ SH_ShellLinkDlgProc(
                 return TRUE;
             }
             ptr = wcsrchr(szBuffer, L'.');
                 return TRUE;
             }
             ptr = wcsrchr(szBuffer, L'.');
-            if (ptr && !wcsnicmp(ptr, L".lnk", 4))
+            if (ptr && !_wcsnicmp(ptr, L".lnk", 4))
             {
                 // FIXME load localized error msg
                 MessageBoxW( hwndDlg, L"You cannot create a link to a shortcut", L"Error", MB_ICONERROR );
             {
                 // FIXME load localized error msg
                 MessageBoxW( hwndDlg, L"You cannot create a link to a shortcut", L"Error", MB_ICONERROR );
index 04c6a68..e994425 100644 (file)
@@ -360,7 +360,7 @@ static void *SHELL_BuildEnvW( const WCHAR *path )
     while (*p)
     {
         int len = wcslen(p) + 1;
     while (*p)
     {
         int len = wcslen(p) + 1;
-        if (!wcsnicmp( p, wPath, 5 )) got_path = TRUE;
+        if (!_wcsnicmp( p, wPath, 5 )) got_path = TRUE;
         total += len;
         p += len;
     }
         total += len;
         p += len;
     }
@@ -378,7 +378,7 @@ static void *SHELL_BuildEnvW( const WCHAR *path )
     {
         int len = wcslen(p) + 1;
         memcpy( p2, p, len * sizeof(WCHAR) );
     {
         int len = wcslen(p) + 1;
         memcpy( p2, p, len * sizeof(WCHAR) );
-        if (!wcsnicmp( p, wPath, 5 ))
+        if (!_wcsnicmp( p, wPath, 5 ))
         {
             p2[len - 1] = ';';
             wcscpy( p2 + len, path );
         {
             p2[len - 1] = ';';
             wcscpy( p2 + len, path );
@@ -1627,7 +1627,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
 
         /* Remove File Protocol from lpFile */
         /* In the case file://path/file     */
 
         /* Remove File Protocol from lpFile */
         /* In the case file://path/file     */
-        if (!wcsnicmp(lpFile, wFile, iSize))
+        if (!_wcsnicmp(lpFile, wFile, iSize))
         {
             lpFile += iSize;
             while (*lpFile == ':') lpFile++;
         {
             lpFile += iSize;
             while (*lpFile == ':') lpFile++;
@@ -1635,7 +1635,7 @@ BOOL SHELL_execute( LPSHELLEXECUTEINFOW sei, SHELL_ExecuteW32 execfunc )
         retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, wcmd, execfunc, &sei_tmp, sei);
     }
     /* Check if file specified is in the form www.??????.*** */
         retval = execute_from_key(lpstrProtocol, lpFile, NULL, sei_tmp.lpParameters, wcmd, execfunc, &sei_tmp, sei);
     }
     /* Check if file specified is in the form www.??????.*** */
-    else if (!wcsnicmp(lpFile, wWww, 3))
+    else if (!_wcsnicmp(lpFile, wWww, 3))
     {
         /* if so, append lpFile http:// and call ShellExecute */
         WCHAR lpstrTmpFile[256];
     {
         /* if so, append lpFile http:// and call ShellExecute */
         WCHAR lpstrTmpFile[256];
index ed82b0a..b1bc56e 100644 (file)
@@ -161,13 +161,13 @@ PSHELLNEW_ITEM LoadItem(LPWSTR szKeyName)
             pNewItem = HeapAlloc(GetProcessHeap(), 0, sizeof(SHELLNEW_ITEM));
             pNewItem->Type = type;
             if (szTarget)
             pNewItem = HeapAlloc(GetProcessHeap(), 0, sizeof(SHELLNEW_ITEM));
             pNewItem->Type = type;
             if (szTarget)
-                pNewItem->szTarget = wcsdup(szTarget);
+                pNewItem->szTarget = _wcsdup(szTarget);
             else
                 pNewItem->szTarget = NULL;
 
             else
                 pNewItem->szTarget = NULL;
 
-            pNewItem->szDesc = wcsdup(szDesc);
-            pNewItem->szIcon = wcsdup(szIcon);
-            pNewItem->szExt = wcsdup(szKeyName);
+            pNewItem->szDesc = _wcsdup(szDesc);
+            pNewItem->szIcon = _wcsdup(szIcon);
+            pNewItem->szExt = _wcsdup(szKeyName);
             pNewItem->Next = NULL;
             break;
          }
             pNewItem->Next = NULL;
             break;
          }
@@ -388,7 +388,7 @@ DoShellNewCmd(INewMenuImpl * This, LPCMINVOKECOMMANDINFO lpcmi)
 
          ZeroMemory(&sInfo, sizeof(sInfo));
          sInfo.cb = sizeof(sizeof(sInfo));
 
          ZeroMemory(&sInfo, sizeof(sInfo));
          sInfo.cb = sizeof(sizeof(sInfo));
-         szCmd = wcsdup(ptr);
+         szCmd = _wcsdup(ptr);
          if (!szCmd)
              break;
          if (CreateProcessW(NULL, szCmd, NULL, NULL,FALSE,0,NULL,NULL,&sInfo, &pi))
          if (!szCmd)
              break;
          if (CreateProcessW(NULL, szCmd, NULL, NULL,FALSE,0,NULL,NULL,&sInfo, &pi))
index 78e1da8..d7f940a 100644 (file)
@@ -670,13 +670,13 @@ LookupIconIdFromDirectoryEx(PBYTE xdir,
         {
             ColorBits = 1;
         }
         {
             ColorBits = 1;
         }
-        else if (g_psi->SystemMetrics[SM_SAMEDISPLAYFORMAT] || (cFlag & LR_VGACOLOR) )
+        else if (cFlag & LR_VGACOLOR)
         {
             ColorBits = 4;
         }
         else
         {
         {
             ColorBits = 4;
         }
         else
         {
-            ColorBits = 0;
+            ColorBits = g_psi->BitsPixel;
         }
 
         if(bIcon)
         }
 
         if(bIcon)
index 05f7f59..21f1734 100644 (file)
@@ -1,6 +1,7 @@
 <module name="winspool" type="win32dll" extension=".drv" baseaddress="${BASEADDRESS_WINSPOOL}" installbase="system32" installname="winspool.drv" allowwarnings="true" unicode="yes">
        <importlibrary definition="winspool.spec" />
        <include base="winspool">.</include>
 <module name="winspool" type="win32dll" extension=".drv" baseaddress="${BASEADDRESS_WINSPOOL}" installbase="system32" installname="winspool.drv" allowwarnings="true" unicode="yes">
        <importlibrary definition="winspool.spec" />
        <include base="winspool">.</include>
+       <include base="ReactOS">include/reactos/wine</include>
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
        <library>kernel32</library>
        <define name="_DISABLE_TIDENTS" />
        <library>ntdll</library>
        <library>kernel32</library>
index 5c3e70b..98d50f0 100644 (file)
@@ -10,7 +10,9 @@
                        <xi:include href="halx86/hal_generic_up.rbuild" />
                        <xi:include href="halx86/hal_generic_pc.rbuild" />
                        <xi:include href="halx86/halup.rbuild" />
                        <xi:include href="halx86/hal_generic_up.rbuild" />
                        <xi:include href="halx86/hal_generic_pc.rbuild" />
                        <xi:include href="halx86/halup.rbuild" />
-                       <xi:include href="halx86/halmp.rbuild" />
+                       <if property="BUILD_MP" value="1">
+                               <xi:include href="halx86/halmp.rbuild" />
+                       </if>
                        <xi:include href="halx86/halxbox.rbuild" />
                </directory>
        </if>
                        <xi:include href="halx86/halxbox.rbuild" />
                </directory>
        </if>
index afe80a9..15d5e8c 100644 (file)
@@ -4,11 +4,12 @@
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 
-#ifndef _INC_CRTDEFS
-#define _INC_CRTDEFS
+#ifndef _INC_MINGW
+#define _INC_MINGW
 
 #define _INTEGRAL_MAX_BITS 64
 
 
 #define _INTEGRAL_MAX_BITS 64
 
+// ROS HACK!
 #ifndef _WIN64
  #ifndef _USE_32BIT_TIME_T
   #define _USE_32BIT_TIME_T
 #ifndef _WIN64
  #ifndef _USE_32BIT_TIME_T
   #define _USE_32BIT_TIME_T
 #define __stdcall
 #endif
 
 #define __stdcall
 #endif
 
-#if defined(_MSC_VER)
-# ifdef _DLL
-#  ifndef __MINGW_IMPORT
-#   define __MINGW_IMPORT  __declspec(dllimport)
-#  endif
-#  ifndef _CRTIMP
-#   define _CRTIMP  __declspec(dllimport)
-#  endif
-# else
-#  ifndef __MINGW_IMPORT
-#   define __MINGW_IMPORT
-#  endif
-#  ifndef _CRTIMP
-#   define _CRTIMP
-#  endif
+#ifdef __GNUC__
+ /* These compilers do support __declspec */
+# if !defined(__MINGW32__) && !defined(__MINGW64__) && !defined(__CYGWIN32__)
+#  define __declspec(x) __attribute__((x))
 # endif
 # endif
-# define __DECLSPEC_SUPPORTED
-# define __attribute__(x) /* nothing */
-# define __restrict__ /* nothing */
-#elif defined(__GNUC__)
-# ifdef __declspec
-#  ifndef __MINGW_IMPORT
-#   ifdef _DLL
-/* Note the extern. This is needed to work around GCC's
-limitations in handling dllimport attribute.  */
-#    define __MINGW_IMPORT  extern __attribute__ ((__dllimport__))
-#   else
-#    define __MINGW_IMPORT extern
-#   endif
-#  endif
-#  ifndef _CRTIMP
-#   undef __USE_CRTIMP
-#   if !defined (_CRTBLD) && !defined (_SYSCRT)
-#    define __USE_CRTIMP 1
-#   endif
-#   ifdef __USE_CRTIMP
-#    ifdef _DLL
-#     define _CRTIMP  __attribute__ ((dllimport))
-#    else
-#     define _CRTIMP
-#    endif
-#   else
-#    define _CRTIMP
-#   endif
-#  endif
-#  define __DECLSPEC_SUPPORTED
-# else /* __declspec */
-#  undef __DECLSPEC_SUPPORTED
-#  undef __MINGW_IMPORT
-#  ifndef _CRTIMP
-#   define _CRTIMP
-#  endif
-# endif /* __declspec */
 #else
 #else
-# ifndef __MINGW_IMPORT
-#  define __MINGW_IMPORT __declspec(dllimport)
-# endif
-# ifndef _CRTIMP
-#  define _CRTIMP __declspec(dllimport)
-# endif
-# define __DECLSPEC_SUPPORTED
 # define __attribute__(x) /* nothing */
 # define __attribute__(x) /* nothing */
-#endif /* __GNUC__ */
+#endif
 
 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
 #define __MINGW_GNUC_PREREQ(major, minor) \
 
 #if defined (__GNUC__) && defined (__GNUC_MINOR__)
 #define __MINGW_GNUC_PREREQ(major, minor) \
@@ -102,12 +48,8 @@ limitations in handling dllimport attribute.  */
 #define __MINGW_GNUC_PREREQ(major, minor)  0
 #endif
 
 #define __MINGW_GNUC_PREREQ(major, minor)  0
 #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
+#if !defined (_MSC_VER)
+#define __MINGW_MSC_PREREQ(major, minor)  0
 #endif
 
 #define USE___UUIDOF   0
 #endif
 
 #define USE___UUIDOF   0
@@ -115,9 +57,7 @@ limitations in handling dllimport attribute.  */
 #ifdef __cplusplus
 # define __CRT_INLINE inline
 #else
 #ifdef __cplusplus
 # define __CRT_INLINE inline
 #else
-# if defined(_MSC_VER)
-#  define __CRT_INLINE __inline
-# elif __GNUC_STDC_INLINE__
+# if ( __MINGW_GNUC_PREREQ(4, 3)  &&  __STDC_VERSION__ >= 199901L)
 #  define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
 # else
 #  define __CRT_INLINE extern __inline__
 #  define __CRT_INLINE extern inline __attribute__((__gnu_inline__))
 # else
 #  define __CRT_INLINE extern __inline__
@@ -134,6 +74,16 @@ limitations in handling dllimport attribute.  */
 # endif
 #endif
 
 # endif
 #endif
 
+#ifdef __cplusplus
+# define __unaligned
+#else
+# ifdef __GNUC__
+#  define __unaligned __attribute((packed))
+# else
+#  define __UNUSED_PARAM(x) x
+# endif
+#endif
+
 #ifdef __GNUC__
 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
 #ifdef __GNUC__
 #define __MINGW_ATTRIB_NORETURN __attribute__ ((__noreturn__))
 #define __MINGW_ATTRIB_CONST __attribute__ ((__const__))
@@ -186,48 +136,25 @@ allow GCC to optimize away some EH unwind code, at least in DW2 case.  */
 # define __MSVCRT_VERSION__ 0x0700
 #endif
 
 # define __MSVCRT_VERSION__ 0x0700
 #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
-
 //#ifndef WINVER
 //#define WINVER 0x0502
 //#endif
 
 //#ifndef WINVER
 //#define WINVER 0x0502
 //#endif
 
-#ifndef _WIN32_WINNT
-#define _WIN32_WINNT 0x502
-#endif
+//#ifndef _WIN32_WINNT
+//#define _WIN32_WINNT 0x502
+//#endif
 
 
-#ifndef _INT128_DEFINED
-#define _INT128_DEFINED
 #ifdef __GNUC__
 #define __int8 char
 #define __int16 short
 #define __int32 int
 #define __int64 long long
 #ifdef _WIN64
 #ifdef __GNUC__
 #define __int8 char
 #define __int16 short
 #define __int32 int
 #define __int64 long long
 #ifdef _WIN64
-
-typedef int __int128 __attribute__ ((mode (TI)));
-
-#endif
-
-#define __ptr32
-#define __ptr64
-#define __unaligned __attribute ((packed))
-#define __forceinline extern __inline
-#endif
-#endif
-
-#ifndef _WIN32
-#error Only Win32 target is supported!
+   typedef int __int128 __attribute__ ((mode (TI)));
+# endif
+# define __ptr32
+# define __ptr64
+# define __forceinline extern __inline __attribute((always_inline))
 #endif
 
 #ifdef __cplusplus
 #endif
 
 #ifdef __cplusplus
@@ -240,333 +167,66 @@ typedef int __int128 __attribute__ ((mode (TI)));
 #endif
 #endif
 
 #endif
 #endif
 
-#undef _CRT_PACKING
-#define _CRT_PACKING 8
-
 #ifdef _WIN64
 #undef USE_MINGW_SETJMP_TWO_ARGS
 #define USE_MINGW_SETJMP_TWO_ARGS
 #endif
 
 #ifdef _WIN64
 #undef USE_MINGW_SETJMP_TWO_ARGS
 #define USE_MINGW_SETJMP_TWO_ARGS
 #endif
 
-#pragma pack(push,_CRT_PACKING)
-
-#include <vadefs.h>
-
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-#ifndef _CRT_STRINGIZE
-#define __CRT_STRINGIZE(_Value) #_Value
-#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
-#endif
-
-#ifndef _CRT_WIDE
-#define __CRT_WIDE(_String) L ## _String
-#define _CRT_WIDE(_String) __CRT_WIDE(_String)
-#endif
-#ifndef _W64
-#define _W64
-#endif
-
-#ifndef _CRTIMP_NOIA64
-#ifdef __ia64__
-#define _CRTIMP_NOIA64
-#else
-#define _CRTIMP_NOIA64 _CRTIMP
-#endif
-#endif
-
-#ifndef _CRTIMP2
-#define _CRTIMP2 _CRTIMP
-#endif
-
-#ifndef _CRTIMP_ALTERNATIVE
-#define _CRTIMP_ALTERNATIVE _CRTIMP
-#define _CRT_ALTERNATIVE_IMPORTED
-#endif
-
-#ifndef _MRTIMP2
-#define _MRTIMP2  _CRTIMP
-#endif
-
-#ifndef _DLL
-#define _DLL
-#endif
-
-#ifndef _MT
-#define _MT
+#ifndef __GNUC_VA_LIST
+#define __GNUC_VA_LIST
+  typedef __builtin_va_list __gnuc_va_list;
 #endif
 
 #endif
 
-#ifndef _MCRTIMP
-#define _MCRTIMP _CRTIMP
+#ifndef _VA_LIST_DEFINED
+#define _VA_LIST_DEFINED
+  typedef __gnuc_va_list va_list;
 #endif
 
 #endif
 
-#ifndef _CRTIMP_PURE
-#define _CRTIMP_PURE _CRTIMP
+/* Diable deprecation for now! */
+#define _CRT_SECURE_NO_DEPRECATE
+#define _CRT_SECURE_NO_DEPRECATE_CORE
+#ifdef __WINESRC__
+#define _CRT_NONSTDC_NO_DEPRECATE
 #endif
 
 #endif
 
-#ifndef _PGLOBAL
-#define _PGLOBAL
+#if (defined(_MSC_VER) && __STDC__)// || !defined(__WINESRC__)
+#define NO_OLDNAMES
 #endif
 
 #endif
 
-#ifndef _AGLOBAL
-#define _AGLOBAL
+#ifdef __cplusplus
+}
 #endif
 
 #endif
 
-#define __STDC_SECURE_LIB__ 200411L
-#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
-#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
-#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
-
-#ifndef _CRT_INSECURE_DEPRECATE_MEMORY
-#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
-#endif
-#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
-#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
-#endif
-#ifndef _CRT_MANAGED_HEAP_DEPRECATE
-#define _CRT_MANAGED_HEAP_DEPRECATE
-#endif
+#define __crt_typefix(ctype)
 
 
-#ifndef _CRT_OBSOLETE
-#define _CRT_OBSOLETE(_NewItem)
+#ifndef _CRT_UNUSED
+#define _CRT_UNUSED(x) (void)x
 #endif
 
 #endif
 
+/* These are here for intrin.h */
 #ifndef _SIZE_T_DEFINED
 #define _SIZE_T_DEFINED
 #ifndef _SIZE_T_DEFINED
 #define _SIZE_T_DEFINED
-#undef size_t
 #ifdef _WIN64
 #ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef unsigned int size_t __attribute__ ((mode (DI)));
-#else
   typedef unsigned __int64 size_t;
   typedef unsigned __int64 size_t;
-#endif
 #else
   typedef unsigned int size_t;
 #endif
 #endif
 
 #else
   typedef unsigned int size_t;
 #endif
 #endif
 
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int ssize_t __attribute__ ((mode (DI)));
-#else
-  typedef __int64 ssize_t;
-#endif
-#else
-  typedef int ssize_t;
-#endif
-#endif
-
-#ifndef _INTPTR_T_DEFINED
-#define _INTPTR_T_DEFINED
-#ifndef __intptr_t_defined
-#define __intptr_t_defined
-#undef intptr_t
-#ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int intptr_t __attribute__ ((mode (DI)));
-#else
-  typedef __int64 intptr_t;
-#endif
-#else
-  typedef int intptr_t;
-#endif
-#endif
-#endif
-
 #ifndef _UINTPTR_T_DEFINED
 #define _UINTPTR_T_DEFINED
 #ifndef _UINTPTR_T_DEFINED
 #define _UINTPTR_T_DEFINED
-#ifndef __uintptr_t_defined
-#define __uintptr_t_defined
-#undef uintptr_t
 #ifdef _WIN64
 #ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
-#else
   typedef unsigned __int64 uintptr_t;
   typedef unsigned __int64 uintptr_t;
-#endif
 #else
   typedef unsigned int uintptr_t;
 #endif
 #endif
 #else
   typedef unsigned int uintptr_t;
 #endif
 #endif
-#endif
-
-#ifndef _PTRDIFF_T_DEFINED
-#define _PTRDIFF_T_DEFINED
-#ifndef _PTRDIFF_T_
-#undef ptrdiff_t
-#ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int ptrdiff_t __attribute__ ((mode (DI)));
-#else
-  typedef __int64 ptrdiff_t;
-#endif
-#else
-  typedef int ptrdiff_t;
-#endif
-#endif
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-#ifndef __cplusplus
-  typedef unsigned short wchar_t;
-#endif
-#endif
-
-#ifndef _WCTYPE_T_DEFINED
-#define _WCTYPE_T_DEFINED
-  typedef unsigned short wint_t;
-  typedef unsigned short wctype_t;
-#endif
-
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-  typedef __builtin_va_list __gnuc_va_list;
-#endif
-
-#ifndef _VA_LIST_DEFINED
-#define _VA_LIST_DEFINED
-  typedef __gnuc_va_list va_list;
-#endif
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#else
-#if _INTEGRAL_MAX_BITS < 64
-#define _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _ERRCODE_DEFINED
-#define _ERRCODE_DEFINED
-  typedef int errcode;
-  typedef int errno_t;
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-  typedef long __time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-//#if _INTEGRAL_MAX_BITS >= 64
-  typedef __int64 __time64_t;
-#endif
-//#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#endif
-
-#ifndef _CONST_RETURN
-#define _CONST_RETURN
-#endif
-
-#ifndef __CRT_UNALIGNED
-#define __CRT_UNALIGNED
-#endif
-
-#ifndef UNALIGNED
-#if defined(__ia64__) || defined(__x86_64)
-#define UNALIGNED __unaligned
-#else
-#define UNALIGNED
-#endif
-#endif
-
-#ifndef _CRT_ALIGN
-#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
-#endif
-
-#ifndef _CRTNOALIAS
-#define _CRTNOALIAS
-#endif
-
-#ifndef _CRTRESTRICT
-#define _CRTRESTRICT
-#endif
-
-#ifndef __CRTDECL
-#define __CRTDECL __cdecl
-#endif
-
-#define _ARGMAX 100
 
 
-#ifndef _TRUNCATE
-#define _TRUNCATE ((size_t)-1)
-#endif
-  struct threadlocaleinfostruct;
-  struct threadmbcinfostruct;
-  typedef struct threadlocaleinfostruct *pthreadlocinfo;
-  typedef struct threadmbcinfostruct *pthreadmbcinfo;
-  struct __lc_time_data;
-
-  typedef struct localeinfo_struct {
-    pthreadlocinfo locinfo;
-    pthreadmbcinfo mbcinfo;
-  } _locale_tstruct,*_locale_t;
-
-#ifndef _TAGLC_ID_DEFINED
-#define _TAGLC_ID_DEFINED
-  typedef struct tagLC_ID {
-    unsigned short wLanguage;
-    unsigned short wCountry;
-    unsigned short wCodePage;
-  } LC_ID,*LPLC_ID;
-#endif
+#include <mingw32/intrin.h>
 
 
-#ifndef _THREADLOCALEINFO
-#define _THREADLOCALEINFO
-  typedef struct threadlocaleinfostruct {
-    int refcount;
-    unsigned int lc_codepage;
-    unsigned int lc_collate_cp;
-    unsigned long lc_handle[6];
-    LC_ID lc_id[6];
-    struct {
-      char *locale;
-      wchar_t *wlocale;
-      int *refcount;
-      int *wrefcount;
-    } lc_category[6];
-    int lc_clike;
-    int mb_cur_max;
-    int *lconv_intl_refcount;
-    int *lconv_num_refcount;
-    int *lconv_mon_refcount;
-    struct lconv *lconv;
-    int *ctype1_refcount;
-    unsigned short *ctype1;
-    const unsigned short *pctype;
-    const unsigned char *pclmap;
-    const unsigned char *pcumap;
-    struct __lc_time_data *lc_time_curr;
-  } threadlocinfo;
-#endif
+#endif /* !_INC_MINGW */
 
 
-#ifdef __cplusplus
-}
-#endif
-
-#define __crt_typefix(ctype)
-
-#ifndef _CRT_UNUSED
-#define _CRT_UNUSED(x) (void)x
-#endif
-
-#pragma pack(pop)
-#endif
index 6340dab..252fd54 100644 (file)
@@ -6,53 +6,36 @@
 #ifndef __ASSERT_H_
 #define __ASSERT_H_
 
 #ifndef __ASSERT_H_
 #define __ASSERT_H_
 
-#include <_mingw.h>
-#ifdef __cplusplus
-#include <stdlib.h>
-#endif
+#include <crtdefs.h>
 
 #ifdef NDEBUG
 
 #ifdef NDEBUG
+
 #ifndef assert
 #define assert(_Expression) ((void)0)
 #endif
 #ifndef assert
 #define assert(_Expression) ((void)0)
 #endif
-#else
-
-#ifndef _CRT_TERMINATE_DEFINED
-#define _CRT_TERMINATE_DEFINED
-__declspec(noreturn) void __cdecl exit(int _Code);
-_CRTIMP __declspec(noreturn) void __cdecl _exit(int _Code);
-#if !defined __NO_ISOCEXT /* extern stub in static libmingwex.a */
-/* C99 function name */
-void __cdecl __declspec(noreturn) _Exit(int); /* Declare to get noreturn attribute.  */
-__CRT_INLINE void __cdecl _Exit(int status)
-{  _exit(status); }
-#endif
-
-#if __MINGW_GNUC_PREREQ(4,4)
-#pragma push_macro("abort")
-#undef abort
-#endif
-  void __cdecl __declspec(noreturn) abort(void);
-#if __MINGW_GNUC_PREREQ(4,4)
-#pragma pop_macro("abort")
-#endif
 
 
-#endif
+#else /* !NDEBUG */
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-//extern void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
+  _CRTIMP void __cdecl _assert(const char *_Message,const char *_File,unsigned _Line);
+  _CRTIMP void __cdecl _wassert(const wchar_t *_Message,const wchar_t *_File,unsigned _Line);
 
 #ifdef __cplusplus
 }
 #endif
 
 #ifndef assert
 
 #ifdef __cplusplus
 }
 #endif
 
 #ifndef assert
+//#define assert(_Expression) (void)((!!(_Expression)) || (_assert(#_Expression,__FILE__,__LINE__),0))
 #define assert(_Expression) (void)((!!(_Expression)))// || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
 #endif
 
 #define assert(_Expression) (void)((!!(_Expression)))// || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
 #endif
 
+#ifndef wassert
+#define wassert(_Expression) (void)((!!(_Expression)) || (_wassert(_CRT_WIDE(#_Expression),_CRT_WIDE(__FILE__),__LINE__),0))
+#endif
+
 #endif
 
 #endif
 #endif
 
 #endif
index f659dd9..7989a49 100644 (file)
@@ -26,8 +26,7 @@
 #ifndef _COMPLEX_H_
 #define _COMPLEX_H_
 
 #ifndef _COMPLEX_H_
 #define _COMPLEX_H_
 
-/* All the headers include this file. */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
      || !defined __STRICT_ANSI__ 
 
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) \
      || !defined __STRICT_ANSI__ 
index 2b71ce6..0c77d3c 100644 (file)
@@ -6,17 +6,17 @@
 #ifndef _INC_CONIO
 #define _INC_CONIO
 
 #ifndef _INC_CONIO
 #define _INC_CONIO
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
 
 #ifdef __cplusplus
 extern "C" {
 #endif
 
-  _CRTIMP char *_cgets(char *_Buffer);
+  _CRTIMP char * __cdecl _cgets(char *_Buffer);
   _CRTIMP int __cdecl _cprintf(const char *_Format,...);
   _CRTIMP int __cdecl _cputs(const char *_Str);
   _CRTIMP int __cdecl _cprintf(const char *_Format,...);
   _CRTIMP int __cdecl _cputs(const char *_Str);
-  _CRTIMP int __cdecl _cscanf(const char *_Format,...);
-  _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...);
+  _CRT_INSECURE_DEPRECATE(_cscanf_s) _CRTIMP int __cdecl _cscanf(const char *_Format,...);
+  _CRT_INSECURE_DEPRECATE(_cscanf_s_l) _CRTIMP int __cdecl _cscanf_l(const char *_Format,_locale_t _Locale,...);
   _CRTIMP int __cdecl _getch(void);
   _CRTIMP int __cdecl _getche(void);
   _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList);
   _CRTIMP int __cdecl _getch(void);
   _CRTIMP int __cdecl _getche(void);
   _CRTIMP int __cdecl _vcprintf(const char *_Format,va_list _ArgList);
@@ -27,6 +27,12 @@ extern "C" {
   _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...);
   _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
   _CRTIMP int __cdecl _kbhit(void);
   _CRTIMP int __cdecl _cprintf_p_l(const char *_Format,_locale_t _Locale,...);
   _CRTIMP int __cdecl _vcprintf_p_l(const char *_Format,_locale_t _Locale,va_list _ArgList);
   _CRTIMP int __cdecl _kbhit(void);
+  _CRTIMP int __cdecl _putch(int _Ch);
+  _CRTIMP int __cdecl _ungetch(int _Ch);
+  _CRTIMP int __cdecl _getch_nolock(void);
+  _CRTIMP int __cdecl _getche_nolock(void);
+  _CRTIMP int __cdecl _putch_nolock(int _Ch);
+  _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
 
 #if defined(_X86_) && !defined(__x86_64)
   int __cdecl _inp(unsigned short);
 
 #if defined(_X86_) && !defined(__x86_64)
   int __cdecl _inp(unsigned short);
@@ -37,12 +43,6 @@ extern "C" {
   unsigned long __cdecl _outpd(unsigned short,unsigned long);
 #endif
 
   unsigned long __cdecl _outpd(unsigned short,unsigned long);
 #endif
 
-  _CRTIMP int __cdecl _putch(int _Ch);
-  _CRTIMP int __cdecl _ungetch(int _Ch);
-  _CRTIMP int __cdecl _getch_nolock(void);
-  _CRTIMP int __cdecl _getche_nolock(void);
-  _CRTIMP int __cdecl _putch_nolock(int _Ch);
-  _CRTIMP int __cdecl _ungetch_nolock(int _Ch);
 
 #ifndef _WCONIO_DEFINED
 #define _WCONIO_DEFINED
 
 #ifndef _WCONIO_DEFINED
 #define _WCONIO_DEFINED
@@ -58,8 +58,8 @@ extern "C" {
   _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
   _CRTIMP int __cdecl _cputws(const wchar_t *_String);
   _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
   _CRTIMP wint_t __cdecl _ungetwch(wint_t _WCh);
   _CRTIMP int __cdecl _cputws(const wchar_t *_String);
   _CRTIMP int __cdecl _cwprintf(const wchar_t *_Format,...);
-  _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
-  _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
+  _CRT_INSECURE_DEPRECATE(_cwscanf_s) _CRTIMP int __cdecl _cwscanf(const wchar_t *_Format,...);
+  _CRT_INSECURE_DEPRECATE(_cwscanf_s_l) _CRTIMP int __cdecl _cwscanf_l(const wchar_t *_Format,_locale_t _Locale,...);
   _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
   _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
   _CRTIMP int __cdecl _vcwprintf(const wchar_t *_Format,va_list _ArgList);
   _CRTIMP int __cdecl _cwprintf_p(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vcwprintf_p(const wchar_t *_Format,va_list _ArgList);
@@ -71,31 +71,38 @@ extern "C" {
   _CRTIMP wint_t __cdecl _getwch_nolock(void);
   _CRTIMP wint_t __cdecl _getwche_nolock(void);
   _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
   _CRTIMP wint_t __cdecl _getwch_nolock(void);
   _CRTIMP wint_t __cdecl _getwche_nolock(void);
   _CRTIMP wint_t __cdecl _ungetwch_nolock(wint_t _WCh);
+#endif /* _WCONIO_DEFINED */
+
+#ifndef _MT
+#define _putwch() _putwch_nolock()
+#define _getwch() _getwch_nolock()
+#define _getwche() _getwche_nolock()
+#define _ungetwch() _ungetwch_nolock()
 #endif
 
 #ifndef        NO_OLDNAMES
 #endif
 
 #ifndef        NO_OLDNAMES
-  char *__cdecl cgets(char *_Buffer);
-  int __cdecl cprintf(const char *_Format,...);
-  int __cdecl cputs(const char *_Str);
-  int __cdecl cscanf(const char *_Format,...);
-  int __cdecl getch(void);
-  int __cdecl getche(void);
-  int __cdecl kbhit(void);
-  int __cdecl putch(int _Ch);
-  int __cdecl ungetch(int _Ch);
+  _CRT_NONSTDC_DEPRECATE(_cgets) _CRT_INSECURE_DEPRECATE(_cgets_s) _CRTIMP char *__cdecl cgets(char *_Buffer);
+  _CRT_NONSTDC_DEPRECATE(_cprintf) _CRTIMP int __cdecl cprintf(const char *_Format,...);
+  _CRT_NONSTDC_DEPRECATE(_cputs) _CRTIMP int __cdecl cputs(const char *_Str);
+  _CRT_NONSTDC_DEPRECATE(_cscanf) _CRTIMP int __cdecl cscanf(const char *_Format,...);
+  _CRT_NONSTDC_DEPRECATE(_getch) _CRTIMP int __cdecl getch(void);
+  _CRT_NONSTDC_DEPRECATE(_getche) _CRTIMP int __cdecl getche(void);
+  _CRT_NONSTDC_DEPRECATE(_kbhit) _CRTIMP int __cdecl kbhit(void);
+  _CRT_NONSTDC_DEPRECATE(_putch) _CRTIMP int __cdecl putch(int _Ch);
+  _CRT_NONSTDC_DEPRECATE(_ungetch) _CRTIMP int __cdecl ungetch(int _Ch);
 
 #if (defined(_X86_) && !defined(__x86_64))
 
 #if (defined(_X86_) && !defined(__x86_64))
-  int __cdecl inp(unsigned short);
-  unsigned short __cdecl inpw(unsigned short);
-  int __cdecl outp(unsigned short,int);
-  unsigned short __cdecl outpw(unsigned short,unsigned short);
+  _CRT_NONSTDC_DEPRECATE(_inp) _CRTIMP int __cdecl inp(unsigned short);
+  _CRT_NONSTDC_DEPRECATE(_inpw) _CRTIMP unsigned short __cdecl inpw(unsigned short);
+  _CRT_NONSTDC_DEPRECATE(_outp) _CRTIMP int __cdecl outp(unsigned short,int);
+  _CRT_NONSTDC_DEPRECATE(_outpw) _CRTIMP unsigned short __cdecl outpw(unsigned short,unsigned short);
 #endif
 #endif
+#endif /* !NO_OLDNAMES */
 
 
-#endif
 #ifdef __cplusplus
 }
 #endif
 
 #include <sec_api/conio_s.h>
 
 #ifdef __cplusplus
 }
 #endif
 
 #include <sec_api/conio_s.h>
 
-#endif
+#endif /* _INC_CONIO */
index f5d58fe..16cf030 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_CRTDBG
 #define _INC_CRTDBG
 
 #ifndef _INC_CRTDBG
 #define _INC_CRTDBG
@@ -97,14 +97,26 @@ extern "C" {
 #define _ASSERT(expr) ((void)0)
 #endif
 
 #define _ASSERT(expr) ((void)0)
 #endif
 
+#ifndef _ASSERT_WRN
+#define _ASSERT_WRN(expr) ((void)0)
+#endif
+
 #ifndef _ASSERTE
 #define _ASSERTE(expr) ((void)0)
 #endif
 
 #ifndef _ASSERTE
 #define _ASSERTE(expr) ((void)0)
 #endif
 
+#ifndef _ASSERTE_WRN
+#define _ASSERTE_WRN(expr) ((void)0)
+#endif
+
 #ifndef _ASSERT_EXPR
 #define _ASSERT_EXPR(expr,expr_str) ((void)0)
 #endif
 
 #ifndef _ASSERT_EXPR
 #define _ASSERT_EXPR(expr,expr_str) ((void)0)
 #endif
 
+#ifndef _ASSERT_EXPR_WRN
+#define _ASSERT_EXPR_WRN(expr,expr_str) ((void)0)
+#endif
+
 #ifndef _ASSERT_BASE
 #define _ASSERT_BASE _ASSERT_EXPR
 #endif
 #ifndef _ASSERT_BASE
 #define _ASSERT_BASE _ASSERT_EXPR
 #endif
index ceb864f..759b704 100644 (file)
@@ -4,3 +4,389 @@
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 #include <_mingw.h>
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 #include <_mingw.h>
+
+#ifndef _INC_CRTDEFS
+#define _INC_CRTDEFS
+
+#ifdef _USE_32BIT_TIME_T
+#ifdef _WIN64
+#error You cannot use 32-bit time_t (_USE_32BIT_TIME_T) with _WIN64
+#undef _USE_32BIT_TIME_T
+#endif
+#else
+#if _INTEGRAL_MAX_BITS < 64
+#define _USE_32BIT_TIME_T
+#endif
+#endif
+
+/* Compatability definition */
+#if _MSC_VER > 0 && __STDC__
+#define NO_OLDNAMES
+#endif
+
+/** Properties ***************************************************************/
+
+#undef _CRT_PACKING
+#define _CRT_PACKING 8
+#pragma pack(push,_CRT_PACKING)
+
+#ifndef _CRT_STRINGIZE
+#define __CRT_STRINGIZE(_Value) #_Value
+#define _CRT_STRINGIZE(_Value) __CRT_STRINGIZE(_Value)
+#endif
+
+#ifndef _CRT_WIDE
+#define __CRT_WIDE(_String) L ## _String
+#define _CRT_WIDE(_String) __CRT_WIDE(_String)
+#endif
+
+#ifndef _W64
+ #if !defined(_midl) && defined(_X86_) && _MSC_VER >= 1300
+  #define _W64 __w64
+ #else
+  #define _W64
+ #endif
+#endif
+
+#ifndef _CRTIMP
+ #ifdef _DLL
+  #define _CRTIMP __declspec(dllimport)
+ #else
+  #define _CRTIMP 
+ #endif
+#endif
+
+//#define _CRT_ALTERNATIVE_INLINES
+
+#ifndef _CRTIMP_ALT
+ #ifdef _DLL
+  #ifdef _CRT_ALTERNATIVE_INLINES
+   #define _CRTIMP_ALT
+  #else
+   #define _CRTIMP_ALT _CRTIMP
+   #define _CRT_ALTERNATIVE_IMPORTED
+  #endif
+ #else
+  #define _CRTIMP_ALT
+ #endif
+#endif
+
+#ifndef _CRTDATA
+ #ifdef _M_CEE_PURE
+  #define _CRTDATA(x) x
+ #else
+  #define _CRTDATA(x) _CRTIMP x
+ #endif
+#endif
+
+#ifndef _CRTIMP2
+ #define _CRTIMP2 _CRTIMP
+#endif
+
+#ifndef _CRTIMP_PURE
+ #define _CRTIMP_PURE _CRTIMP
+#endif
+
+#ifndef _CRTIMP_ALTERNATIVE
+ #define _CRTIMP_ALTERNATIVE _CRTIMP
+ #define _CRT_ALTERNATIVE_IMPORTED
+#endif
+
+#ifndef _CRTIMP_NOIA64
+ #ifdef __ia64__
+  #define _CRTIMP_NOIA64
+ #else
+  #define _CRTIMP_NOIA64 _CRTIMP
+ #endif
+#endif
+
+#ifndef _MRTIMP2
+ #define _MRTIMP2  _CRTIMP
+#endif
+
+#ifndef _MCRTIMP
+ #define _MCRTIMP _CRTIMP
+#endif
+
+#ifndef _PGLOBAL
+ #define _PGLOBAL
+#endif
+
+#ifndef _AGLOBAL
+ #define _AGLOBAL
+#endif
+
+#ifndef _CONST_RETURN
+ #define _CONST_RETURN
+#endif
+
+#ifndef UNALIGNED
+#if defined(__ia64__) || defined(__x86_64)
+#define UNALIGNED __unaligned
+#else
+#define UNALIGNED
+#endif
+#endif
+
+#ifndef _CRT_ALIGN
+#define _CRT_ALIGN(x) __attribute__ ((aligned(x)))
+#endif
+
+#ifndef _CRTNOALIAS
+#define _CRTNOALIAS
+#endif
+
+#ifndef _CRTRESTRICT
+#define _CRTRESTRICT
+#endif
+
+#ifndef __CRTDECL
+#define __CRTDECL __cdecl
+#endif
+
+#ifndef _CRT_UNUSED
+#define _CRT_UNUSED(x) (void)x
+#endif
+
+#ifndef _CONST_RETURN
+#ifdef __cplusplus
+#define _CONST_RETURN const
+#define _CRT_CONST_CORRECT_OVERLOADS
+#else
+#define _CONST_RETURN
+#endif
+#endif
+
+#define __crt_typefix(ctype)
+
+
+/** Deprecated ***************************************************************/
+
+#define _CRT_DEPRECATE_TEXT(_Text) __declspec(deprecated)
+
+#ifndef _CRT_INSECURE_DEPRECATE
+# ifdef _CRT_SECURE_NO_DEPRECATE
+#  define _CRT_INSECURE_DEPRECATE(_Replacement)
+# else
+#  define _CRT_INSECURE_DEPRECATE(_Replacement) \
+    _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead!")
+# endif
+#endif
+
+#ifndef _CRT_INSECURE_DEPRECATE_CORE
+# ifdef _CRT_SECURE_NO_DEPRECATE_CORE
+#  define _CRT_INSECURE_DEPRECATE_CORE(_Replacement)
+# else
+#  define _CRT_INSECURE_DEPRECATE_CORE(_Replacement) \
+    _CRT_DEPRECATE_TEXT("This may be unsafe, Try " #_Replacement " instead! Enable _CRT_SECURE_NO_DEPRECATE to avoid thie warning.")
+# endif
+#endif
+
+#ifndef _CRT_NONSTDC_DEPRECATE
+# ifdef _CRT_NONSTDC_NO_DEPRECATE
+#  define _CRT_NONSTDC_DEPRECATE(_Replacement)
+# else
+#  define _CRT_NONSTDC_DEPRECATE(_Replacement) \
+    _CRT_DEPRECATE_TEXT("Deprecated POSIX name, Try " #_Replacement " instead!")
+# endif
+#endif
+
+#ifndef _CRT_INSECURE_DEPRECATE_MEMORY
+#define _CRT_INSECURE_DEPRECATE_MEMORY(_Replacement)
+#endif
+
+#ifndef _CRT_INSECURE_DEPRECATE_GLOBALS
+#define _CRT_INSECURE_DEPRECATE_GLOBALS(_Replacement)
+#endif
+
+#ifndef _CRT_MANAGED_HEAP_DEPRECATE
+#define _CRT_MANAGED_HEAP_DEPRECATE
+#endif
+
+#ifndef _CRT_OBSOLETE
+#define _CRT_OBSOLETE(_NewItem)
+#endif
+
+/** Constants ****************************************************************/
+
+#define _ARGMAX 100
+
+#ifndef _TRUNCATE
+#define _TRUNCATE ((size_t)-1)
+#endif
+
+#define __STDC_SECURE_LIB__ 200411L
+#define __GOT_SECURE_LIB__ __STDC_SECURE_LIB__
+#define _SECURECRT_FILL_BUFFER_PATTERN 0xFD
+
+
+
+/** Type definitions *********************************************************/
+
+#ifdef __cplusplus
+extern "C" {
+#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
+
+#ifndef _INTPTR_T_DEFINED
+#define _INTPTR_T_DEFINED
+#ifndef __intptr_t_defined
+#define __intptr_t_defined
+#undef intptr_t
+#ifdef _WIN64
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+  typedef int intptr_t __attribute__ ((mode (DI)));
+#else
+  typedef __int64 intptr_t;
+#endif
+#else
+  typedef int intptr_t;
+#endif
+#endif
+#endif
+
+#ifndef _UINTPTR_T_DEFINED
+#define _UINTPTR_T_DEFINED
+#ifndef __uintptr_t_defined
+#define __uintptr_t_defined
+#undef uintptr_t
+#ifdef _WIN64
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+  typedef unsigned int uintptr_t __attribute__ ((mode (DI)));
+#else
+  typedef unsigned __int64 uintptr_t;
+#endif
+#else
+  typedef unsigned int uintptr_t;
+#endif
+#endif
+#endif
+
+#ifndef _PTRDIFF_T_DEFINED
+#define _PTRDIFF_T_DEFINED
+#ifndef _PTRDIFF_T_
+#undef ptrdiff_t
+#ifdef _WIN64
+#if defined(__GNUC__) && defined(__STRICT_ANSI__)
+  typedef int ptrdiff_t __attribute__ ((mode (DI)));
+#else
+  typedef __int64 ptrdiff_t;
+#endif
+#else
+  typedef int ptrdiff_t;
+#endif
+#endif
+#endif
+
+#ifndef _WCHAR_T_DEFINED
+#define _WCHAR_T_DEFINED
+#ifndef __cplusplus
+  typedef unsigned short wchar_t;
+#endif
+#endif
+
+#ifndef _WCTYPE_T_DEFINED
+#define _WCTYPE_T_DEFINED
+  typedef unsigned short wint_t;
+  typedef unsigned short wctype_t;
+#endif
+
+#ifndef _ERRCODE_DEFINED
+#define _ERRCODE_DEFINED
+  typedef int errcode;
+  typedef int errno_t;
+#endif
+
+#ifndef _TIME32_T_DEFINED
+#define _TIME32_T_DEFINED
+  typedef long __time32_t;
+#endif
+
+#ifndef _TIME64_T_DEFINED
+#define _TIME64_T_DEFINED
+#if _INTEGRAL_MAX_BITS >= 64
+  typedef __int64 __time64_t;
+#endif
+#endif
+
+#ifndef _TIME_T_DEFINED
+#define _TIME_T_DEFINED
+#ifdef _USE_32BIT_TIME_T
+  typedef __time32_t time_t;
+#else
+  typedef __time64_t time_t;
+#endif
+#endif
+
+  struct threadlocaleinfostruct;
+  typedef struct threadlocaleinfostruct *pthreadlocinfo;
+
+  struct threadmbcinfostruct;
+  typedef struct threadmbcinfostruct *pthreadmbcinfo;
+
+  struct __lc_time_data;
+
+  typedef struct localeinfo_struct {
+    pthreadlocinfo locinfo;
+    pthreadmbcinfo mbcinfo;
+  } _locale_tstruct,*_locale_t;
+
+#ifndef _TAGLC_ID_DEFINED
+#define _TAGLC_ID_DEFINED
+  typedef struct tagLC_ID {
+    unsigned short wLanguage;
+    unsigned short wCountry;
+    unsigned short wCodePage;
+  } LC_ID,*LPLC_ID;
+#endif
+
+#ifndef _THREADLOCALEINFO
+#define _THREADLOCALEINFO
+  typedef struct threadlocaleinfostruct {
+    int refcount;
+    unsigned int lc_codepage;
+    unsigned int lc_collate_cp;
+    unsigned long lc_handle[6];
+    LC_ID lc_id[6];
+    struct {
+      char *locale;
+      wchar_t *wlocale;
+      int *refcount;
+      int *wrefcount;
+    } lc_category[6];
+    int lc_clike;
+    int mb_cur_max;
+    int *lconv_intl_refcount;
+    int *lconv_num_refcount;
+    int *lconv_mon_refcount;
+    struct lconv *lconv;
+    int *ctype1_refcount;
+    unsigned short *ctype1;
+    const unsigned short *pctype;
+    const unsigned char *pclmap;
+    const unsigned char *pcumap;
+    struct __lc_time_data *lc_time_curr;
+  } threadlocinfo;
+#endif
+
+
+#ifdef __cplusplus
+}
+#endif
+
+#pragma pack(pop)
+
+#endif /* !_INC_CRTDEFS */
index 45b6409..4c899ac 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_CTYPE
 #define _INC_CTYPE
 
 #ifndef _INC_CTYPE
 #define _INC_CTYPE
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
@@ -17,69 +17,36 @@ extern "C" {
 #endif
 
 #ifndef _CRT_CTYPEDATA_DEFINED
 #endif
 
 #ifndef _CRT_CTYPEDATA_DEFINED
-#define _CRT_CTYPEDATA_DEFINED
-#ifndef _CTYPE_DISABLE_MACROS
-
-#ifndef __PCTYPE_FUNC
-#define __PCTYPE_FUNC __pctype_func()
-#ifdef _MSVCRT_
-#define __pctype_func()        (_pctype)
-#else
-#define __pctype_func()        (*_imp___pctype)
-#endif
-#endif
-
-#ifndef _pctype
-#ifdef _MSVCRT_
-  extern const unsigned short *_pctype;
-#else
-  extern const unsigned short **_imp___pctype;
-#define _pctype (*_imp___pctype)
-#endif
-#endif
-
-#endif
-#endif
+# define _CRT_CTYPEDATA_DEFINED
+# ifndef _CTYPE_DISABLE_MACROS
+#  ifndef __PCTYPE_FUNC
+#   ifdef _DLL
+#    define __PCTYPE_FUNC __pctype_func()
+#   else
+#    define __PCTYPE_FUNC _pctype
+#   endif
+#  endif /* !__PCTYPE_FUNC */
+  _CRTIMP const unsigned short * __cdecl __pctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern const unsigned short *_pctype);
+#  else
+#   define _pctype (__pctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_CTYPEDATA_DEFINED */
 
 #ifndef _CRT_WCTYPEDATA_DEFINED
 #define _CRT_WCTYPEDATA_DEFINED
 
 #ifndef _CRT_WCTYPEDATA_DEFINED
 #define _CRT_WCTYPEDATA_DEFINED
-#ifndef _CTYPE_DISABLE_MACROS
-#ifndef _wctype
-#ifdef _MSVCRT_
-  extern unsigned short *_wctype;
-#else
-  extern unsigned short **_imp___wctype;
-#define _wctype (*_imp___wctype)
-#endif
-#endif
-#ifdef _MSVCRT_
-#define __pwctype_func() (_pwctype)
-#ifndef _pwctype
-  extern const unsigned short *_pwctype;
-#endif
-#else
-#define __pwctype_func() (*_imp___pwctype)
-#ifndef _pwctype
-  extern const unsigned short **_imp___pwctype;
-#define _pwctype (*_imp___pwctype)
-#endif
-#endif
-#endif
-#endif
-
-  /* CRT stuff */
-#if 1
-  extern const unsigned char __newclmap[];
-  extern const unsigned char __newcumap[];
-  extern pthreadlocinfo __ptlocinfo;
-  extern pthreadmbcinfo __ptmbcinfo;
-  extern int __globallocalestatus;
-  extern int __locale_changed;
-  extern struct threadlocaleinfostruct __initiallocinfo;
-  extern _locale_tstruct __initiallocalestructinfo;
-  pthreadlocinfo __cdecl __updatetlocinfo(void);
-  pthreadmbcinfo __cdecl __updatetmbcinfo(void);
-#endif
+# ifndef _CTYPE_DISABLE_MACROS
+  _CRTDATA(extern unsigned short *_wctype);
+  _CRTIMP const wctype_t * __cdecl __pwctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern const wctype_t *_pwctype);
+#  else
+#   define _pwctype (__pwctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_WCTYPEDATA_DEFINED */
 
 #define _UPPER 0x1
 #define _LOWER 0x2
 
 #define _UPPER 0x1
 #define _LOWER 0x2
@@ -96,7 +63,6 @@ extern "C" {
 
 #ifndef _CTYPE_DEFINED
 #define _CTYPE_DEFINED
 
 #ifndef _CTYPE_DEFINED
 #define _CTYPE_DEFINED
-
   _CRTIMP int __cdecl _isctype(int _C,int _Type);
   _CRTIMP int __cdecl _isctype_l(int _C,int _Type,_locale_t _Locale);
   _CRTIMP int __cdecl isalpha(int _C);
   _CRTIMP int __cdecl _isctype(int _C,int _Type);
   _CRTIMP int __cdecl _isctype_l(int _C,int _Type,_locale_t _Locale);
   _CRTIMP int __cdecl isalpha(int _C);
@@ -131,51 +97,49 @@ extern "C" {
   _CRTIMP int __cdecl __toascii(int _C);
   _CRTIMP int __cdecl __iscsymf(int _C);
   _CRTIMP int __cdecl __iscsym(int _C);
   _CRTIMP int __cdecl __toascii(int _C);
   _CRTIMP int __cdecl __iscsymf(int _C);
   _CRTIMP int __cdecl __iscsym(int _C);
-
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
 int __cdecl isblank(int _C);
 #endif
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
 int __cdecl isblank(int _C);
 #endif
-#endif
+#endif /* !_CTYPE_DEFINED */
 
 #ifndef _WCTYPE_DEFINED
 #define _WCTYPE_DEFINED
 
 #ifndef _WCTYPE_DEFINED
 #define _WCTYPE_DEFINED
-
-  int __cdecl iswalpha(wint_t _C);
+  _CRTIMP int __cdecl iswalpha(wint_t _C);
   _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswupper(wint_t _C);
+  _CRTIMP int __cdecl iswupper(wint_t _C);
   _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswlower(wint_t _C);
+  _CRTIMP int __cdecl iswlower(wint_t _C);
   _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswdigit(wint_t _C);
+  _CRTIMP int __cdecl iswdigit(wint_t _C);
   _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswxdigit(wint_t _C);
+  _CRTIMP int __cdecl iswxdigit(wint_t _C);
   _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswspace(wint_t _C);
+  _CRTIMP int __cdecl iswspace(wint_t _C);
   _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswpunct(wint_t _C);
+  _CRTIMP int __cdecl iswpunct(wint_t _C);
   _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswalnum(wint_t _C);
+  _CRTIMP int __cdecl iswalnum(wint_t _C);
   _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswprint(wint_t _C);
+  _CRTIMP int __cdecl iswprint(wint_t _C);
   _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswgraph(wint_t _C);
+  _CRTIMP int __cdecl iswgraph(wint_t _C);
   _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswcntrl(wint_t _C);
+  _CRTIMP int __cdecl iswcntrl(wint_t _C);
   _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswascii(wint_t _C);
-  int __cdecl isleadbyte(int _C);
+  _CRTIMP int __cdecl iswascii(wint_t _C);
+  _CRTIMP int __cdecl isleadbyte(int _C);
   _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
   _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
-  wint_t __cdecl towupper(wint_t _C);
+  _CRTIMP wint_t __cdecl towupper(wint_t _C);
   _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
   _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
-  wint_t __cdecl towlower(wint_t _C);
+  _CRTIMP wint_t __cdecl towlower(wint_t _C);
   _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
   _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswctype(wint_t _C,wctype_t _Type);
+  _CRTIMP int __cdecl iswctype(wint_t _C,wctype_t _Type);
   _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsymf(wint_t _C);
   _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsym(wint_t _C);
   _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsymf(wint_t _C);
   _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsym(wint_t _C);
   _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
-  int __cdecl is_wctype(wint_t _C,wctype_t _Type);
+  _CRTIMP int __cdecl is_wctype(wint_t _C,wctype_t _Type);
 
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
 int __cdecl iswblank(wint_t _C);
 
 #if (defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || !defined (NO_OLDNAMES)
 int __cdecl iswblank(wint_t _C);
@@ -261,12 +225,12 @@ int __cdecl iswblank(wint_t _C);
 #define _iswcsym_l(_c,_p) (_iswalnum_l(_c,_p) || ((_c)=='_'))
 #endif
 
 #define _iswcsym_l(_c,_p) (_iswalnum_l(_c,_p) || ((_c)=='_'))
 #endif
 
-#ifndef        NO_OLDNAMES
+#ifndef NO_OLDNAMES
 #ifndef _CTYPE_DEFINED
 #ifndef _CTYPE_DEFINED
-  int __cdecl isascii(int _C);
-  int __cdecl toascii(int _C);
-  int __cdecl iscsymf(int _C);
-  int __cdecl iscsym(int _C);
+  _CRT_NONSTDC_DEPRECATE(__isascii) _CRTIMP int __cdecl isascii(int _C);
+  _CRT_NONSTDC_DEPRECATE(__toascii) _CRTIMP int __cdecl toascii(int _C);
+  _CRT_NONSTDC_DEPRECATE(__iscsymf) _CRTIMP int __cdecl iscsymf(int _C);
+  _CRT_NONSTDC_DEPRECATE(__iscsym) _CRTIMP int __cdecl iscsym(int _C);
 #else
 #define isascii __isascii
 #define toascii __toascii
 #else
 #define isascii __isascii
 #define toascii __toascii
@@ -278,4 +242,5 @@ int __cdecl iswblank(wint_t _C);
 #ifdef __cplusplus
 }
 #endif
 #ifdef __cplusplus
 }
 #endif
-#endif
+
+#endif /* !_INC_CTYPE */
index 99ce69d..f64ceba 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_DIRECT
 #define _INC_DIRECT
 
 #ifndef _INC_DIRECT
 #define _INC_DIRECT
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
index cd31f59..57cd7a4 100644 (file)
@@ -3,8 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-/* All the headers include this file. */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef        __STRICT_ANSI__
 
 
 #ifndef        __STRICT_ANSI__
 
index b95dc73..3b3ac7d 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_DOS
 #define _INC_DOS
 
 #ifndef _INC_DOS
 #define _INC_DOS
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
 #include <io.h>
 
 #pragma pack(push,_CRT_PACKING)
@@ -39,8 +39,8 @@ extern "C" {
 #endif
 
 #if (defined(_X86_) && !defined(__x86_64))
 #endif
 
 #if (defined(_X86_) && !defined(__x86_64))
-//  void __cdecl _disable(void);
-//  void __cdecl _enable(void);
+  void __cdecl _disable(void);
+  void __cdecl _enable(void);
 #endif
 
 #ifndef        NO_OLDNAMES
 #endif
 
 #ifndef        NO_OLDNAMES
index 30819bf..5617ffd 100644 (file)
@@ -14,7 +14,7 @@
 #include <emmintrin.h>
 #include <assert.h>
 #include <fvec.h>
 #include <emmintrin.h>
 #include <assert.h>
 #include <fvec.h>
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index 0feb2dd..3c7725a 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _EH_H_
 #define _EH_H_
 
 #ifndef _EH_H_
 #define _EH_H_
index c2df015..944b3ad 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_ERRNO
 #define _INC_ERRNO
 
 #ifndef _INC_ERRNO
 #define _INC_ERRNO
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
index 64893e3..8a7badb 100644 (file)
-/*
- * excpt.h
+/**
  * This file has no copyright assigned and is placed in the Public Domain.
  * This file has no copyright assigned and is placed in the Public Domain.
- * This file is a part of the mingw-runtime package.
- * No warranty is given; refer to the file DISCLAIMER within the package.
- *
- * Support for operating system level structured exception handling.
- *
- * NOTE: This is very preliminary stuff. I am also pretty sure it is
- *       completely Intel specific.
- *
+ * This file is part of the w64 mingw-runtime package.
+ * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  */
+#ifndef _INC_EXCPT
+#define _INC_EXCPT
 
 
-#ifndef        _EXCPT_H_
-#define        _EXCPT_H_
+#include <crtdefs.h>
 
 
-/* All the headers include this file. */
-#include <_mingw.h>
+#pragma pack(push,_CRT_PACKING)
 
 
-/*
- * NOTE: The constants structs and typedefs below should be defined in the
- *       Win32 API headers.
- */
-#define EXCEPTION_EXECUTE_HANDLER       1
-#define EXCEPTION_CONTINUE_SEARCH       0
-#define EXCEPTION_CONTINUE_EXECUTION    -1
-
-#define        EH_NONCONTINUABLE       0x01
-#define        EH_UNWINDING            0x02
-#define        EH_EXIT_UNWIND          0x04
-#define        EH_STACK_INVALID        0x08
-#define        EH_NESTED_CALL          0x10
-
-#ifndef        RC_INVOKED
-
-typedef enum {
-       ExceptionContinueExecution,
-       ExceptionContinueSearch,
-       ExceptionNestedException,
-       ExceptionCollidedUnwind
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef enum _EXCEPTION_DISPOSITION
+{
+    ExceptionContinueExecution,
+    ExceptionContinueSearch,
+    ExceptionNestedException,
+    ExceptionCollidedUnwind,
 } EXCEPTION_DISPOSITION;
 
 } EXCEPTION_DISPOSITION;
 
+#if (defined(_X86_) && !defined(__x86_64))
+  struct _EXCEPTION_RECORD;
+  struct _CONTEXT;
 
 
-/*
- * End of stuff that should be in the Win32 API files.
- */
+  EXCEPTION_DISPOSITION __cdecl _except_handler(struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,void *_DispatcherContext);
+#elif defined(__ia64__)
 
 
+  typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
+  struct _EXCEPTION_RECORD;
+  struct _CONTEXT;
+  struct _DISPATCHER_CONTEXT;
 
 
-#ifdef __cplusplus
-extern "C" {
+  _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,unsigned __int64 _MemoryStackFp,unsigned __int64 _BackingStoreFp,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext,unsigned __int64 _GlobalPointer);
+#elif defined(__x86_64)
+
+  struct _EXCEPTION_RECORD;
+  struct _CONTEXT;
+  struct _DISPATCHER_CONTEXT;
+
+  _CRTIMP EXCEPTION_DISPOSITION __cdecl __C_specific_handler (struct _EXCEPTION_RECORD *_ExceptionRecord,void *_EstablisherFrame,struct _CONTEXT *_ContextRecord,struct _DISPATCHER_CONTEXT *_DispatcherContext);
 #endif
 
 #endif
 
-/*
- * The type of function that is expected as an exception handler to be
- * installed with __try1.
- */
-struct _CONTEXT;
-struct _EXCEPTION_RECORD;
-typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)
-               (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
-
-/*
- * This is not entirely necessary, but it is the structure installed by
- * the __try1 primitive below.
- */
-typedef struct _EXCEPTION_REGISTRATION
-{
-       struct _EXCEPTION_REGISTRATION* prev;
-       PEXCEPTION_HANDLER              handler;
-} EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
-
-/*
- * A macro which installs the supplied exception handler.
- * Push the pointer to the new handler onto the stack,
- * then push the pointer to the old registration structure (at fs:0)
- * onto the stack, then put a pointer to the new registration
- * structure (i.e. the current stack pointer) at fs:0.
- */
+#ifdef _MSC_VER // HACK!!!
+#define GetExceptionCode _exception_code
+#define exception_code _exception_code
+#define GetExceptionInformation (struct _EXCEPTION_POINTERS *)_exception_info
+#define exception_info (struct _EXCEPTION_POINTERS *)_exception_info
+#define AbnormalTermination _abnormal_termination
+#define abnormal_termination _abnormal_termination
+#endif
+
+  unsigned long __cdecl _exception_code(void);
+  void *__cdecl _exception_info(void);
+  int __cdecl _abnormal_termination(void);
+
+#define EXCEPTION_EXECUTE_HANDLER 1
+#define EXCEPTION_CONTINUE_SEARCH 0
+#define EXCEPTION_CONTINUE_EXECUTION -1
+
+#if 0
+  /* CRT stuff */
+  typedef void (__cdecl * _PHNDLR)(int);
+
+  struct _XCPT_ACTION {
+    unsigned long XcptNum;
+    int SigNum;
+    _PHNDLR XcptAction;
+  };
+
+  extern struct _XCPT_ACTION _XcptActTab[];
+  extern int _XcptActTabCount;
+  extern int _XcptActTabSize;
+  extern int _First_FPE_Indx;
+  extern int _Num_FPE;
+
+  int __cdecl __CppXcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
+  int __cdecl _XcptFilter(unsigned long _ExceptionNum,struct _EXCEPTION_POINTERS * _ExceptionPtr);
+
+  /*
+  * The type of function that is expected as an exception handler to be
+  * installed with _try1.
+  */
+  typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+
+#ifndef HAVE_NO_SEH
+  /*
+  * This is not entirely necessary, but it is the structure installed by
+  * the _try1 primitive below.
+  */
+  typedef struct _EXCEPTION_REGISTRATION {
+    struct _EXCEPTION_REGISTRATION *prev;
+    EXCEPTION_DISPOSITION (*handler)(struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+  } EXCEPTION_REGISTRATION, *PEXCEPTION_REGISTRATION;
+
+  typedef EXCEPTION_REGISTRATION EXCEPTION_REGISTRATION_RECORD;
+  typedef PEXCEPTION_REGISTRATION PEXCEPTION_REGISTRATION_RECORD;
+#endif
+
+#if (defined(_X86_) && !defined(__x86_64))
 #define __try1(pHandler) \
 #define __try1(pHandler) \
-       __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
-
-/*
- * A macro which (despite its name) *removes* an installed
- * exception handler. Should be used only in conjunction with the above
- * install routine __try1.
- * Move the pointer to the old reg. struct (at the current stack
- * position) to fs:0, replacing the pointer we installed above,
- * then add 8 to the stack pointer to get rid of the space we
- * used when we pushed on our new reg. struct above. Notice that
- * the stack must be in the exact state at this point that it was
- * after we did __try1 or this will smash things.
- */
+  __asm__ ("pushl %0;pushl %%fs:0;movl %%esp,%%fs:0;" : : "g" (pHandler));
+
 #define        __except1       \
 #define        __except1       \
-       __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
-        : : : "%eax");
+  __asm__ ("movl (%%esp),%%eax;movl %%eax,%%fs:0;addl $8,%%esp;" \
+  : : : "%eax");
+#elif defined(__x86_64)
+#define __try1(pHandler) \
+  __asm__ ("pushq %0;pushq %%gs:0;movq %%rsp,%%gs:0;" : : "g" (pHandler));
 
 
-#ifdef __cplusplus
-}
+#define        __except1       \
+  __asm__ ("movq (%%rsp),%%rax;movq %%rax,%%gs:0;addq $16,%%rsp;" \
+  : : : "%rax");
+#else
+#define __try1(pHandler)
+#define __except1
 #endif
 
 #endif
 
-#endif /* Not RC_INVOKED */
+#endif // 0
+
+#ifdef __cplusplus
+}
+#endif
 
 
-#endif /* _EXCPT_H_ not defined */
+#pragma pack(pop)
+#endif
index a231484..fc3b00c 100644 (file)
@@ -3,9 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
-
-#include <io.h>
+#include <crtdefs.h>
 
 #ifndef _INC_FCNTL
 #define _INC_FCNTL
 
 #ifndef _INC_FCNTL
 #define _INC_FCNTL
@@ -36,7 +34,6 @@
 #define O_RDONLY _O_RDONLY
 #define O_WRONLY _O_WRONLY
 #define O_RDWR _O_RDWR
 #define O_RDONLY _O_RDONLY
 #define O_WRONLY _O_WRONLY
 #define O_RDWR _O_RDWR
-#define O_ACCMODE _O_ACCMODE
 #define O_APPEND _O_APPEND
 #define O_CREAT _O_CREAT
 #define O_TRUNC _O_TRUNC
 #define O_APPEND _O_APPEND
 #define O_CREAT _O_CREAT
 #define O_TRUNC _O_TRUNC
@@ -48,5 +45,6 @@
 #define O_NOINHERIT _O_NOINHERIT
 #define O_SEQUENTIAL _O_SEQUENTIAL
 #define O_RANDOM _O_RANDOM
 #define O_NOINHERIT _O_NOINHERIT
 #define O_SEQUENTIAL _O_SEQUENTIAL
 #define O_RANDOM _O_RANDOM
+#define O_ACCMODE _O_ACCMODE
 #endif
 #endif
 #endif
 #endif
index e8bf302..e0c4704 100644 (file)
@@ -21,8 +21,7 @@
 #ifndef _MINGW_FLOAT_H_
 #define _MINGW_FLOAT_H_
 
 #ifndef _MINGW_FLOAT_H_
 #define _MINGW_FLOAT_H_
 
-/* All the headers include this file. */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 /*
  * Functions and definitions for controlling the FPU.
 
 /*
  * Functions and definitions for controlling the FPU.
@@ -99,12 +98,12 @@ extern "C" {
 /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
  * i.e. change the bits in unMask to have the values they have in unNew,
  * leaving other bits unchanged. */
 /* Set the FPU control word as cw = (cw & ~unMask) | (unNew & unMask),
  * i.e. change the bits in unMask to have the values they have in unNew,
  * leaving other bits unchanged. */
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _controlfp (unsigned int unNew, unsigned int unMask);
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _control87 (unsigned int unNew, unsigned int unMask);
+_CRTIMP unsigned int __cdecl __attribute__ ((__nothrow__)) _controlfp (unsigned int unNew, unsigned int unMask);
+_CRTIMP unsigned int __cdecl __attribute__ ((__nothrow__)) _control87 (unsigned int unNew, unsigned int unMask);
 
 
 
 
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _clearfp (void);  /* Clear the FPU status word */
-_CRTIMP unsigned int __cdecl __MINGW_NOTHROW _statusfp (void); /* Report the FPU status word */
+_CRTIMP unsigned int __cdecl __attribute__ ((__nothrow__)) _clearfp (void);    /* Clear the FPU status word */
+_CRTIMP unsigned int __cdecl __attribute__ ((__nothrow__)) _statusfp (void);   /* Report the FPU status word */
 #define                _clear87        _clearfp
 #define                _status87       _statusfp
 
 #define                _clear87        _clearfp
 #define                _status87       _statusfp
 
@@ -118,11 +117,11 @@ _CRTIMP unsigned int __cdecl __MINGW_NOTHROW _statusfp (void);    /* Report the FPU
    per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when
    building your application.   
 */
    per fninit. To use the MSVCRT.dll _fpreset, include CRT_fp8.o when
    building your application.   
 */
-void __cdecl __MINGW_NOTHROW _fpreset (void);
-void __cdecl __MINGW_NOTHROW fpreset (void);
+void __cdecl __attribute__ ((__nothrow__)) _fpreset (void);
+void __cdecl __attribute__ ((__nothrow__)) fpreset (void);
 
 /* Global 'variable' for the current floating point error code. */
 
 /* Global 'variable' for the current floating point error code. */
-_CRTIMP int * __cdecl __MINGW_NOTHROW __fpecode(void);
+_CRTIMP int * __cdecl __attribute__ ((__nothrow__)) __fpecode(void);
 #define        _fpecode        (*(__fpecode()))
 
 /*
 #define        _fpecode        (*(__fpecode()))
 
 /*
@@ -130,15 +129,15 @@ _CRTIMP int * __cdecl __MINGW_NOTHROW __fpecode(void);
  * but they really belong in math.h.
  */
 
  * but they really belong in math.h.
  */
 
-_CRTIMP double __cdecl __MINGW_NOTHROW _chgsign        (double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _copysign (double, double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _logb (double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _nextafter (double, double);
-_CRTIMP double __cdecl __MINGW_NOTHROW _scalb (double, long);
+_CRTIMP double __cdecl __attribute__ ((__nothrow__)) _chgsign  (double);
+_CRTIMP double __cdecl __attribute__ ((__nothrow__)) _copysign (double, double);
+_CRTIMP double __cdecl __attribute__ ((__nothrow__)) _logb (double);
+_CRTIMP double __cdecl __attribute__ ((__nothrow__)) _nextafter (double, double);
+_CRTIMP double __cdecl __attribute__ ((__nothrow__)) _scalb (double, long);
 
 
-_CRTIMP int __cdecl __MINGW_NOTHROW _finite (double);
-_CRTIMP int __cdecl __MINGW_NOTHROW _fpclass (double);
-_CRTIMP int __cdecl __MINGW_NOTHROW _isnan (double);
+_CRTIMP int __cdecl __attribute__ ((__nothrow__)) _finite (double);
+_CRTIMP int __cdecl __attribute__ ((__nothrow__)) _fpclass (double);
+_CRTIMP int __cdecl __attribute__ ((__nothrow__)) _isnan (double);
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
index 67d9fb0..74afa77 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_FPIEEE
 #define _INC_FPIEEE
 
 #ifndef _INC_FPIEEE
 #define _INC_FPIEEE
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index d23fae6..a4c8886 100644 (file)
@@ -14,7 +14,7 @@
 #include <xmmintrin.h>
 #include <assert.h>
 #include <ivec.h>
 #include <xmmintrin.h>
 #include <assert.h>
 #include <ivec.h>
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #if defined(_ENABLE_VEC_DEBUG)
 #include <iostream>
 
 #if defined(_ENABLE_VEC_DEBUG)
 #include <iostream>
index 1a5b555..2bb3cde 100644 (file)
@@ -8,7 +8,7 @@
 #ifndef _INTTYPES_H_
 #define _INTTYPES_H_
 
 #ifndef _INTTYPES_H_
 #define _INTTYPES_H_
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <stdint.h>
 #define __need_wchar_t
 #include <stddef.h>
 #include <stdint.h>
 #define __need_wchar_t
 #include <stddef.h>
index 662397e..0accf13 100644 (file)
@@ -1,3 +1,4 @@
+
 /**
  * This file has no copyright assigned and is placed in the Public Domain.
  * This file is part of the w64 mingw-runtime package.
 /**
  * This file has no copyright assigned and is placed in the Public Domain.
  * This file is part of the w64 mingw-runtime package.
@@ -6,7 +7,7 @@
 #ifndef _IO_H_
 #define _IO_H_
 
 #ifndef _IO_H_
 #define _IO_H_
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <string.h>
 
 #pragma pack(push,_CRT_PACKING)
 #include <string.h>
 
 #pragma pack(push,_CRT_PACKING)
@@ -25,6 +26,15 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 
 #ifndef _FINDDATA_T_DEFINED
 
 
 #ifndef _FINDDATA_T_DEFINED
 
+  struct _finddata_t {
+    unsigned attrib;
+    time_t time_create;
+    time_t time_access;
+    time_t time_write;
+    _fsize_t size;
+    char name[260];
+  };
+
   struct _finddata32_t {
     unsigned attrib;
     __time32_t time_create;
   struct _finddata32_t {
     unsigned attrib;
     __time32_t time_create;
@@ -34,17 +44,17 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     char name[260];
   };
 
     char name[260];
   };
 
-  struct _finddata_t {
+#if _INTEGRAL_MAX_BITS >= 64
+
+  struct _finddatai64_t {
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
-    _fsize_t size;
+    __int64 size;
     char name[260];
   };
 
     char name[260];
   };
 
-/*#if _INTEGRAL_MAX_BITS >= 64*/
-
   struct _finddata32i64_t {
     unsigned attrib;
     __time32_t time_create;
   struct _finddata32i64_t {
     unsigned attrib;
     __time32_t time_create;
@@ -71,36 +81,22 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     __int64 size;
     char name[260];
   };
     __int64 size;
     char name[260];
   };
+#endif /* _INTEGRAL_MAX_BITS >= 64 */
 
 
-  struct _finddatai64_t {
+#define _FINDDATA_T_DEFINED
+#endif
+
+#ifndef _WFINDDATA_T_DEFINED
+
+  struct _wfinddata_t {
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
-    __int64 size;
-    char name[260];
+    _fsize_t size;
+    wchar_t name[260];
   };
 
   };
 
-/* #endif */
-
-#ifdef _WIN64
-//#define _findfirst64i32 _findfirst
-//#define _findnext64i32 _findnext
-//#define _findfirsti64 _findfirst64
-//#define _findnexti64 _findnext64
-
-#else /* !_WIN64 */
-//#define _findfirst32 _findfirst
-//#define _findnext32 _findnext
-//#define _findfirst32i64 _findfirsti64
-//#define _findnext32i64 _findnexti64
-#endif /* !_WIN64 */
-
-#define _FINDDATA_T_DEFINED
-#endif
-
-#ifndef _WFINDDATA_T_DEFINED
-
   struct _wfinddata32_t {
     unsigned attrib;
     __time32_t time_create;
   struct _wfinddata32_t {
     unsigned attrib;
     __time32_t time_create;
@@ -110,17 +106,17 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     wchar_t name[260];
   };
 
     wchar_t name[260];
   };
 
-  struct _wfinddata_t {
+#if _INTEGRAL_MAX_BITS >= 64
+
+  struct _wfinddatai64_t {
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
     unsigned attrib;
     time_t time_create;
     time_t time_access;
     time_t time_write;
-    _fsize_t size;
+    __int64 size;
     wchar_t name[260];
   };
 
     wchar_t name[260];
   };
 
-/* #if _INTEGRAL_MAX_BITS >= 64 */
-
   struct _wfinddata32i64_t {
     unsigned attrib;
     __time32_t time_create;
   struct _wfinddata32i64_t {
     unsigned attrib;
     __time32_t time_create;
@@ -147,17 +143,7 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     __int64 size;
     wchar_t name[260];
   };
     __int64 size;
     wchar_t name[260];
   };
-
-  struct _wfinddatai64_t {
-    unsigned attrib;
-    time_t time_create;
-    time_t time_access;
-    time_t time_write;
-    __int64 size;
-    wchar_t name[260];
-  };
-
-/* #endif */
+#endif
 
 #define _WFINDDATA_T_DEFINED
 #endif
 
 #define _WFINDDATA_T_DEFINED
 #endif
@@ -169,60 +155,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 #define _A_SUBDIR 0x10
 #define _A_ARCH 0x20
 
 #define _A_SUBDIR 0x10
 #define _A_ARCH 0x20
 
-#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
-
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int ssize_t __attribute__ ((mode (DI)));
-#else
-  typedef __int64 ssize_t;
-#endif
-#else
-  typedef int ssize_t;
-#endif
-#endif
-
-#ifndef _OFF_T_DEFINED
-#define _OFF_T_DEFINED
-#ifndef _OFF_T_
-#define _OFF_T_
-  typedef long _off_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
-  typedef long off_t;
-#endif
-#endif
-#endif
-
-#ifndef _OFF64_T_DEFINED
-#define _OFF64_T_DEFINED
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int _off64_t __attribute__ ((mode (DI)));
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
-  typedef int off64_t __attribute__ ((mode (DI)));
-#endif
-#else
-  typedef long long _off64_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
-  typedef long long off64_t;
-#endif
-#endif
-#endif
-
   /* Some defines for _access nAccessMode (MS doesn't define them, but
   * it doesn't seem to hurt to add them). */
 #define        F_OK    0       /* Check for file existence */
   /* Some defines for _access nAccessMode (MS doesn't define them, but
   * it doesn't seem to hurt to add them). */
 #define        F_OK    0       /* Check for file existence */
@@ -248,7 +180,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
   _CRTIMP int __cdecl _isatty(int _FileHandle);
   _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
   _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
   _CRTIMP int __cdecl _isatty(int _FileHandle);
   _CRTIMP int __cdecl _locking(int _FileHandle,int _LockMode,long _NumOfBytes);
   _CRTIMP long __cdecl _lseek(int _FileHandle,long _Offset,int _Origin);
-  _off64_t lseek64(int fd,_off64_t offset, int whence);
   _CRTIMP char *__cdecl _mktemp(char *_TemplateName);
   _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
   _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
   _CRTIMP char *__cdecl _mktemp(char *_TemplateName);
   _CRTIMP int __cdecl _pipe(int *_PtHandles,unsigned int _PipeSize,int _TextMode);
   _CRTIMP int __cdecl _read(int _FileHandle,void *_DstBuf,unsigned int _MaxCharCount);
@@ -271,11 +202,16 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle);
   _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP __int64 __cdecl _filelengthi64(int _FileHandle);
   _CRTIMP intptr_t __cdecl _findfirst32i64(const char *_Filename,struct _finddata32i64_t *_FindData);
+  _CRTIMP intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData);
   _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData);
   _CRTIMP intptr_t __cdecl _findfirst64(const char *_Filename,struct __finddata64_t *_FindData);
+  _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData);
+  _CRTIMP int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData);
+  _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData);
+  _CRTIMP __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin);
+  _CRTIMP __int64 __cdecl _telli64(int _FileHandle);
 #ifdef __cplusplus
 #include <string.h>
 #endif
 #ifdef __cplusplus
 #include <string.h>
 #endif
-  intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData);
   __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
   __CRT_INLINE intptr_t __cdecl _findfirst64i32(const char *_Filename,struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
@@ -288,9 +224,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
-  _CRTIMP int __cdecl _findnext32i64(intptr_t _FindHandle,struct _finddata32i64_t *_FindData);
-  _CRTIMP int __cdecl _findnext64(intptr_t _FindHandle,struct __finddata64_t *_FindData);
-  int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData);
   __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
   __CRT_INLINE int __cdecl _findnext64i32(intptr_t _FindHandle,struct _finddata64i32_t *_FindData)
   {
     struct __finddata64_t fd;
@@ -303,11 +236,9 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
     strncpy(_FindData->name,fd.name,260);
     return ret;
   }
-  __int64 __cdecl _lseeki64(int _FileHandle,__int64 _Offset,int _Origin);
-  __int64 __cdecl _telli64(int _FileHandle);
 #endif
 #endif
-#ifndef NO_OLDNAMES
 
 
+#ifndef NO_OLDNAMES
 #ifndef _UWIN
   int __cdecl chdir (const char *);
   char *__cdecl getcwd (char *, int);
 #ifndef _UWIN
   int __cdecl chdir (const char *);
   char *__cdecl getcwd (char *, int);
@@ -316,7 +247,6 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
   int __cdecl rmdir (const char*);
   int __cdecl chmod (const char *, int);
 #endif /* _UWIN */
   int __cdecl rmdir (const char*);
   int __cdecl chmod (const char *, int);
 #endif /* _UWIN */
-
 #endif /* Not NO_OLDNAMES */
 
   _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode);
 #endif /* Not NO_OLDNAMES */
 
   _CRTIMP errno_t __cdecl _sopen_s(int *_FileHandle,const char *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode);
@@ -359,7 +289,7 @@ _CRTIMP char* __cdecl _getcwd (char*, int);
   extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
 #endif
 
   extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
 #endif
 
-#endif
+#endif /* !_WIO_DEFINED */
 
   int __cdecl __lock_fhandle(int _Filehandle);
   void __cdecl _unlock_fhandle(int _Filehandle);
 
   int __cdecl __lock_fhandle(int _Filehandle);
   void __cdecl _unlock_fhandle(int _Filehandle);
index db89e1e..c335d75 100644 (file)
@@ -14,7 +14,7 @@
 #define _LIBGEN_H_
 
 /* All the headers include this file. */
 #define _LIBGEN_H_
 
 /* All the headers include this file. */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
index fafb04a..431f364 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_LIMITS
 #define _INC_LIMITS
 
 #ifndef _INC_LIMITS
 #define _INC_LIMITS
index 686aa9b..d7ba107 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_LOCALE
 #define _INC_LOCALE
 
 #ifndef _INC_LOCALE
 #define _INC_LOCALE
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index 6098b26..e876d61 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _MALLOC_H_
 #define _MALLOC_H_
 
 #ifndef _MALLOC_H_
 #define _MALLOC_H_
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
@@ -25,7 +25,7 @@ extern "C" {
 #endif
 
 #ifndef _STATIC_ASSERT
 #endif
 
 #ifndef _STATIC_ASSERT
-#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)?1:-1]
+#define _STATIC_ASSERT(expr) typedef char __static_assert_t[(expr)]
 #endif
 
 /* Return codes for _heapwalk()  */
 #endif
 
 /* Return codes for _heapwalk()  */
index fd8a3b3..da6756f 100644 (file)
@@ -3,14 +3,10 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#ifndef _MATH_H_
-#define _MATH_H_
+#ifndef _INC_MATH
+#define _INC_MATH
 
 
-#if __GNUC__ >= 3
-#pragma GCC system_header
-#endif
-
-#include <_mingw.h>
+#include <crtdefs.h>
 
 struct exception;
 
 
 struct exception;
 
@@ -48,14 +44,7 @@ extern "C" {
 #define EDOM 33
 #define ERANGE 34
 
 #define EDOM 33
 #define ERANGE 34
 
-#ifndef _HUGE
-#ifdef _MSVCRT_
-  extern double *_HUGE;
-#else
-  extern double *_imp___HUGE;
-#define _HUGE  (*_imp___HUGE)
-#endif
-#endif
+  _CRTIMP extern double _HUGE;
 
 #define HUGE_VAL _HUGE
 
 
 #define HUGE_VAL _HUGE
 
@@ -76,6 +65,7 @@ extern "C" {
   double __cdecl cos(double _X);
   double __cdecl cosh(double _X);
   double __cdecl exp(double _X);
   double __cdecl cos(double _X);
   double __cdecl cosh(double _X);
   double __cdecl exp(double _X);
+  double expm1(double _X);
   double __cdecl fabs(double _X);
   double __cdecl fmod(double _X,double _Y);
   double __cdecl log(double _X);
   double __cdecl fabs(double _X);
   double __cdecl fmod(double _X,double _Y);
   double __cdecl log(double _X);
@@ -93,19 +83,19 @@ extern "C" {
 #endif
 
   _CRTIMP double __cdecl _cabs(struct _complex _ComplexA);
 #endif
 
   _CRTIMP double __cdecl _cabs(struct _complex _ComplexA);
-  double __cdecl ceil(double _X);
-  double __cdecl floor(double _X);
-  double __cdecl frexp(double _X,int *_Y);
-  double __cdecl _hypot(double _X,double _Y);
+  _CRTIMP double __cdecl ceil(double _X);
+  _CRTIMP double __cdecl floor(double _X);
+  _CRTIMP double __cdecl frexp(double _X,int *_Y);
+  _CRTIMP double __cdecl _hypot(double _X,double _Y);
   _CRTIMP double __cdecl _j0(double _X);
   _CRTIMP double __cdecl _j1(double _X);
   _CRTIMP double __cdecl _jn(int _X,double _Y);
   _CRTIMP double __cdecl _j0(double _X);
   _CRTIMP double __cdecl _j1(double _X);
   _CRTIMP double __cdecl _jn(int _X,double _Y);
-  double __cdecl ldexp(double _X,int _Y);
+  _CRTIMP double __cdecl ldexp(double _X,int _Y);
 #ifndef _CRT_MATHERR_DEFINED
 #define _CRT_MATHERR_DEFINED
   int __cdecl _matherr(struct _exception *_Except);
 #endif
 #ifndef _CRT_MATHERR_DEFINED
 #define _CRT_MATHERR_DEFINED
   int __cdecl _matherr(struct _exception *_Except);
 #endif
-  double __cdecl modf(double _X,double *_Y);
+  _CRTIMP double __cdecl modf(double _X,double *_Y);
   _CRTIMP double __cdecl _y0(double _X);
   _CRTIMP double __cdecl _y1(double _X);
   _CRTIMP double __cdecl _yn(int _X,double _Y);
   _CRTIMP double __cdecl _y0(double _X);
   _CRTIMP double __cdecl _y1(double _X);
   _CRTIMP double __cdecl _yn(int _X,double _Y);
@@ -130,6 +120,7 @@ extern "C" {
    float __cdecl sinhf(float _X);
    float __cdecl tanhf(float _X);
    float __cdecl expf(float _X);
    float __cdecl sinhf(float _X);
    float __cdecl tanhf(float _X);
    float __cdecl expf(float _X);
+   float expm1f(float _X);
    float __cdecl logf(float _X);
    float __cdecl log10f(float _X);
    float __cdecl modff(float _X,float *_Y);
    float __cdecl logf(float _X);
    float __cdecl log10f(float _X);
    float __cdecl modff(float _X,float *_Y);
@@ -421,6 +412,7 @@ extern "C" {
 
   extern long double __cdecl powl (long double, long double);
   extern long double __cdecl expl(long double);
 
   extern long double __cdecl powl (long double, long double);
   extern long double __cdecl expl(long double);
+  extern long double expm1l(long double);
   extern long double __cdecl coshl(long double);
   extern long double __cdecl fabsl (long double);
   extern long double __cdecl acosl(long double);
   extern long double __cdecl coshl(long double);
   extern long double __cdecl fabsl (long double);
   extern long double __cdecl acosl(long double);
@@ -764,5 +756,4 @@ __fp_unordered_compare (long double x, long double y){
 
 #endif
 
 
 #endif
 
-#endif /* End _MATH_H_ */
-
+#endif /* !_INC_MATH */
index 39b3265..f39c66f 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_MBCTYPE
 #define _INC_MBCTYPE
 
 #ifndef _INC_MBCTYPE
 #define _INC_MBCTYPE
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <ctype.h>
 
 #ifdef __cplusplus
 #include <ctype.h>
 
 #ifdef __cplusplus
@@ -14,16 +14,29 @@ extern "C" {
 #endif
 
   /* CRT stuff */
 #endif
 
   /* CRT stuff */
-#if defined(_M_CEE_PURE)
+#if 1
+#if defined (_DLL) && defined (_M_IX86)
   /* Retained for compatibility with VC++ 5.0 and earlier versions */
   _CRTIMP unsigned char * __cdecl __p__mbctype(void);
   _CRTIMP unsigned char * __cdecl __p__mbcasemap(void);
   /* Retained for compatibility with VC++ 5.0 and earlier versions */
   _CRTIMP unsigned char * __cdecl __p__mbctype(void);
   _CRTIMP unsigned char * __cdecl __p__mbcasemap(void);
-  #define _mbctype (__p__mbctype())
-  #define _mbcasemap (__p__mbcasemap())
+#endif  /* defined (_DLL) && defined (_M_IX86) */
+#endif
+#ifndef _mbctype
+#ifdef _MSVCRT_
+  extern unsigned char _mbctype[257];
 #else
 #else
-  _CRTIMP extern unsigned char _mbctype[];
-  _CRTIMP extern unsigned char _mbcasemap[];
-#endif // defined(_M_CEE_PURE)
+#define _mbctype       (*_imp___mbctype)
+  extern unsigned char **_imp___mbctype;
+#endif
+#endif
+#ifndef _mbcasemap
+#ifdef _MSVCRT_
+  extern unsigned char *_mbcasemap;
+#else
+#define _mbcasemap     (*_imp___mbcasemap)
+  extern unsigned char **_imp___mbcasemap;
+#endif
+#endif
 
   /* CRT stuff */
 #if 1
 
   /* CRT stuff */
 #if 1
index d5363b1..951bfad 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_MBSTRING
 #define _INC_MBSTRING
 
 #ifndef _INC_MBSTRING
 #define _INC_MBSTRING
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index 90d88ae..b073295 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_MEMORY
 #define _INC_MEMORY
 
 #ifndef _INC_MEMORY
 #define _INC_MEMORY
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
index 67e2a0c..61d5862 100644 (file)
@@ -10,7 +10,7 @@
 
 #include <new>
 
 
 #include <new>
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma push_macro("new")
 #undef new
 
 #pragma push_macro("new")
 #undef new
index dd273ed..a1c001d 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_PROCESS
 #define _INC_PROCESS
 
 #ifndef _INC_PROCESS
 #define _INC_PROCESS
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 /* Includes a definition of _pid_t and pid_t */
 #include <sys/types.h>
 
 /* Includes a definition of _pid_t and pid_t */
 #include <sys/types.h>
index 17247a7..9b3c48a 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_RTCAPI
 #define _INC_RTCAPI
 
 #ifndef _INC_RTCAPI
 #define _INC_RTCAPI
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index c3be3cf..a585448 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_SEARCH
 #define _INC_SEARCH
 
 #ifndef _INC_SEARCH
 #define _INC_SEARCH
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <stddef.h>
 
 #ifdef __cplusplus
 #include <stddef.h>
 
 #ifdef __cplusplus
index 8caa577..3f56a52 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_SETJMP
 #define _INC_SETJMP
 
 #ifndef _INC_SETJMP
 #define _INC_SETJMP
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
@@ -130,28 +130,7 @@ extern "C" {
 #define _JMP_BUF_DEFINED
 #endif
 
 #define _JMP_BUF_DEFINED
 #endif
 
-__CRT_INLINE void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void)
-{
-#ifdef __GNUC__
-#ifdef __x86_64
-      __int64 *ret;
-      __asm__ __volatile__("leaq  16(%%rsp),%0\n"
-                            :"=r"(ret)
-                            :
-      );
-      return ret;
-#elif __i386__
-    __int32 *ret;
-      __asm__ __volatile__("lea  8(%esp),%0\n"
-                            :"=r"(ret)
-                            :
-      );
-      return ret;
-#endif
-#else
-#error Unsupported Compiler
-#endif
-}
+  void * __cdecl __attribute__ ((__nothrow__)) mingw_getsp(void);
 
 #ifdef USE_MINGW_SETJMP_TWO_ARGS
 #ifndef _INC_SETJMPEX
 
 #ifdef USE_MINGW_SETJMP_TWO_ARGS
 #ifndef _INC_SETJMPEX
index dd7eb60..358855f 100644 (file)
@@ -10,7 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#define _SH_COMPAT     0x00    /* Compatibility */
+#define _SH_COMPAT 0x00
 #define _SH_DENYRW 0x10
 #define _SH_DENYWR 0x20
 #define _SH_DENYRD 0x30
 #define _SH_DENYRW 0x10
 #define _SH_DENYWR 0x20
 #define _SH_DENYRD 0x30
index a518f6b..8a26997 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_SIGNAL
 #define _INC_SIGNAL
 
 #ifndef _INC_SIGNAL
 #define _INC_SIGNAL
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
index 162a3ba..02b6d7a 100644 (file)
@@ -4,7 +4,7 @@
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_STDDEF
 #define _INC_STDDEF
 
 #ifndef _INC_STDDEF
 #define _INC_STDDEF
@@ -140,11 +140,11 @@ _TYPE_wchar_t;
 #define ___int_ptrdiff_t_h
 #define _GCC_PTRDIFF_T
 #ifndef __PTRDIFF_TYPE__
 #define ___int_ptrdiff_t_h
 #define _GCC_PTRDIFF_T
 #ifndef __PTRDIFF_TYPE__
-# ifdef _WIN64
-  #define __PTRDIFF_TYPE__ long long int
-# else
-# #define __PTRDIFF_TYPE__ long int
-# endif  
+#ifdef _WIN64
+#define __PTRDIFF_TYPE__ long long int
+#else
+#define __PTRDIFF_TYPE__ long int
+#endif
 #endif
 #ifndef _PTRDIFF_T_DEFINED
 #define _PTRDIFF_T_DEFINED
 #endif
 #ifndef _PTRDIFF_T_DEFINED
 #define _PTRDIFF_T_DEFINED
@@ -208,11 +208,11 @@ typedef __PTRDIFF_TYPE__ ptrdiff_t;
 #define __size_t
 #endif
 #ifndef __SIZE_TYPE__
 #define __size_t
 #endif
 #ifndef __SIZE_TYPE__
-# ifdef _WIN64
-#  define __SIZE_TYPE__ long long unsigned int
-# else
-#  define __SIZE_TYPE__ long unsigned int
-# endif
+#ifdef _WIN64
+#define __SIZE_TYPE__ long long unsigned int
+#else
+#define __SIZE_TYPE__ long unsigned int
+#endif
 #endif
 #if !(defined (__GNUG__) && defined (size_t))
 typedef __SIZE_TYPE__ size_t;
 #endif
 #if !(defined (__GNUG__) && defined (size_t))
 typedef __SIZE_TYPE__ size_t;
index a181ffc..90a242f 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_STDEXCPT
 #define _INC_STDEXCPT
 
 #ifndef _INC_STDEXCPT
 #define _INC_STDEXCPT
index 14a8bfd..30f58bd 100644 (file)
@@ -25,7 +25,7 @@
 #ifndef _STDINT_H
 #define _STDINT_H
 
 #ifndef _STDINT_H
 #define _STDINT_H
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #define __need_wint_t
 #define __need_wchar_t
 
 #define __need_wint_t
 #define __need_wchar_t
index e22f69f..6d688cc 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_STDIO
 #define _INC_STDIO
 
 #ifndef _INC_STDIO
 #define _INC_STDIO
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
@@ -92,7 +92,10 @@ extern "C" {
 
 #ifndef _STDIO_DEFINED
   _CRTIMP FILE *__cdecl __iob_func(void);
 
 #ifndef _STDIO_DEFINED
   _CRTIMP FILE *__cdecl __iob_func(void);
-  _CRTIMP extern FILE _iob[];
+  _CRTDATA(extern FILE _iob[];)
+#ifdef _M_CEE_PURE
+#define _iob __iob_func()
+#endif
 #endif
 
 #ifndef _FPOS_T_DEFINED
 #endif
 
 #ifndef _FPOS_T_DEFINED
@@ -110,17 +113,11 @@ extern "C" {
 #endif
 
 #ifndef _STDSTREAM_DEFINED
 #endif
 
 #ifndef _STDSTREAM_DEFINED
- #define _STDSTREAM_DEFINED
- #ifdef _M_CEE_PURE
-  #define stdin (&__iob_func()[0])
-  #define stdout (&__iob_func()[1])
-  #define stderr (&__iob_func()[2])
- #else // !_M_CEE_PURE
-  #define stdin (&_iob[0])
-  #define stdout (&_iob[1])
-  #define stderr (&_iob[2])
- #endif
-#endif
+#define _STDSTREAM_DEFINED
+#define stdin (&_iob[0])
+#define stdout (&_iob[1])
+#define stderr (&_iob[1])
+#endif /* !_STDSTREAM_DEFINED */
 
 #define _IOREAD 0x0001
 #define _IOWRT 0x0002
 
 #define _IOREAD 0x0001
 #define _IOWRT 0x0002
@@ -134,9 +131,6 @@ extern "C" {
 #define _IOERR 0x0020
 #define _IOSTRG 0x0040
 #define _IORW 0x0080
 #define _IOERR 0x0020
 #define _IOSTRG 0x0040
 #define _IORW 0x0080
-#ifdef _POSIX_
-#define _IOAPPEND 0x0200
-#endif
 
 #define _TWO_DIGIT_EXPONENT 0x1
 
 
 #define _TWO_DIGIT_EXPONENT 0x1
 
@@ -149,21 +143,21 @@ extern "C" {
 #else
   _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag);
 #endif
 #else
   _CRTIMP FILE *__cdecl _fsopen(const char *_Filename,const char *_Mode,int _ShFlag);
 #endif
-  void __cdecl clearerr(FILE *_File);
-  int __cdecl fclose(FILE *_File);
+  _CRTIMP void __cdecl clearerr(FILE *_File);
+  _CRTIMP int __cdecl fclose(FILE *_File);
   _CRTIMP int __cdecl _fcloseall(void);
 #ifdef _POSIX_
   FILE *__cdecl fdopen(int _FileHandle,const char *_Mode);
 #else
   _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode);
 #endif
   _CRTIMP int __cdecl _fcloseall(void);
 #ifdef _POSIX_
   FILE *__cdecl fdopen(int _FileHandle,const char *_Mode);
 #else
   _CRTIMP FILE *__cdecl _fdopen(int _FileHandle,const char *_Mode);
 #endif
-  int __cdecl feof(FILE *_File);
-  int __cdecl ferror(FILE *_File);
-  int __cdecl fflush(FILE *_File);
-  int __cdecl fgetc(FILE *_File);
+  _CRTIMP int __cdecl feof(FILE *_File);
+  _CRTIMP int __cdecl ferror(FILE *_File);
+  _CRTIMP int __cdecl fflush(FILE *_File);
+  _CRTIMP int __cdecl fgetc(FILE *_File);
   _CRTIMP int __cdecl _fgetchar(void);
   _CRTIMP int __cdecl _fgetchar(void);
-  int __cdecl fgetpos(FILE *_File ,fpos_t *_Pos);
-  char *__cdecl fgets(char *_Buf,int _MaxCount,FILE *_File);
+  _CRTIMP int __cdecl fgetpos(FILE *_File ,fpos_t *_Pos);
+  _CRTIMP char *__cdecl fgets(char *_Buf,int _MaxCount,FILE *_File);
 #ifdef _POSIX_
   int __cdecl fileno(FILE *_File);
 #else
 #ifdef _POSIX_
   int __cdecl fileno(FILE *_File);
 #else
@@ -171,68 +165,61 @@ extern "C" {
 #endif
   _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix);
   _CRTIMP int __cdecl _flushall(void);
 #endif
   _CRTIMP char *__cdecl _tempnam(const char *_DirName,const char *_FilePrefix);
   _CRTIMP int __cdecl _flushall(void);
-  FILE *__cdecl fopen(const char *_Filename,const char *_Mode);
-  FILE *fopen64(const char *filename,const char *mode);
-  int __cdecl fprintf(FILE *_File,const char *_Format,...);
-  int __cdecl fputc(int _Ch,FILE *_File);
+  _CRTIMP FILE *__cdecl fopen(const char *_Filename,const char *_Mode);
+  _CRTIMP int __cdecl fprintf(FILE *_File,const char *_Format,...);
+  _CRTIMP int __cdecl fputc(int _Ch,FILE *_File);
   _CRTIMP int __cdecl _fputchar(int _Ch);
   _CRTIMP int __cdecl _fputchar(int _Ch);
-  int __cdecl fputs(const char *_Str,FILE *_File);
-  size_t __cdecl fread(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File);
-  FILE *__cdecl freopen(const char *_Filename,const char *_Mode,FILE *_File);
-  int __cdecl fscanf(FILE *_File,const char *_Format,...);
-  int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos);
-  int __cdecl fseek(FILE *_File,long _Offset,int _Origin);
-   int fseeko64(FILE* stream, _off64_t offset, int whence);
-  long __cdecl ftell(FILE *_File);
-  _off64_t ftello64(FILE * stream);
-  int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin);
-  __int64 __cdecl _ftelli64(FILE *_File);
-  size_t __cdecl fwrite(const void *_Str,size_t _Size,size_t _Count,FILE *_File);
-  int __cdecl getc(FILE *_File);
-  int __cdecl getchar(void);
+  _CRTIMP int __cdecl fputs(const char *_Str,FILE *_File);
+  _CRTIMP size_t __cdecl fread(void *_DstBuf,size_t _ElementSize,size_t _Count,FILE *_File);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(freopen_s) FILE *__cdecl freopen(const char *_Filename,const char *_Mode,FILE *_File);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(fscanf_s) int __cdecl fscanf(FILE *_File,const char *_Format,...);
+  _CRTIMP int __cdecl fsetpos(FILE *_File,const fpos_t *_Pos);
+  _CRTIMP int __cdecl fseek(FILE *_File,long _Offset,int _Origin);
+  _CRTIMP long __cdecl ftell(FILE *_File);
+  _CRTIMP int __cdecl _fseeki64(FILE *_File,__int64 _Offset,int _Origin);
+  _CRTIMP __int64 __cdecl _ftelli64(FILE *_File);
+  _CRTIMP size_t __cdecl fwrite(const void *_Str,size_t _Size,size_t _Count,FILE *_File);
+  _CRTIMP int __cdecl getc(FILE *_File);
+  _CRTIMP int __cdecl getchar(void);
   _CRTIMP int __cdecl _getmaxstdio(void);
   _CRTIMP int __cdecl _getmaxstdio(void);
-  char *__cdecl gets(char *_Buffer);
-  int __cdecl _getw(FILE *_File);
+  _CRTIMP char *__cdecl gets(char *_Buffer); // FIXME: non-standard
+  _CRTIMP int __cdecl _getw(FILE *_File);
 #ifndef _CRT_PERROR_DEFINED
 #define _CRT_PERROR_DEFINED
 #ifndef _CRT_PERROR_DEFINED
 #define _CRT_PERROR_DEFINED
-  void __cdecl perror(const char *_ErrMsg);
+  _CRTIMP void __cdecl perror(const char *_ErrMsg);
 #endif
   _CRTIMP int __cdecl _pclose(FILE *_File);
   _CRTIMP FILE *__cdecl _popen(const char *_Command,const char *_Mode);
 #endif
   _CRTIMP int __cdecl _pclose(FILE *_File);
   _CRTIMP FILE *__cdecl _popen(const char *_Command,const char *_Mode);
-#if !defined(NO_OLDNAMES) && !defined(popen)
-#define popen  _popen
-#define pclose _pclose
-#endif
-  int __cdecl printf(const char *_Format,...);
-  int __cdecl putc(int _Ch,FILE *_File);
-  int __cdecl putchar(int _Ch);
-  int __cdecl puts(const char *_Str);
+  _CRTIMP int __cdecl printf(const char *_Format,...);
+  _CRTIMP int __cdecl putc(int _Ch,FILE *_File);
+  _CRTIMP int __cdecl putchar(int _Ch);
+  _CRTIMP int __cdecl puts(const char *_Str);
   _CRTIMP int __cdecl _putw(int _Word,FILE *_File);
 #ifndef _CRT_DIRECTORY_DEFINED
 #define _CRT_DIRECTORY_DEFINED
   _CRTIMP int __cdecl _putw(int _Word,FILE *_File);
 #ifndef _CRT_DIRECTORY_DEFINED
 #define _CRT_DIRECTORY_DEFINED
-  int __cdecl remove(const char *_Filename);
-  int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
+  _CRTIMP int __cdecl remove(const char *_Filename);
+  _CRTIMP int __cdecl rename(const char *_OldFilename,const char *_NewFilename);
   _CRTIMP int __cdecl _unlink(const char *_Filename);
   _CRTIMP int __cdecl _unlink(const char *_Filename);
-#ifndef        NO_OLDNAMES
-  int __cdecl unlink(const char *_Filename);
+#ifndef NO_OLDNAMES
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_unlink) int __cdecl unlink(const char *_Filename);
 #endif
 #endif
 #endif
 #endif
-  void __cdecl rewind(FILE *_File);
+  _CRTIMP void __cdecl rewind(FILE *_File);
   _CRTIMP int __cdecl _rmtmp(void);
   _CRTIMP int __cdecl _rmtmp(void);
-  int __cdecl scanf(const char *_Format,...);
-  void __cdecl setbuf(FILE *_File,char *_Buffer);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(scanf_s) int __cdecl scanf(const char *_Format,...);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(setvbuf) void __cdecl setbuf(FILE *_File,char *_Buffer);
   _CRTIMP int __cdecl _setmaxstdio(int _Max);
   _CRTIMP unsigned int __cdecl _set_output_format(unsigned int _Format);
   _CRTIMP unsigned int __cdecl _get_output_format(void);
   _CRTIMP int __cdecl _setmaxstdio(int _Max);
   _CRTIMP unsigned int __cdecl _set_output_format(unsigned int _Format);
   _CRTIMP unsigned int __cdecl _get_output_format(void);
-  int __cdecl setvbuf(FILE *_File,char *_Buf,int _Mode,size_t _Size);
+  _CRTIMP int __cdecl setvbuf(FILE *_File,char *_Buf,int _Mode,size_t _Size);
   _CRTIMP int __cdecl _scprintf(const char *_Format,...);
   _CRTIMP int __cdecl _scprintf(const char *_Format,...);
-  int __cdecl sscanf(const char *_Src,const char *_Format,...);
-  _CRTIMP int __cdecl _snscanf(const char *_Src,size_t _MaxCount,const char *_Format,...);
-  FILE *__cdecl tmpfile(void);
-  char *__cdecl tmpnam(char *_Buffer);
-  int __cdecl ungetc(int _Ch,FILE *_File);
-  int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList);
-  int __cdecl vprintf(const char *_Format,va_list _ArgList);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(sscanf_s) int __cdecl sscanf(const char *_Src,const char *_Format,...);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_snscanf_s) int __cdecl _snscanf(const char *_Src,size_t _MaxCount,const char *_Format,...);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(tmpfile_s) FILE *__cdecl tmpfile(void);
+  _CRTIMP char *__cdecl tmpnam(char *_Buffer);
+  _CRTIMP_ALT int __cdecl ungetc(int _Ch,FILE *_File);
+  _CRTIMP int __cdecl vfprintf(FILE *_File,const char *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vprintf(const char *_Format,va_list _ArgList);
   /* Make sure macros are not defined.  */
 #if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("vsnprintf")
   /* Make sure macros are not defined.  */
 #if __MINGW_GNUC_PREREQ(4,4)
 #pragma push_macro("vsnprintf")
@@ -240,27 +227,13 @@ extern "C" {
 #endif
   #undef vsnprintf
   #undef snprintf
 #endif
   #undef vsnprintf
   #undef snprintf
-
-  extern
-#ifdef gnu_printf
-  __attribute__((format(gnu_printf, 3, 0))) __attribute__((nonnull (3)))
-#endif
-  int __mingw_vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
-  extern
-#ifdef gnu_printf
-  __attribute__((format(gnu_printf, 3, 4))) __attribute__((nonnull (3)))
-#endif
-  int __mingw_snprintf(char* s, size_t n, const char*  format, ...);
-  int __cdecl vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(vsnprintf_s) int __cdecl vsnprintf(char *_DstBuf,size_t _MaxCount,const char *_Format,va_list _ArgList);
   _CRTIMP int __cdecl _snprintf(char *_Dest,size_t _Count,const char *_Format,...);
   _CRTIMP int __cdecl _vsnprintf(char *_Dest,size_t _Count,const char *_Format,va_list _Args);
   int __cdecl sprintf(char *_Dest,const char *_Format,...);
   int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
   int __cdecl snprintf(char* s, size_t n, const char*  format, ...);
   _CRTIMP int __cdecl _snprintf(char *_Dest,size_t _Count,const char *_Format,...);
   _CRTIMP int __cdecl _vsnprintf(char *_Dest,size_t _Count,const char *_Format,va_list _Args);
   int __cdecl sprintf(char *_Dest,const char *_Format,...);
   int __cdecl vsprintf(char *_Dest,const char *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
   int __cdecl snprintf(char* s, size_t n, const char*  format, ...);
-  __CRT_INLINE int __cdecl vsnprintf (char* s, size_t n, const char* format,va_list arg) {
-    return _vsnprintf ( s, n, format, arg);
-  }
   int __cdecl vscanf(const char * __restrict__ Format, va_list argp);
   int __cdecl vfscanf (FILE * __restrict__ fp, const char * Format,va_list argp);
   int __cdecl vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
   int __cdecl vscanf(const char * __restrict__ Format, va_list argp);
   int __cdecl vfscanf (FILE * __restrict__ fp, const char * Format,va_list argp);
   int __cdecl vsscanf (const char * __restrict__ _Str,const char * __restrict__ Format,va_list argp);
@@ -270,26 +243,22 @@ extern "C" {
 #pragma pop_macro("snprintf")
 #pragma pop_macro("vsnprintf")
 #endif
 #pragma pop_macro("snprintf")
 #pragma pop_macro("vsnprintf")
 #endif
-/* Check if vsnprintf and snprintf are defaulting to gnu-style.  */
-#if defined(USE_MINGW_GNU_SNPRINTF) && USE_MINGW_GNU_SNPRINTF
-  #ifndef vsnprint
-    #define vsnprintf __mingw_vsnprintf
-  #endif
-  #ifndef snprintf
-    #define snprintf __mingw_snprintf
-  #endif
-#else
-  #ifndef vsnprint
-    #define vsnprintf _vsnprintf
-  #endif
-  #ifndef snprintf
-    #define snprintf _snprintf
-  #endif
+
+#ifndef vsnprintf
+  #define vsnprintf _vsnprintf
+#endif
+#ifndef snprintf
+  #define snprintf _snprintf
 #endif
 
   _CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList);
 #endif
 
   _CRTIMP int __cdecl _vscprintf(const char *_Format,va_list _ArgList);
+#ifdef _SAFECRT_IMPL
+#define _set_printf_count_output(i)
+#define _get_printf_count_output() (FALSE)
+#else
   _CRTIMP int __cdecl _set_printf_count_output(int _Value);
   _CRTIMP int __cdecl _set_printf_count_output(int _Value);
-  _CRTIMP int __cdecl _get_printf_count_output();
+  _CRTIMP int __cdecl _get_printf_count_output(void);
+#endif
 
 #ifndef _WSTDIO_DEFINED
 
 
 #ifndef _WSTDIO_DEFINED
 
@@ -302,24 +271,24 @@ extern "C" {
 #else
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
 #endif
 #else
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
 #endif
-  wint_t __cdecl fgetwc(FILE *_File);
+  _CRTIMP wint_t __cdecl fgetwc(FILE *_File);
   _CRTIMP wint_t __cdecl _fgetwchar(void);
   _CRTIMP wint_t __cdecl _fgetwchar(void);
-  wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
   _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
   _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
-  wint_t __cdecl getwc(FILE *_File);
-  wint_t __cdecl getwchar(void);
-  wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
-  wint_t __cdecl putwchar(wchar_t _Ch);
-  wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
-  wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
-  int __cdecl fputws(const wchar_t *_Str,FILE *_File);
+  _CRTIMP wint_t __cdecl getwc(FILE *_File);
+  _CRTIMP wint_t __cdecl getwchar(void);
+  _CRTIMP wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl putwchar(wchar_t _Ch);
+  _CRTIMP wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
+  _CRTIMP wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
+  _CRTIMP int __cdecl fputws(const wchar_t *_Str,FILE *_File);
   _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
   _CRTIMP int __cdecl _putws(const wchar_t *_Str);
   _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
   _CRTIMP int __cdecl _putws(const wchar_t *_Str);
-  int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
-  int __cdecl wprintf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl wprintf(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
-  int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
-  int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
   _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
   _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
   _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
   _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
   _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
   _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
@@ -327,18 +296,11 @@ extern "C" {
   _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
   _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-  __CRT_INLINE int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t*  format, ...) {
-         int r;
-         va_list a;
-         __mingw_va_start(a, format);
-         r = _vsnwprintf (s, n, format, a);
-         __mingw_va_end(a);
-         return r;
-  }
+  _CRTIMP int __cdecl snwprintf (wchar_t* s, size_t n, const wchar_t*  format, ...);
   __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
   __CRT_INLINE int __cdecl vsnwprintf (wchar_t* s, size_t n, const wchar_t* format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
-  int __cdecl vwscanf (const wchar_t *, va_list);
-  int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
-  int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
+  _CRTIMP int __cdecl vwscanf (const wchar_t *, va_list);
+  _CRTIMP int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
+  _CRTIMP int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
 #endif
   _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
 #endif
   _CRTIMP int __cdecl _swprintf(wchar_t *_Dest,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
@@ -347,21 +309,21 @@ extern "C" {
 #include <vadefs.h>
 #endif
 
 #include <vadefs.h>
 #endif
 
-//#ifdef _CRT_NON_CONFORMING_SWPRINTFS
-//#ifndef __cplusplus
-//#define swprintf _swprintf
-//#define vswprintf _vswprintf
-//#define _swprintf_l __swprintf_l
-//#define _vswprintf_l __vswprintf_l
-//#endif
-//#endif
+#ifdef _CRT_NON_CONFORMING_SWPRINTFS
+#ifndef __cplusplus
+#define swprintf _swprintf
+#define vswprintf _vswprintf
+#define _swprintf_l __swprintf_l
+#define _vswprintf_l __vswprintf_l
+#endif
+#endif
 
   _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
   _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);
 
   _CRTIMP wchar_t *__cdecl _wtempnam(const wchar_t *_Directory,const wchar_t *_FilePrefix);
   _CRTIMP int __cdecl _vscwprintf(const wchar_t *_Format,va_list _ArgList);
-  int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...);
-  int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl fwscanf(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl swscanf(const wchar_t *_Src,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _snwscanf(const wchar_t *_Src,size_t _MaxCount,const wchar_t *_Format,...);
-  int __cdecl wscanf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl wscanf(const wchar_t *_Format,...);
   _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
   _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode);
   _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
   _CRTIMP FILE *__cdecl _wfdopen(int _FileHandle ,const wchar_t *_Mode);
   _CRTIMP FILE *__cdecl _wfopen(const wchar_t *_Filename,const wchar_t *_Mode);
   _CRTIMP FILE *__cdecl _wfreopen(const wchar_t *_Filename,const wchar_t *_Mode,FILE *_OldFile);
index 59a86d9..206dd69 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_STDLIB
 #define _INC_STDLIB
 
 #ifndef _INC_STDLIB
 #define _INC_STDLIB
 
-#include <_mingw.h>
+#include <crtdefs.h>
 #include <limits.h>
 
 #pragma pack(push,_CRT_PACKING)
 #include <limits.h>
 
 #pragma pack(push,_CRT_PACKING)
@@ -131,7 +131,7 @@ extern "C" {
   typedef void (__cdecl *_purecall_handler)(void);
 
   _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
   typedef void (__cdecl *_purecall_handler)(void);
 
   _CRTIMP _purecall_handler __cdecl _set_purecall_handler(_purecall_handler _Handler);
-  _CRTIMP _purecall_handler __cdecl _get_purecall_handler();
+  _CRTIMP _purecall_handler __cdecl _get_purecall_handler(void);
 
   typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
   _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
 
   typedef void (__cdecl *_invalid_parameter_handler)(const wchar_t *,const wchar_t *,const wchar_t *,unsigned int,uintptr_t);
   _invalid_parameter_handler __cdecl _set_invalid_parameter_handler(_invalid_parameter_handler _Handler);
@@ -149,15 +149,10 @@ extern "C" {
   errno_t __cdecl _set_doserrno(unsigned long _Value);
   errno_t __cdecl _get_doserrno(unsigned long *_Value);
 
   errno_t __cdecl _set_doserrno(unsigned long _Value);
   errno_t __cdecl _get_doserrno(unsigned long *_Value);
 
-#ifdef _MSVCRT_
-  extern int*  _imp___sys_nerr;
-  extern char***       _imp__sys_errlist;
-#else 
-  __MINGW_IMPORT int   _sys_nerr;
-  __MINGW_IMPORT char* _sys_errlist[];
-#endif
+  _CRTIMP extern char *_sys_errlist[];
+  _CRTIMP extern int _sys_nerr;
 
 
-//#if (defined(_X86_) && !defined(__x86_64))
+#if (defined(_X86_) || defined(__x86_64)) // HACK
   _CRTIMP int *__cdecl __p___argc(void);
   _CRTIMP char ***__cdecl __p___argv(void);
   _CRTIMP wchar_t ***__cdecl __p___wargv(void);
   _CRTIMP int *__cdecl __p___argc(void);
   _CRTIMP char ***__cdecl __p___argv(void);
   _CRTIMP wchar_t ***__cdecl __p___wargv(void);
@@ -165,7 +160,7 @@ extern "C" {
   _CRTIMP wchar_t ***__cdecl __p__wenviron(void);
   _CRTIMP char **__cdecl __p__pgmptr(void);
   _CRTIMP wchar_t **__cdecl __p__wpgmptr(void);
   _CRTIMP wchar_t ***__cdecl __p__wenviron(void);
   _CRTIMP char **__cdecl __p__pgmptr(void);
   _CRTIMP wchar_t **__cdecl __p__wpgmptr(void);
-//#endif
+#endif
 #ifndef __argc
 #ifdef _MSVCRT_
   extern int __argc;
 #ifndef __argc
 #ifdef _MSVCRT_
   extern int __argc;
@@ -350,15 +345,15 @@ extern "C" {
   void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
   void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
 #endif
   void *__cdecl bsearch(const void *_Key,const void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
   void __cdecl qsort(void *_Base,size_t _NumOfElements,size_t _SizeOfElements,int (__cdecl *_PtFuncCompare)(const void *,const void *));
 #endif
-  /*unsigned short __cdecl _byteswap_ushort(unsigned short _Short); */
+  unsigned short __cdecl _byteswap_ushort(unsigned short _Short);
   /*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */
 #if _INTEGRAL_MAX_BITS >= 64
   /*unsigned long __cdecl _byteswap_ulong (unsigned long _Long); */
 #if _INTEGRAL_MAX_BITS >= 64
-  /*unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);*/
+  unsigned __int64 __cdecl _byteswap_uint64(unsigned __int64 _Int64);
 #endif
   div_t __cdecl div(int _Numerator,int _Denominator);
   char *__cdecl getenv(const char *_VarName);
   _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
 #endif
   div_t __cdecl div(int _Numerator,int _Denominator);
   char *__cdecl getenv(const char *_VarName);
   _CRTIMP char *__cdecl _itoa(int _Value,char *_Dest,int _Radix);
-/* #if _INTEGRAL_MAX_BITS >= 64 */
+#if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _atoi64(const char *_String);
   _CRTIMP char *__cdecl _i64toa(__int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP char *__cdecl _ui64toa(unsigned __int64 _Val,char *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _atoi64(const char *_String);
@@ -367,7 +362,7 @@ extern "C" {
   _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP __int64 __cdecl _strtoi64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _strtoui64(const char *_String,char **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _strtoui64_l(const char *_String,char **_EndPtr,int _Radix,_locale_t _Locale);
-/* #endif */
+#endif
   ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
   _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix);
   int __cdecl mblen(const char *_Ch,size_t _MaxCount);
   ldiv_t __cdecl ldiv(long _Numerator,long _Denominator);
   _CRTIMP char *__cdecl _ltoa(long _Value,char *_Dest,int _Radix);
   int __cdecl mblen(const char *_Ch,size_t _MaxCount);
@@ -449,7 +444,7 @@ extern "C" {
   _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
   _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
 
   _CRTIMP long __cdecl _wtol(const wchar_t *_Str);
   _CRTIMP long __cdecl _wtol_l(const wchar_t *_Str,_locale_t _Locale);
 
-/* #if _INTEGRAL_MAX_BITS >= 64 */
+#if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
   _CRTIMP wchar_t *__cdecl _i64tow(__int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP wchar_t *__cdecl _ui64tow(unsigned __int64 _Val,wchar_t *_DstBuf,int _Radix);
   _CRTIMP __int64 __cdecl _wtoi64(const wchar_t *_Str);
@@ -458,7 +453,7 @@ extern "C" {
   _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP __int64 __cdecl _wcstoi64_l(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64(const wchar_t *_Str,wchar_t **_EndPtr,int _Radix);
   _CRTIMP unsigned __int64 __cdecl _wcstoui64_l(const wchar_t *_Str ,wchar_t **_EndPtr,int _Radix,_locale_t _Locale);
-/* #endif */
+#endif
 #endif
 
 #ifndef _POSIX_
 #endif
 
 #ifndef _POSIX_
@@ -473,8 +468,8 @@ extern "C" {
   _CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale);
   _CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale);
   _CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale);
   _CRTIMP int __cdecl _atodbl_l(_CRT_DOUBLE *_Result,char *_Str,_locale_t _Locale);
   _CRTIMP int __cdecl _atoldbl_l(_LDOUBLE *_Result,char *_Str,_locale_t _Locale);
   _CRTIMP int __cdecl _atoflt_l(_CRT_FLOAT *_Result,char *_Str,_locale_t _Locale);
-  _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotl(unsigned long, int) __MINGW_ATTRIB_CONST;
-  _CRTIMP unsigned long __cdecl __MINGW_NOTHROW _lrotr(unsigned long, int) __MINGW_ATTRIB_CONST;
+  unsigned long __cdecl _lrotl(unsigned long _Val,int _Shift);
+  unsigned long __cdecl _lrotr(unsigned long _Val,int _Shift);
   _CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
   _onexit_t __cdecl _onexit(_onexit_t _Func);
 
   _CRTIMP void __cdecl _makepath(char *_Path,const char *_Drive,const char *_Dir,const char *_Filename,const char *_Ext);
   _onexit_t __cdecl _onexit(_onexit_t _Func);
 
@@ -483,13 +478,13 @@ extern "C" {
   void __cdecl perror(const char *_ErrMsg);
 #endif
   _CRTIMP int __cdecl _putenv(const char *_EnvString);
   void __cdecl perror(const char *_ErrMsg);
 #endif
   _CRTIMP int __cdecl _putenv(const char *_EnvString);
-  //_CRTIMP unsigned int __cdecl _rotl(unsigned int, int) __MINGW_ATTRIB_CONST;
+  unsigned int __cdecl _rotl(unsigned int _Val,int _Shift);
 #if _INTEGRAL_MAX_BITS >= 64
 #if _INTEGRAL_MAX_BITS >= 64
-  //_CRTIMP unsigned __int64 __cdecl _rotl64(unsigned __int64, int) __MINGW_ATTRIB_CONST;
+  unsigned __int64 __cdecl _rotl64(unsigned __int64 _Val,int _Shift);
 #endif
 #endif
-  //_CRTIMP unsigned int __cdecl _rotr(unsigned int, int) __MINGW_ATTRIB_CONST;
+  unsigned int __cdecl _rotr(unsigned int _Val,int _Shift);
 #if _INTEGRAL_MAX_BITS >= 64
 #if _INTEGRAL_MAX_BITS >= 64
-  //_CRTIMP unsigned __int64 __cdecl _rotr64(unsigned __int64, int) __MINGW_ATTRIB_CONST;
+  unsigned __int64 __cdecl _rotr64(unsigned __int64 _Val,int _Shift);
 #endif
   _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath);
   _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext);
 #endif
   _CRTIMP void __cdecl _searchenv(const char *_Filename,const char *_EnvVar,char *_ResultPath);
   _CRTIMP void __cdecl _splitpath(const char *_FullPath,char *_Drive,char *_Dir,char *_Filename,char *_Ext);
@@ -529,8 +524,8 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
-#define        sys_errlist     (*_imp___sys_errlist)
-#define        sys_nerr        (*_imp___sys_nerr)
+#define sys_errlist _sys_errlist
+#define sys_nerr _sys_nerr
 #define environ _environ
   char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
   char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
 #define environ _environ
   char *__cdecl ecvt(double _Val,int _NumOfDigits,int *_PtDec,int *_PtSign);
   char *__cdecl fcvt(double _Val,int _NumOfDec,int *_PtDec,int *_PtSign);
@@ -564,7 +559,7 @@ extern "C" {
   char *__cdecl ulltoa (unsigned long long , char *, int);
   wchar_t *__cdecl lltow (long long, wchar_t *, int);
   wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
   char *__cdecl ulltoa (unsigned long long , char *, int);
   wchar_t *__cdecl lltow (long long, wchar_t *, int);
   wchar_t *__cdecl ulltow (unsigned long long, wchar_t *, int);
-#if _INTEGRAL_MAX_BITS >= 64
+
   /* __CRT_INLINE using non-ansi functions */
   __CRT_INLINE long long  __cdecl atoll (const char * _c) { return _atoi64 (_c); }
   __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
   /* __CRT_INLINE using non-ansi functions */
   __CRT_INLINE long long  __cdecl atoll (const char * _c) { return _atoi64 (_c); }
   __CRT_INLINE char *__cdecl lltoa (long long _n, char * _c, int _i) { return _i64toa (_n, _c, _i); }
@@ -573,7 +568,7 @@ extern "C" {
   __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
   __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
 #endif /* (__STRICT_ANSI__)  */
   __CRT_INLINE wchar_t *__cdecl lltow (long long _n, wchar_t * _w, int _i) { return _i64tow (_n, _w, _i); }
   __CRT_INLINE wchar_t *__cdecl ulltow (unsigned long long _n, wchar_t * _w, int _i) { return _ui64tow (_n, _w, _i); }
 #endif /* (__STRICT_ANSI__)  */
-#endif
+
 #endif /* !__NO_ISOCEXT */
 
 #ifdef __cplusplus
 #endif /* !__NO_ISOCEXT */
 
 #ifdef __cplusplus
@@ -583,6 +578,4 @@ extern "C" {
 #pragma pack(pop)
 
 #include <sec_api/stdlib_s.h>
 #pragma pack(pop)
 
 #include <sec_api/stdlib_s.h>
-#include <malloc.h>
-
 #endif
 #endif
index f766137..c69a48f 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_STRING
 #define _INC_STRING
 
 #ifndef _INC_STRING
 #define _INC_STRING
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifdef __cplusplus
 extern "C" {
 
 #ifdef __cplusplus
 extern "C" {
@@ -25,37 +25,35 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
-#define _WConst_return _CONST_RETURN
-
 #ifndef _CRT_MEMORY_DEFINED
 #define _CRT_MEMORY_DEFINED
   _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);
 #ifndef _CRT_MEMORY_DEFINED
 #define _CRT_MEMORY_DEFINED
   _CRTIMP void *__cdecl _memccpy(void *_Dst,const void *_Src,int _Val,size_t _MaxCount);
-  _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount);
+  _CRTIMP _CONST_RETURN void *__cdecl memchr(const void *_Buf ,int _Val,size_t _MaxCount);
   _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
   _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale);
   int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size);
   _CRTIMP int __cdecl _memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
   _CRTIMP int __cdecl _memicmp_l(const void *_Buf1,const void *_Buf2,size_t _Size,_locale_t _Locale);
   int __cdecl memcmp(const void *_Buf1,const void *_Buf2,size_t _Size);
-  void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size);
+  _CRT_INSECURE_DEPRECATE_MEMORY(memcpy_s) void *__cdecl memcpy(void *_Dst,const void *_Src,size_t _Size);
   void *__cdecl memset(void *_Dst,int _Val,size_t _Size);
 #ifndef        NO_OLDNAMES
   void *__cdecl memset(void *_Dst,int _Val,size_t _Size);
 #ifndef        NO_OLDNAMES
-  void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size);
-  int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_memccpy) void *__cdecl memccpy(void *_Dst,const void *_Src,int _Val,size_t _Size);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_memicmp) int __cdecl memicmp(const void *_Buf1,const void *_Buf2,size_t _Size);
 #endif
 #endif
 #endif
 #endif
+
   char *__cdecl _strset(char *_Str,int _Val);
   char *__cdecl strcpy(char *_Dest,const char *_Source);
   char *__cdecl strcat(char *_Dest,const char *_Source);
   int __cdecl strcmp(const char *_Str1,const char *_Str2);
   size_t __cdecl strlen(const char *_Str);
   char *__cdecl _strset(char *_Str,int _Val);
   char *__cdecl strcpy(char *_Dest,const char *_Source);
   char *__cdecl strcat(char *_Dest,const char *_Source);
   int __cdecl strcmp(const char *_Str1,const char *_Str2);
   size_t __cdecl strlen(const char *_Str);
-#if 0
-  size_t __cdecl strnlen(const char *_Str,size_t _MaxCount);
-#endif
-  void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size);
+  _CRTIMP size_t __cdecl strnlen(const char *_Str,size_t _MaxCount);
+
+  _CRT_INSECURE_DEPRECATE_MEMORY(memmove_s) void *__cdecl memmove(void *_Dst,const void *_Src,size_t _Size);
   _CRTIMP char *__cdecl _strdup(const char *_Src);
   _CRTIMP char *__cdecl _strdup(const char *_Src);
-  _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val);
+  _CRTIMP _CONST_RETURN char *__cdecl strchr(const char *_Str,int _Val);
   _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _stricmp(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _strcmpi(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _stricmp_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
-  int __cdecl strcoll(const char *_Str1,const char *_Str2);
+  _CRTIMP int __cdecl strcoll(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _strcoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _stricoll(const char *_Str1,const char *_Str2);
   _CRTIMP int __cdecl _stricoll_l(const char *_Str1,const char *_Str2,_locale_t _Locale);
@@ -63,9 +61,9 @@ extern "C" {
   _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
   _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
   _CRTIMP int __cdecl _strncoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
   _CRTIMP int __cdecl _strnicoll (const char *_Str1,const char *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _strnicoll_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
-  size_t __cdecl strcspn(const char *_Str,const char *_Control);
-  _CRTIMP char *__cdecl _strerror(const char *_ErrMsg);
-  char *__cdecl strerror(int);
+  _CRTIMP size_t __cdecl strcspn(const char *_Str,const char *_Control);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_strerror_s) char *__cdecl _strerror(const char *_ErrMsg);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(strerror_s) char *__cdecl strerror(int);
   _CRTIMP char *__cdecl _strlwr(char *_String);
   char *strlwr_l(char *_String,_locale_t _Locale);
   char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count);
   _CRTIMP char *__cdecl _strlwr(char *_String);
   char *strlwr_l(char *_String,_locale_t _Locale);
   char *__cdecl strncat(char *_Dest,const char *_Source,size_t _Count);
@@ -73,67 +71,67 @@ extern "C" {
   _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
   char *strncpy(char *_Dest,const char *_Source,size_t _Count);
   _CRTIMP int __cdecl _strnicmp(const char *_Str1,const char *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _strnicmp_l(const char *_Str1,const char *_Str2,size_t _MaxCount,_locale_t _Locale);
   char *strncpy(char *_Dest,const char *_Source,size_t _Count);
-  _CRTIMP char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount);
-  _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);
-  _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_strnset_s) char *__cdecl _strnset(char *_Str,int _Val,size_t _MaxCount);
+  _CRTIMP _CONST_RETURN char *__cdecl strpbrk(const char *_Str,const char *_Control);
+  _CRTIMP _CONST_RETURN char *__cdecl strrchr(const char *_Str,int _Ch);
   _CRTIMP char *__cdecl _strrev(char *_Str);
   _CRTIMP char *__cdecl _strrev(char *_Str);
-  size_t __cdecl strspn(const char *_Str,const char *_Control);
-  _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr);
-  char *__cdecl strtok(char *_Str,const char *_Delim);
+  _CRTIMP size_t __cdecl strspn(const char *_Str,const char *_Control);
+  _CRTIMP _CONST_RETURN char *__cdecl strstr(const char *_Str,const char *_SubStr);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(strtok_s) char *__cdecl strtok(char *_Str,const char *_Delim);
   _CRTIMP char *__cdecl _strupr(char *_String);
   _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale);
   _CRTIMP char *__cdecl _strupr(char *_String);
   _CRTIMP char *_strupr_l(char *_String,_locale_t _Locale);
-  size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount);
+  _CRTIMP size_t __cdecl strxfrm(char *_Dst,const char *_Src,size_t _MaxCount);
   _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
   _CRTIMP size_t __cdecl _strxfrm_l(char *_Dst,const char *_Src,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
-  char *__cdecl strdup(const char *_Src);
-  int __cdecl strcmpi(const char *_Str1,const char *_Str2);
-  int __cdecl stricmp(const char *_Str1,const char *_Str2);
-  char *__cdecl strlwr(char *_Str);
-  int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount);
-  __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); }
-  __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); }
-  char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount);
-  char *__cdecl strrev(char *_Str);
-  char *__cdecl strset(char *_Str,int _Val);
-  char *__cdecl strupr(char *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strdup) char *__cdecl strdup(const char *_Src);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strcmpi) int __cdecl strcmpi(const char *_Str1,const char *_Str2);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_stricmp) int __cdecl stricmp(const char *_Str1,const char *_Str2);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strlwr) char *__cdecl strlwr(char *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strnicmp) int __cdecl strnicmp(const char *_Str1,const char *_Str,size_t _MaxCount);
+//  __CRT_INLINE int __cdecl strncasecmp (const char *__sz1, const char *__sz2, size_t __sizeMaxCompare) { return _strnicmp (__sz1, __sz2, __sizeMaxCompare); }
+//  __CRT_INLINE int __cdecl strcasecmp (const char *__sz1, const char *__sz2) { return _stricmp (__sz1, __sz2); }
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strnset) char *__cdecl strnset(char *_Str,int _Val,size_t _MaxCount);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strrev) char *__cdecl strrev(char *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strset) char *__cdecl strset(char *_Str,int _Val);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_strupr) char *__cdecl strupr(char *_Str);
 #endif
 
 #ifndef _WSTRING_DEFINED
 #define _WSTRING_DEFINED
 
   _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
 #endif
 
 #ifndef _WSTRING_DEFINED
 #define _WSTRING_DEFINED
 
   _CRTIMP wchar_t *__cdecl _wcsdup(const wchar_t *_Str);
-  wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
-  _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
-  int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
-  wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
-  size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
-  size_t __cdecl wcslen(const wchar_t *_Str);
-  size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
-  wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
-  int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
-  wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
-  _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
-  _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
-  size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
-  _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
-  wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
-  _CRTIMP wchar_t *__cdecl _wcserror(int _ErrNum);
-  _CRTIMP wchar_t *__cdecl __wcserror(const wchar_t *_Str);
+  _CRTIMP wchar_t *__cdecl wcscat(wchar_t *_Dest,const wchar_t *_Source);
+  _CRTIMP _CONST_RETURN wchar_t *__cdecl wcschr(const wchar_t *_Str,wchar_t _Ch);
+  _CRTIMP int __cdecl wcscmp(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP wchar_t *__cdecl wcscpy(wchar_t *_Dest,const wchar_t *_Source);
+  _CRTIMP size_t __cdecl wcscspn(const wchar_t *_Str,const wchar_t *_Control);
+  _CRTIMP size_t __cdecl wcslen(const wchar_t *_Str);
+  _CRTIMP size_t __cdecl wcsnlen(const wchar_t *_Src,size_t _MaxCount);
+  _CRTIMP wchar_t *wcsncat(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
+  _CRTIMP int __cdecl wcsncmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP wchar_t *wcsncpy(wchar_t *_Dest,const wchar_t *_Source,size_t _Count);
+  _CRTIMP _CONST_RETURN wchar_t *__cdecl wcspbrk(const wchar_t *_Str,const wchar_t *_Control);
+  _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsrchr(const wchar_t *_Str,wchar_t _Ch);
+  _CRTIMP size_t __cdecl wcsspn(const wchar_t *_Str,const wchar_t *_Control);
+  _CRTIMP _CONST_RETURN wchar_t *__cdecl wcsstr(const wchar_t *_Str,const wchar_t *_SubStr);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(wcstok_s) wchar_t *__cdecl wcstok(wchar_t *_Str,const wchar_t *_Delim);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_wcserror_s) wchar_t *__cdecl _wcserror(int _ErrNum);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(__wcserror_s) wchar_t *__cdecl __wcserror(const wchar_t *_Str);
   _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
   _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
   _CRTIMP int __cdecl _wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
   _CRTIMP int __cdecl _wcsicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
   _CRTIMP int __cdecl _wcsnicmp_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
-  _CRTIMP wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_wcsnset_s) wchar_t *__cdecl _wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
   _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
   _CRTIMP wchar_t *__cdecl _wcsrev(wchar_t *_Str);
-  _CRTIMP wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
+  _CRTIMP _CRT_INSECURE_DEPRECATE_CORE(_wcsset_s) wchar_t *__cdecl _wcsset(wchar_t *_Str,wchar_t _Val);
   _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
   _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
   _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wcslwr(wchar_t *_String);
   _CRTIMP wchar_t *_wcslwr_l(wchar_t *_String,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wcsupr(wchar_t *_String);
   _CRTIMP wchar_t *_wcsupr_l(wchar_t *_String,_locale_t _Locale);
-  size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
+  _CRTIMP size_t __cdecl wcsxfrm(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount);
   _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
   _CRTIMP size_t __cdecl _wcsxfrm_l(wchar_t *_Dst,const wchar_t *_Src,size_t _MaxCount,_locale_t _Locale);
-  int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP int __cdecl wcscoll(const wchar_t *_Str1,const wchar_t *_Str2);
   _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
   _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _wcscoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
   _CRTIMP int __cdecl _wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
   _CRTIMP int __cdecl _wcsicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,_locale_t _Locale);
@@ -143,27 +141,30 @@ extern "C" {
   _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
   _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
-  /* NOTE: There is no _wcscmpi, but this is for compatibility. */
-  int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2);
-  __CRT_INLINE int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) { return _wcsicmp (__ws1, __ws2); }
-  #define              _wcscmpi        _wcsicmp
-
-  wchar_t *__cdecl wcsdup(const wchar_t *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsdup) wchar_t *__cdecl wcsdup(const wchar_t *_Str);
 #define wcswcs wcsstr
 #define wcswcs wcsstr
-  int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
-  int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
-  wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
-  wchar_t *__cdecl wcsrev(wchar_t *_Str);
-  wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
-  wchar_t *__cdecl wcslwr(wchar_t *_Str);
-  wchar_t *__cdecl wcsupr(wchar_t *_Str);
-  int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
-#endif
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsicmp) int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsnicmp) int __cdecl wcsnicmp(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsnset) wchar_t *__cdecl wcsnset(wchar_t *_Str,wchar_t _Val,size_t _MaxCount);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsrev) wchar_t *__cdecl wcsrev(wchar_t *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsset) wchar_t *__cdecl wcsset(wchar_t *_Str,wchar_t _Val);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcslwr) wchar_t *__cdecl wcslwr(wchar_t *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsupr) wchar_t *__cdecl wcsupr(wchar_t *_Str);
+  _CRTIMP _CRT_NONSTDC_DEPRECATE(_wcsicoll) int __cdecl wcsicoll(const wchar_t *_Str1,const wchar_t *_Str2);
 #endif
 
 #endif
 
+#endif /* !_WSTRING_DEFINED */
+
 #ifdef __cplusplus
 }
 #endif
 
 #include <sec_api/string_s.h>
 #ifdef __cplusplus
 }
 #endif
 
 #include <sec_api/string_s.h>
+
+// HACK
+#define strcasecmp _stricmp
+#define strncasecmp _strnicmp
+#define stricmp _stricmp
+#define wcsicmp _wcsicmp
+
 #endif
 #endif
index e3fc85b..1e58241 100644 (file)
@@ -10,8 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-/* All the headers include this file. */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #define _LK_UNLCK 0
 #define _LK_LOCK 1
 
 #define _LK_UNLCK 0
 #define _LK_LOCK 1
index f8f280c..22bfb0f 100644 (file)
@@ -10,8 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#include <_mingw.h>
-#include <io.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
 #include <sys/types.h>
 
 #include <sys/types.h>
 
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#else
-#if _INTEGRAL_MAX_BITS < 64
-#define _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-  typedef long __time32_t;
-#define _TIME32_T_DEFINED
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#if _INTEGRAL_MAX_BITS >= 64
-  typedef __int64 __time64_t;
-#endif
-#define _TIME64_T_DEFINED
-#endif
-
-#ifndef _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#define _TIME_T_DEFINED
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif
-
 #ifndef _STAT_DEFINED
 #ifndef _STAT_DEFINED
+#define _STAT_DEFINED
 
   struct _stat32 {
     _dev_t st_dev;
 
   struct _stat32 {
     _dev_t st_dev;
@@ -107,8 +67,7 @@ extern "C" {
   };
 #endif
 
   };
 #endif
 
-/* #if _INTEGRAL_MAX_BITS >= 64 */
-
+#if _INTEGRAL_MAX_BITS >= 64
   struct _stat32i64 {
     _dev_t st_dev;
     _ino_t st_ino;
   struct _stat32i64 {
     _dev_t st_dev;
     _ino_t st_ino;
@@ -165,11 +124,10 @@ extern "C" {
     time_t st_ctime;
   };
 
     time_t st_ctime;
   };
 
-/* #endif */
+#endif /* _INTEGRAL_MAX_BITS >= 64 */
 
 #define __stat64 _stat64
 
 
 #define __stat64 _stat64
 
-#define _STAT_DEFINED
 #endif /* !_STAT_DEFINED */
 
 #define _S_IFMT 0xF000
 #endif /* !_STAT_DEFINED */
 
 #define _S_IFMT 0xF000
@@ -189,52 +147,16 @@ extern "C" {
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat);
   _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _fstat64(int _FileDes,struct _stat64 *_Stat);
   _CRTIMP int __cdecl _fstat32i64(int _FileDes,struct _stat32i64 *_Stat);
-  int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat);
-  __CRT_INLINE int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat)
-  {
-    struct _stat64 st;
-    int ret=_fstat64(_FileDes,&st);
-    _Stat->st_dev=st.st_dev;
-    _Stat->st_ino=st.st_ino;
-    _Stat->st_mode=st.st_mode;
-    _Stat->st_nlink=st.st_nlink;
-    _Stat->st_uid=st.st_uid;
-    _Stat->st_gid=st.st_gid;
-    _Stat->st_rdev=st.st_rdev;
-    _Stat->st_size=(_off_t) st.st_size;
-    _Stat->st_atime=st.st_atime;
-    _Stat->st_mtime=st.st_mtime;
-    _Stat->st_ctime=st.st_ctime;
-    return ret;
-  }
-
+  _CRTIMP int __cdecl _fstat64i32(int _FileDes,struct _stat64i32 *_Stat);
   _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat);
   _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat);
   _CRTIMP int __cdecl _stat64(const char *_Name,struct _stat64 *_Stat);
   _CRTIMP int __cdecl _stat32i64(const char *_Name,struct _stat32i64 *_Stat);
-  int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat);
-  __CRT_INLINE int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat)
-  {
-    struct _stat64 st;
-    int ret=_stat64(_Name,&st);
-    _Stat->st_dev=st.st_dev;
-    _Stat->st_ino=st.st_ino;
-    _Stat->st_mode=st.st_mode;
-    _Stat->st_nlink=st.st_nlink;
-    _Stat->st_uid=st.st_uid;
-    _Stat->st_gid=st.st_gid;
-    _Stat->st_rdev=st.st_rdev;
-    _Stat->st_size=(_off_t) st.st_size;
-    _Stat->st_atime=st.st_atime;
-    _Stat->st_mtime=st.st_mtime;
-    _Stat->st_ctime=st.st_ctime;
-    return ret;
-  }
-#endif
+  _CRTIMP int __cdecl _stat64i32(const char *_Name,struct _stat64i32 *_Stat);
+#endif /* _INTEGRAL_MAX_BITS >= 64 */
 
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
   _CRTIMP int __cdecl _wstat(const wchar_t *_Name,struct _stat *_Stat);
   _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
 
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
   _CRTIMP int __cdecl _wstat(const wchar_t *_Name,struct _stat *_Stat);
   _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
-  _CRTIMP int __cdecl _wstati64(const wchar_t *_Name,struct _stati64 *_Stat);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
   _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
   _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
@@ -242,6 +164,55 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
+
+/** Compatibility definitons *************************************************/
+
+#if !defined(RC_INVOKED)
+
+#ifdef _USE_32BIT_TIME_T
+ #define _fstat32 _fstat
+ #define _fstat32i64 _fstati64
+ #define _fstat64i32 _fstat64
+#else
+ #define _fstat64i32 _fstat
+  __CRT_INLINE int __cdecl _fstat32(int _FileDes, struct _stat32 *_Stat)
+  {
+    struct _stat _Stat64;
+    int ret = _fstat(_FileDes, &_Stat64);
+    _Stat->st_dev = _Stat64.st_dev;
+    _Stat->st_ino = _Stat64.st_ino;
+    _Stat->st_mode = _Stat64.st_mode;
+    _Stat->st_nlink = _Stat64.st_nlink;
+    _Stat->st_uid = _Stat64.st_uid;
+    _Stat->st_gid = _Stat64.st_gid;
+    _Stat->st_rdev = _Stat64.st_rdev;
+    _Stat->st_size = _Stat64.st_size;
+    _Stat->st_atime = _Stat64.st_atime;
+    _Stat->st_mtime = _Stat64.st_mtime;
+    _Stat->st_ctime = _Stat64.st_ctime;
+    return ret;
+  }
+  __CRT_INLINE int __cdecl _fstat32i64(int _FileDes, struct _stat32i64 *_Stat)
+  {
+    struct _stat64 _Stat64;
+    int ret = _fstat64(_FileDes, &_Stat64);
+    _Stat->st_dev = _Stat64.st_dev;
+    _Stat->st_ino = _Stat64.st_ino;
+    _Stat->st_mode = _Stat64.st_mode;
+    _Stat->st_nlink = _Stat64.st_nlink;
+    _Stat->st_uid = _Stat64.st_uid;
+    _Stat->st_gid = _Stat64.st_gid;
+    _Stat->st_rdev = _Stat64.st_rdev;
+    _Stat->st_size = _Stat64.st_size;
+    _Stat->st_atime = _Stat64.st_atime;
+    _Stat->st_mtime = _Stat64.st_mtime;
+    _Stat->st_ctime = _Stat64.st_ctime;
+    return ret;
+  }
+#endif /* _USE_32BIT_TIME_T */
+
+#endif /* !defined(RC_INVOKED) */
+
 #ifndef        NO_OLDNAMES
 #define        _S_IFBLK        0x3000  /* Block: Is this ever set under w32? */
 
 #ifndef        NO_OLDNAMES
 #define        _S_IFBLK        0x3000  /* Block: Is this ever set under w32? */
 
@@ -271,13 +242,10 @@ extern "C" {
 #define        S_ISBLK(m)      (((m) & S_IFMT) == S_IFBLK)
 #define        S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
 
 #define        S_ISBLK(m)      (((m) & S_IFMT) == S_IFBLK)
 #define        S_ISREG(m)      (((m) & S_IFMT) == S_IFREG)
 
-#endif
-
-#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
-int __cdecl stat(const char *_Filename,struct stat *_Stat);
-int __cdecl fstat(int _Desc,struct stat *_Stat);
-int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat);
-
+#if !defined (RC_INVOKED)
+  _CRTIMP int __cdecl stat(const char *_Filename,struct stat *_Stat);
+  _CRTIMP int __cdecl fstat(int _Desc,struct stat *_Stat);
+  _CRTIMP int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat);
 __CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) {
   return _fstat(_Desc,(struct _stat *)_Stat);
 }
 __CRT_INLINE int __cdecl fstat(int _Desc,struct stat *_Stat) {
   return _fstat(_Desc,(struct _stat *)_Stat);
 }
@@ -292,6 +260,9 @@ __CRT_INLINE int __cdecl wstat(const wchar_t *_Filename,struct stat *_Stat) {
 
 #endif
 
 
 #endif
 
+#endif /* !NO_OLDNAMES */
+
+
 #ifdef __cplusplus
 }
 #endif
 #ifdef __cplusplus
 }
 #endif
index 1cf3ce8..574c970 100644 (file)
@@ -3,10 +3,10 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#ifndef _TIMEB_H_
-#define _TIMEB_H_
+#ifndef _INC_TIMEB
+#define _INC_TIMEB
 
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _WIN32
 #error Only Win32 target is supported!
 
 #ifndef _WIN32
 #error Only Win32 target is supported!
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#else
-#if _INTEGRAL_MAX_BITS < 64
-#define _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-  typedef long __time32_t;
-#define _TIME32_T_DEFINED
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#if _INTEGRAL_MAX_BITS >= 64
-  typedef __int64 __time64_t;
-#endif
-#define _TIME64_T_DEFINED
-#endif
-
-#ifndef _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#define _TIME_T_DEFINED
-#endif
-
 #ifndef _TIMEB_DEFINED
 #define _TIMEB_DEFINED
 
 #ifndef _TIMEB_DEFINED
 #define _TIMEB_DEFINED
 
+  struct _timeb {
+    time_t time;
+    unsigned short millitm;
+    short timezone;
+    short dstflag;
+  };
+
   struct __timeb32 {
     __time32_t time;
     unsigned short millitm;
   struct __timeb32 {
     __time32_t time;
     unsigned short millitm;
@@ -81,41 +53,20 @@ extern "C" {
   };
 #endif
 
   };
 #endif
 
-#ifdef _USE_32BIT_TIME_T
-#define _timeb __timeb32
-#define _ftime _ftime32
-#else
-#define _timeb __timeb64
-#define _ftime _ftime64
-#endif
-#endif
+#endif /* !_TIMEB_DEFINED */
 
 
-  _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
+  _CRTIMP void __cdecl _ftime(struct _timeb *_Time);
+  _CRT_INSECURE_DEPRECATE(_ftime32_s) _CRTIMP void __cdecl _ftime32(struct __timeb32 *_Time);
+  _CRTIMP errno_t __cdecl _ftime32_s(struct __timeb32 *_Time);
 #if _INTEGRAL_MAX_BITS >= 64
 #if _INTEGRAL_MAX_BITS >= 64
-  _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
-#endif
-
-#ifndef TIMESPEC_DEFINED
-#define TIMESPEC_DEFINED
-struct timespec {
-  time_t  tv_sec;   /* Seconds */
-  long    tv_nsec;  /* Nanoseconds */
-};
-
-struct itimerspec {
-  struct timespec  it_interval;  /* Timer period */
-  struct timespec  it_value;     /* Timer expiration */
-};
+  _CRT_INSECURE_DEPRECATE(_ftime64_s) _CRTIMP void __cdecl _ftime64(struct __timeb64 *_Time);
+  _CRTIMP errno_t __cdecl _ftime64_s(struct __timeb64 *_Time);
 #endif
 
 #endif
 
-#if !defined (RC_INVOKED) && !defined (NO_OLDNAMES)
-#ifdef _USE_32BIT_TIME_T
+#ifndef NO_OLDNAMES
+#if !defined (RC_INVOKED)
 __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
 __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
-  _ftime32((struct __timeb32 *)_Tmb);
-}
-#else
-__CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
-  _ftime64((struct __timeb64 *)_Tmb);
+  _ftime((struct _timeb *)_Tmb);
 }
 #endif
 #endif
 }
 #endif
 #endif
@@ -127,4 +78,5 @@ __CRT_INLINE void __cdecl ftime(struct timeb *_Tmb) {
 #pragma pack(pop)
 
 #include <sec_api/sys/timeb_s.h>
 #pragma pack(pop)
 
 #include <sec_api/sys/timeb_s.h>
-#endif
+
+#endif /* !_INC_TIMEB */
index 5b47492..8ba3df7 100644 (file)
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#include <_mingw.h>
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#else
-#if _INTEGRAL_MAX_BITS < 64
-#define _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-typedef long __time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-#if _INTEGRAL_MAX_BITS >= 64
-typedef __int64 __time64_t;
-#endif
-#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-typedef __time32_t time_t;
-#else
-typedef __time64_t time_t;
-#endif
-#endif
+#include <crtdefs.h>
 
 #ifndef _INO_T_DEFINED
 #define _INO_T_DEFINED
 
 #ifndef _INO_T_DEFINED
 #define _INO_T_DEFINED
@@ -59,58 +28,12 @@ typedef unsigned int dev_t;
 #endif
 #endif
 
 #endif
 #endif
 
-#ifndef _PID_T_
-#define        _PID_T_
-#ifndef _WIN64
-typedef int    _pid_t;
-#else
-typedef __int64        _pid_t;
-#endif
-
-#ifndef        NO_OLDNAMES
-typedef _pid_t pid_t;
-#endif
-#endif /* Not _PID_T_ */
-
-#ifndef _MODE_T_
-#define        _MODE_T_
-typedef unsigned short _mode_t;
-
-#ifndef        NO_OLDNAMES
-typedef _mode_t        mode_t;
-#endif
-#endif /* Not _MODE_T_ */
-
 #ifndef _OFF_T_DEFINED
 #define _OFF_T_DEFINED
 #ifndef _OFF_T_DEFINED
 #define _OFF_T_DEFINED
-#ifndef _OFF_T_
-#define _OFF_T_
   typedef long _off_t;
   typedef long _off_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
+# ifndef NO_OLDNAMES
   typedef long off_t;
   typedef long off_t;
-#endif
-#endif
+# endif
 #endif
 
 #endif
 
-#ifndef _OFF64_T_DEFINED
-#define _OFF64_T_DEFINED
-  typedef long long _off64_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
-  typedef long long off64_t;
-#endif
-#endif
-
-#ifndef TIMESPEC_DEFINED
-#define TIMESPEC_DEFINED
-struct timespec {
-  time_t  tv_sec;   /* Seconds */
-  long    tv_nsec;  /* Nanoseconds */
-};
-
-struct itimerspec {
-  struct timespec  it_interval;  /* Timer period */
-  struct timespec  it_value;     /* Timer expiration */
-};
-#endif
-
-#endif
+#endif /* !_INC_TYPES */
index 5b09415..13925ec 100644 (file)
@@ -10,7 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#define _WCHAR_T_DEFINED
-#endif
-
-#ifdef _USE_32BIT_TIME_T
-#ifdef _WIN64
-#undef _USE_32BIT_TIME_T
-#endif
-#else
-#if _INTEGRAL_MAX_BITS < 64
-#define _USE_32BIT_TIME_T
-#endif
-#endif
-
-#ifndef _TIME32_T_DEFINED
-#define _TIME32_T_DEFINED
-  typedef long __time32_t;
-#endif
-
-#ifndef _TIME64_T_DEFINED
-#define _TIME64_T_DEFINED
-#if _INTEGRAL_MAX_BITS >= 64
-  typedef __int64 __time64_t;
-#endif
-#endif
-
-#ifndef _TIME_T_DEFINED
-#define _TIME_T_DEFINED
-#ifdef _USE_32BIT_TIME_T
-  typedef __time32_t time_t;
-#else
-  typedef __time64_t time_t;
-#endif
-#endif
-
 #ifndef _UTIMBUF_DEFINED
 #define _UTIMBUF_DEFINED
 
 #ifndef _UTIMBUF_DEFINED
 #define _UTIMBUF_DEFINED
 
@@ -89,13 +49,13 @@ extern "C" {
     __time32_t modtime;
   };
 #endif
     __time32_t modtime;
   };
 #endif
-#endif
+#endif /* !_UTIMBUF_DEFINED */
 
 
-  _CRTIMP int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf);
+  _CRTIMP int __cdecl _utime(const char *_Filename,struct _utimbuf *_Time);
   _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
   _CRTIMP int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Time);
-  _CRTIMP int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf);
+  _CRTIMP int __cdecl _futime(int _FileDes,struct _utimbuf *_Time);
   _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
   _CRTIMP int __cdecl _futime32(int _FileDes,struct __utimbuf32 *_Time);
-  _CRTIMP int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf);
+  _CRTIMP int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Time);
   _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
   _CRTIMP int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Time);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _utime64(const char *_Filename,struct __utimbuf64 *_Time);
@@ -103,38 +63,25 @@ extern "C" {
   _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
 #endif
 
   _CRTIMP int __cdecl _wutime64(const wchar_t *_Filename,struct __utimbuf64 *_Time);
 #endif
 
-// Do it like this to keep compatibility to MSVC while using msvcrt.dll
 #ifndef RC_INVOKED
 #ifndef RC_INVOKED
- #ifdef _USE_32BIT_TIME_T
-  __CRT_INLINE int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Utimbuf) {
-    return _utime(_Filename,(struct _utimbuf *)_Utimbuf);
-  }
-  __CRT_INLINE int __cdecl _futime32(int _Desc,struct __utimbuf32 *_Utimbuf) {
-    return _futime(_Desc,(struct _utimbuf *)_Utimbuf);
-  }
-  __CRT_INLINE int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Utimbuf) {
-    return _wutime(_Filename,(struct _utimbuf *)_Utimbuf);
-  }
- #else // !_USE_32BIT_TIME_T
-  #ifndef _WIN64
-  __CRT_INLINE int __cdecl _utime(const char *_Filename,struct _utimbuf *_Utimbuf) {
-    return _utime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
-  }
-  __CRT_INLINE int __cdecl _futime(int _Desc,struct _utimbuf *_Utimbuf) {
-    return _futime64(_Desc,(struct __utimbuf64 *)_Utimbuf);
-  }
-  __CRT_INLINE int __cdecl _wutime(const wchar_t *_Filename,struct _utimbuf *_Utimbuf) {
-    return _wutime64(_Filename,(struct __utimbuf64 *)_Utimbuf);
-  }
-  #endif
- #endif // _USE_32BIT_TIME_T
-#endif // RC_INVOKED
+#ifdef _USE_32BIT_TIME_T
+__CRT_INLINE int __cdecl _utime32(const char *_Filename,struct __utimbuf32 *_Utimbuf) {
+  return _utime(_Filename,(struct _utimbuf *)_Utimbuf);
+}
+__CRT_INLINE int __cdecl _futime32(int _Desc,struct __utimbuf32 *_Utimbuf) {
+  return _futime(_Desc,(struct _utimbuf *)_Utimbuf);
+}
+__CRT_INLINE int __cdecl _wutime32(const wchar_t *_Filename,struct __utimbuf32 *_Utimbuf) {
+  return _wutime(_Filename,(struct _utimbuf *)_Utimbuf);
+}
+#endif
 
 #ifndef        NO_OLDNAMES
 __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
   return _utime(_Filename,(struct _utimbuf *)_Utimbuf);
 }
 #endif
 
 #ifndef        NO_OLDNAMES
 __CRT_INLINE int __cdecl utime(const char *_Filename,struct utimbuf *_Utimbuf) {
   return _utime(_Filename,(struct _utimbuf *)_Utimbuf);
 }
 #endif
+#endif
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
index 08c6c1c..b047e3a 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_TCHAR
 #define _INC_TCHAR
 
 #ifndef _INC_TCHAR
 #define _INC_TCHAR
@@ -79,12 +79,14 @@ extern "C" {
 
 #define _WConst_return _CONST_RETURN
 
 
 #define _WConst_return _CONST_RETURN
 
-#ifdef _UNICODE
-
 #ifdef __cplusplus
 }
 #endif
 
 #ifdef __cplusplus
 }
 #endif
 
+
+#ifdef _UNICODE
+/** UNICODE ******************************************************************/
+
 #include <wchar.h>
 
 #ifdef __cplusplus
 #include <wchar.h>
 
 #ifdef __cplusplus
@@ -479,10 +481,7 @@ extern "C" {
 #define _tseekdir      _wseekdir
 
 #else
 #define _tseekdir      _wseekdir
 
 #else
-
-#ifdef __cplusplus
-}
-#endif
+/** ANSI *********************************************************************/
 
 #include <string.h>
 
 
 #include <string.h>
 
@@ -753,6 +752,7 @@ extern "C" {
 #define _tsetlocale setlocale
 
 #ifdef _MBCS
 #define _tsetlocale setlocale
 
 #ifdef _MBCS
+/** MBCS *********************************************************************/
 
 #ifdef __cplusplus
 }
 
 #ifdef __cplusplus
 }
@@ -851,7 +851,9 @@ extern "C" {
 #define _tclen _mbclen
 #define _tccpy _mbccpy
 #define _tccpy_l _mbccpy_l
 #define _tclen _mbclen
 #define _tccpy _mbccpy
 #define _tccpy_l _mbccpy_l
-#else
+
+
+#else /* !_MB_MAP_DIRECT */
 
   _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
   _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
 
   _CRTIMP _CONST_RETURN char *__cdecl _tcschr(const char *_Str,unsigned int _Val);
   _CRTIMP size_t __cdecl _tcscspn(const char *_Str,const char *_Control);
@@ -957,7 +959,9 @@ extern "C" {
 #define _istlead _ismbblead
 #define _istleadbyte isleadbyte
 #define _istleadbyte_l _isleadbyte_l
 #define _istlead _ismbblead
 #define _istleadbyte isleadbyte
 #define _istleadbyte_l _isleadbyte_l
-#else
+
+#else /* !_MBCS */
+/** SBCS *********************************************************************/
 
 #ifndef __TCHAR_DEFINED
 #define __TCHAR_DEFINED
 
 #ifndef __TCHAR_DEFINED
 #define __TCHAR_DEFINED
@@ -1106,8 +1110,10 @@ extern "C" {
 #define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
 #define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
 #define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
 #define _strtok_l(_String,_Delimiters,_Locale) (strtok(_String,_Delimiters))
 #define _strnset_l(_Destination,_Value,_Count,_Locale) (_strnset(_Destination,_Value,_Count))
 #define _strset_l(_Destination,_Value,_Locale) (_strset(_Destination,_Value))
-#endif
-#endif
+
+#endif /* !_MBCS */
+#endif  /* !UNICODE */
+/*****************************************************************************/
 
 #define _T(x) __T(x)
 #define _TEXT(x) __T(x)
 
 #define _T(x) __T(x)
 #define _TEXT(x) __T(x)
index 38f8c18..d714fa6 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _TIME_H_
 #define _TIME_H_
 
 #ifndef _TIME_H_
 #define _TIME_H_
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _WIN32
 #error Only Win32 target is supported!
 
 #ifndef _WIN32
 #error Only Win32 target is supported!
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
-#ifndef _CRTIMP
-#define _CRTIMP __declspec(dllimport)
-#endif
-
-#ifndef _WCHAR_T_DEFINED
-#define _WCHAR_T_DEFINED
-  typedef unsigned short wchar_t;
-#endif
-
 #ifndef _TIME32_T_DEFINED
 #define _TIME32_T_DEFINED
   typedef long __time32_t;
 #ifndef _TIME32_T_DEFINED
 #define _TIME32_T_DEFINED
   typedef long __time32_t;
@@ -71,20 +62,6 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
-#ifndef _SSIZE_T_DEFINED
-#define _SSIZE_T_DEFINED
-#undef ssize_t
-#ifdef _WIN64
-#if defined(__GNUC__) && defined(__STRICT_ANSI__)
-  typedef int ssize_t __attribute__ ((mode (DI)));
-#else
-  typedef __int64 ssize_t;
-#endif
-#else
-  typedef int ssize_t;
-#endif
-#endif
-
 #ifndef NULL
 #ifdef __cplusplus
 #define NULL 0
 #ifndef NULL
 #ifdef __cplusplus
 #define NULL 0
@@ -93,17 +70,6 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
-/*
-#ifdef _USE_32BIT_TIME_T
-#define _localtime32 localtime
-#define _difftime32    difftime
-#define _ctime32       ctime
-#define _gmtime32      gmtime
-#define _mktime32      mktime
-#define _time32        time
-#endif
-*/
-
 #ifndef _TM_DEFINED
 #define _TM_DEFINED
   struct tm {
 #ifndef _TM_DEFINED
 #define _TM_DEFINED
   struct tm {
@@ -121,79 +87,97 @@ extern "C" {
 
 #define CLOCKS_PER_SEC 1000
 
 
 #define CLOCKS_PER_SEC 1000
 
-  __MINGW_IMPORT int _daylight;
-  __MINGW_IMPORT long _dstbias;
-  __MINGW_IMPORT long _timezone;
-  __MINGW_IMPORT char * _tzname[2];
+  _CRTDATA(extern int _daylight);
+  _CRTDATA(extern long _dstbias);
+  _CRTDATA(extern long _timezone);
+  _CRTDATA(extern char * _tzname[2]);
 
   _CRTIMP errno_t __cdecl _get_daylight(int *_Daylight);
   _CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias);
   _CRTIMP errno_t __cdecl _get_timezone(long *_Timezone);
   _CRTIMP errno_t __cdecl _get_tzname(size_t *_ReturnValue,char *_Buffer,size_t _SizeInBytes,int _Index);
 
   _CRTIMP errno_t __cdecl _get_daylight(int *_Daylight);
   _CRTIMP errno_t __cdecl _get_dstbias(long *_Daylight_savings_bias);
   _CRTIMP errno_t __cdecl _get_timezone(long *_Timezone);
   _CRTIMP errno_t __cdecl _get_tzname(size_t *_ReturnValue,char *_Buffer,size_t _SizeInBytes,int _Index);
-  char *__cdecl asctime(const struct tm *_Tm);
-  _CRTIMP char *__cdecl _ctime32(const __time32_t *_Time);
-  clock_t __cdecl clock(void);
+
+  _CRTIMP _CRT_INSECURE_DEPRECATE(asctime_s) char *__cdecl asctime(const struct tm *_Tm);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_ctime32_s) char *__cdecl _ctime32(const __time32_t *_Time);
+  _CRTIMP clock_t __cdecl clock(void);
   _CRTIMP double __cdecl _difftime32(__time32_t _Time1,__time32_t _Time2);
   _CRTIMP double __cdecl _difftime32(__time32_t _Time1,__time32_t _Time2);
-  _CRTIMP struct tm *__cdecl _gmtime32(const __time32_t *_Time);
-  _CRTIMP struct tm *__cdecl _localtime32(const __time32_t *_Time);
-  size_t __cdecl strftime(char *_Buf,size_t _SizeInBytes,const char *_Format,const struct tm *_Tm);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_gmtime32_s) struct tm *__cdecl _gmtime32(const __time32_t *_Time);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_localtime32_s) struct tm *__cdecl _localtime32(const __time32_t *_Time);
+  _CRTIMP size_t __cdecl strftime(char *_Buf,size_t _SizeInBytes,const char *_Format,const struct tm *_Tm);
   _CRTIMP size_t __cdecl _strftime_l(char *_Buf,size_t _Max_size,const char *_Format,const struct tm *_Tm,_locale_t _Locale);
   _CRTIMP char *__cdecl _strdate(char *_Buffer);
   _CRTIMP char *__cdecl _strtime(char *_Buffer);
   _CRTIMP __time32_t __cdecl _time32(__time32_t *_Time);
   _CRTIMP __time32_t __cdecl _mktime32(struct tm *_Tm);
   _CRTIMP __time32_t __cdecl _mkgmtime32(struct tm *_Tm);
   _CRTIMP size_t __cdecl _strftime_l(char *_Buf,size_t _Max_size,const char *_Format,const struct tm *_Tm,_locale_t _Locale);
   _CRTIMP char *__cdecl _strdate(char *_Buffer);
   _CRTIMP char *__cdecl _strtime(char *_Buffer);
   _CRTIMP __time32_t __cdecl _time32(__time32_t *_Time);
   _CRTIMP __time32_t __cdecl _mktime32(struct tm *_Tm);
   _CRTIMP __time32_t __cdecl _mkgmtime32(struct tm *_Tm);
-#if defined (_POSIX_) || defined(__GNUC__)
-  void __cdecl tzset(void);
-#endif
   _CRTIMP void __cdecl _tzset(void);
   _CRTIMP void __cdecl _tzset(void);
+  _CRT_OBSOLETE(GetLocalTime) unsigned __cdecl _getsystime(struct tm *_Tm);
+  _CRT_OBSOLETE(GetLocalTime) unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec);
+
+  _CRTIMP errno_t __cdecl _ctime32_s(char *_Buf,size_t _SizeInBytes,const __time32_t *_Time);
+  _CRTIMP errno_t __cdecl _gmtime32_s(struct tm *_Tm,const __time32_t *_Time);
+  _CRTIMP errno_t __cdecl _localtime32_s(struct tm *_Tm,const __time32_t *_Time);
+  _CRTIMP errno_t __cdecl _strdate_s(char *_Buf,size_t _SizeInBytes);
+  _CRTIMP errno_t __cdecl _strtime_s(char *_Buf ,size_t _SizeInBytes);
 
 #if _INTEGRAL_MAX_BITS >= 64
 
 #if _INTEGRAL_MAX_BITS >= 64
-  double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2);
-  _CRTIMP char *__cdecl _ctime64(const __time64_t *_Time);
-  _CRTIMP struct tm *__cdecl _gmtime64(const __time64_t *_Time);
-  _CRTIMP struct tm *__cdecl _localtime64(const __time64_t *_Time);
+  _CRTIMP double __cdecl _difftime64(__time64_t _Time1,__time64_t _Time2);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_ctime64_s) char *__cdecl _ctime64(const __time64_t *_Time);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_gmtime64_s) struct tm *__cdecl _gmtime64(const __time64_t *_Time);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_localtime64_s) struct tm *__cdecl _localtime64(const __time64_t *_Time);
   _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time);
   _CRTIMP __time64_t __cdecl _mktime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _mkgmtime64(struct tm *_Tm);
   _CRTIMP __time64_t __cdecl _time64(__time64_t *_Time);
+
+  _CRTIMP errno_t __cdecl _ctime64_s(char *_Buf,size_t _SizeInBytes,const __time64_t *_Time);
+  _CRTIMP errno_t __cdecl _gmtime64_s(struct tm *_Tm,const __time64_t *_Time);
+  _CRTIMP errno_t __cdecl _localtime64_s(struct tm *_Tm,const __time64_t *_Time);
 #endif
 #endif
-  unsigned __cdecl _getsystime(struct tm *_Tm);
-  unsigned __cdecl _setsystime(struct tm *_Tm,unsigned _MilliSec);
 
 #ifndef _WTIME_DEFINED
 
 #ifndef _WTIME_DEFINED
-  _CRTIMP wchar_t *__cdecl _wasctime(const struct tm *_Tm);
-  _CRTIMP wchar_t *__cdecl _wctime32(const __time32_t *_Time);
-  size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm);
+#define _WTIME_DEFINED
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_wasctime_s) wchar_t *__cdecl _wasctime(const struct tm *_Tm);
+  _CRTIMP wchar_t *__cdecl _wctime(const time_t *_Time);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_wctime32_s) wchar_t *__cdecl _wctime32(const __time32_t *_Time);
+  _CRTIMP size_t __cdecl wcsftime(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm);
   _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
   _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
   _CRTIMP size_t __cdecl _wcsftime_l(wchar_t *_Buf,size_t _SizeInWords,const wchar_t *_Format,const struct tm *_Tm,_locale_t _Locale);
   _CRTIMP wchar_t *__cdecl _wstrdate(wchar_t *_Buffer);
   _CRTIMP wchar_t *__cdecl _wstrtime(wchar_t *_Buffer);
+
+  _CRTIMP errno_t __cdecl _wasctime_s(wchar_t *_Buf,size_t _SizeInWords,const struct tm *_Tm);
+  _CRTIMP errno_t __cdecl _wctime32_s(wchar_t *_Buf,size_t _SizeInWords,const __time32_t *_Time);
+  _CRTIMP errno_t __cdecl _wstrdate_s(wchar_t *_Buf,size_t _SizeInWords);
+  _CRTIMP errno_t __cdecl _wstrtime_s(wchar_t *_Buf,size_t _SizeInWords);
 #if _INTEGRAL_MAX_BITS >= 64
 #if _INTEGRAL_MAX_BITS >= 64
-  _CRTIMP wchar_t *__cdecl _wctime64(const __time64_t *_Time);
+  _CRTIMP _CRT_INSECURE_DEPRECATE(_wctime64_s) wchar_t *__cdecl _wctime64(const __time64_t *_Time);
+  _CRTIMP errno_t __cdecl _wctime64_s(wchar_t *_Buf,size_t _SizeInWords,const __time64_t *_Time);
 #endif
 
 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
 #define _INC_WTIME_INL
 #ifdef _USE_32BIT_TIME_T
 #endif
 
 #if !defined (RC_INVOKED) && !defined (_INC_WTIME_INL)
 #define _INC_WTIME_INL
 #ifdef _USE_32BIT_TIME_T
-__CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime32(_Time); }
+/* Do it like this to be compatible to msvcrt.dll on 32 bit windows XP and before */
+__CRT_INLINE wchar_t *__cdecl _wctime32(const time_t *_Time) { return _wctime(_Time); }
+__CRT_INLINE errno_t _wctime32_s(wchar_t *_Buffer, size_t _SizeInWords,const __time32_t *_Time) { return _wctime32_s(_Buffer, _SizeInWords, _Time); }
 #else
 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
 #else
 __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_Time); }
+__CRT_INLINE errno_t _wctime_s(wchar_t *_Buffer, size_t _SizeInWords,const time_t *_Time) { return _wctime64_s(_Buffer, _SizeInWords, _Time); }
 #endif
 #endif
 
 #endif
 #endif
 
-#define _WTIME_DEFINED
-#endif
+#endif /* !_WTIME_DEFINED */
 
 
-#ifndef RC_INVOKED
-double __cdecl difftime(time_t _Time1,time_t _Time2);
-char *__cdecl ctime(const time_t *_Time);
-struct tm *__cdecl gmtime(const time_t *_Time);
-struct tm *__cdecl localtime(const time_t *_Time);
-struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *);
+ _CRTIMP double __cdecl difftime(time_t _Time1,time_t _Time2);
+ _CRTIMP char *__cdecl ctime(const time_t *_Time);
+ _CRTIMP struct tm *__cdecl gmtime(const time_t *_Time);
+ _CRTIMP struct tm *__cdecl localtime(const time_t *_Time);
+ _CRTIMP struct tm *__cdecl localtime_r(const time_t *_Time,struct tm *);
 
 
-_CRTIMP time_t __cdecl mktime(struct tm *_Tm);
-_CRTIMP time_t __cdecl _mkgmtime(struct tm *_Tm);
-_CRTIMP time_t __cdecl time(time_t *_Time);
+ _CRTIMP time_t __cdecl mktime(struct tm *_Tm);
+ _CRTIMP time_t __cdecl _mkgmtime(struct tm *_Tm);
+ _CRTIMP time_t __cdecl time(time_t *_Time);
 
 
+#ifndef RC_INVOKED
 #ifdef _USE_32BIT_TIME_T
 #if 0
 __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); }
 #ifdef _USE_32BIT_TIME_T
 #if 0
 __CRT_INLINE double __cdecl difftime(time_t _Time1,time_t _Time2) { return _difftime32(_Time1,_Time2); }
@@ -224,17 +208,6 @@ __CRT_INLINE time_t __cdecl time(time_t *_Time) { return _time64(_Time); }
   void __cdecl tzset(void);
 #endif
 
   void __cdecl tzset(void);
 #endif
 
-#ifndef _TIMEVAL_DEFINED /* also in winsock[2].h */
-#define _TIMEVAL_DEFINED
-struct timeval {
-  long tv_sec;
-  long tv_usec;
-};
-#define timerisset(tvp) ((tvp)->tv_sec || (tvp)->tv_usec)
-#define timercmp(tvp,uvp,cmp) ((tvp)->tv_sec cmp (uvp)->tv_sec || (tvp)->tv_sec==(uvp)->tv_sec && (tvp)->tv_usec cmp (uvp)->tv_usec)
-#define timerclear(tvp) (tvp)->tv_sec = (tvp)->tv_usec = 0
-#endif /* _TIMEVAL_DEFINED */
-
 #ifdef __cplusplus
 }
 #endif
 #ifdef __cplusplus
 }
 #endif
@@ -243,8 +216,5 @@ struct timeval {
 
 #include <sec_api/time_s.h>
 
 
 #include <sec_api/time_s.h>
 
-/* Adding timespec definition.  */
-#include <sys/timeb.h>
-
 #endif /* End _TIME_H_ */
 
 #endif /* End _TIME_H_ */
 
index 68c25bd..e7bd118 100644 (file)
@@ -3,7 +3,7 @@
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
  * This file is part of the w64 mingw-runtime package.
  * No warranty is given; refer to the file DISCLAIMER within this package.
  */
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #ifndef _INC_TYPEINFO
 #define _INC_TYPEINFO
 
 #ifndef _INC_TYPEINFO
 #define _INC_TYPEINFO
index eae1a2e..eda8896 100644 (file)
@@ -10,7 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #undef _CRT_PACKING
 #define _CRT_PACKING 8
 
 #undef _CRT_PACKING
 #define _CRT_PACKING 8
index 7eef039..4e0cd7c 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _INC_WCHAR
 #define _INC_WCHAR
 
 #ifndef _INC_WCHAR
 #define _INC_WCHAR
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
@@ -21,16 +21,6 @@ extern "C" {
 #define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
 #endif
 
 #define WCHAR_MAX ((wchar_t)-1) /* UINT16_MAX */
 #endif
 
-#ifndef __GNUC_VA_LIST
-#define __GNUC_VA_LIST
-  typedef __builtin_va_list __gnuc_va_list;
-#endif
-
-#ifndef _VA_LIST_DEFINED
-#define _VA_LIST_DEFINED
-  typedef __gnuc_va_list va_list;
-#endif
-
 #ifndef WEOF
 #define WEOF (wint_t)(0xFFFF)
 #endif
 #ifndef WEOF
 #define WEOF (wint_t)(0xFFFF)
 #endif
@@ -52,15 +42,18 @@ extern "C" {
 
 #ifndef _STDIO_DEFINED
   _CRTIMP FILE *__cdecl __iob_func(void);
 
 #ifndef _STDIO_DEFINED
   _CRTIMP FILE *__cdecl __iob_func(void);
-  _CRTIMP extern FILE _iob[];
+  _CRTDATA(extern FILE _iob[];)
+#ifdef _M_CEE_PURE
+#define _iob __iob_func()
+#endif
 #endif
 
 #ifndef _STDSTREAM_DEFINED
 #endif
 
 #ifndef _STDSTREAM_DEFINED
-#define stdin (&__iob_func()[0])
-#define stdout (&__iob_func()[1])
-#define stderr (&__iob_func()[2])
 #define _STDSTREAM_DEFINED
 #define _STDSTREAM_DEFINED
-#endif
+#define stdin (&_iob[0])
+#define stdout (&_iob[1])
+#define stderr (&_iob[1])
+#endif /* !_STDSTREAM_DEFINED */
 
 #ifndef _FSIZE_T_DEFINED
   typedef unsigned long _fsize_t;
 
 #ifndef _FSIZE_T_DEFINED
   typedef unsigned long _fsize_t;
@@ -68,6 +61,15 @@ extern "C" {
 #endif
 
 #ifndef _WFINDDATA_T_DEFINED
 #endif
 
 #ifndef _WFINDDATA_T_DEFINED
+  struct _wfinddata_t {
+    unsigned attrib;
+    time_t time_create;
+    time_t time_access;
+    time_t time_write;
+    _fsize_t size;
+    wchar_t name[260];
+  };
+
   struct _wfinddata32_t {
     unsigned attrib;
     __time32_t time_create;
   struct _wfinddata32_t {
     unsigned attrib;
     __time32_t time_create;
@@ -77,7 +79,15 @@ extern "C" {
     wchar_t name[260];
   };
 
     wchar_t name[260];
   };
 
-/* #if _INTEGRAL_MAX_BITS >= 64 */
+#if _INTEGRAL_MAX_BITS >= 64
+  struct _wfinddatai64_t {
+    unsigned attrib;
+    time_t time_create;
+    time_t time_access;
+    time_t time_write;
+    __int64 size;
+    wchar_t name[260];
+  };
 
   struct _wfinddata32i64_t {
     unsigned attrib;
 
   struct _wfinddata32i64_t {
     unsigned attrib;
@@ -105,28 +115,10 @@ extern "C" {
     __int64 size;
     wchar_t name[260];
   };
     __int64 size;
     wchar_t name[260];
   };
-/* #endif */
-
-#ifdef _USE_32BIT_TIME_T
-#define _wfinddata_t _wfinddata32_t
-#define _wfinddatai64_t _wfinddata32i64_t
-
-#define _wfindfirst _wfindfirst32
-#define _wfindnext _wfindnext32
-#define _wfindfirsti64 _wfindfirst32i64
-#define _wfindnexti64 _wfindnext32i64
-#else
-#define _wfinddata_t _wfinddata64i32_t
-#define _wfinddatai64_t _wfinddata64_t
-
-#define _wfindfirst _wfindfirst64i32
-#define _wfindnext _wfindnext64i32
-#define _wfindfirsti64 _wfindfirst64
-#define _wfindnexti64 _wfindnext64
 #endif
 
 #define _WFINDDATA_T_DEFINED
 #endif
 
 #define _WFINDDATA_T_DEFINED
-#endif
+#endif /* !_WFINDDATA_T_DEFINED */
 
 #ifndef NULL
 #ifdef __cplusplus
 
 #ifndef NULL
 #ifdef __cplusplus
@@ -136,65 +128,37 @@ extern "C" {
 #endif
 #endif
 
 #endif
 #endif
 
-#ifndef _CONST_RETURN
-#define _CONST_RETURN
-#endif
-
-#define _WConst_return _CONST_RETURN
-
 #ifndef _CRT_CTYPEDATA_DEFINED
 #ifndef _CRT_CTYPEDATA_DEFINED
-#define _CRT_CTYPEDATA_DEFINED
-#ifndef _CTYPE_DISABLE_MACROS
-
-#ifndef __PCTYPE_FUNC
-#define __PCTYPE_FUNC __pctype_func()
-#ifdef _MSVCRT_
-#define __pctype_func() (_pctype)
-#else
-#define __pctype_func() (*_imp___pctype)
-#endif
-#endif
-
-#ifndef _pctype
-#ifdef _MSVCRT_
-  extern unsigned short *_pctype;
-#else
-  extern unsigned short **_imp___pctype;
-#define _pctype (*_imp___pctype)
-#endif
-#endif
-#endif
-#endif
+# define _CRT_CTYPEDATA_DEFINED
+# ifndef _CTYPE_DISABLE_MACROS
+#  ifndef __PCTYPE_FUNC
+#   ifdef _DLL
+#    define __PCTYPE_FUNC __pctype_func()
+#   else
+#    define __PCTYPE_FUNC _pctype
+#   endif
+#  endif /* !__PCTYPE_FUNC */
+  _CRTIMP const unsigned short * __cdecl __pctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern unsigned short *_pctype);
+#  else
+#   define _pctype (__pctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_CTYPEDATA_DEFINED */
 
 #ifndef _CRT_WCTYPEDATA_DEFINED
 #define _CRT_WCTYPEDATA_DEFINED
 
 #ifndef _CRT_WCTYPEDATA_DEFINED
 #define _CRT_WCTYPEDATA_DEFINED
-#ifndef _CTYPE_DISABLE_MACROS
-#ifndef _wctype
-#ifdef _MSVCRT_
-  extern unsigned short *_wctype;
-#else
-  extern unsigned short **_imp___wctype;
-#define _wctype (*_imp___wctype)
-#endif
-#endif
-
-#ifdef _MSVCRT_
-#define __pwctype_func() (_pwctype)
-#else
-#define __pwctype_func() (*_imp___pwctype)
-#endif
-
-#ifndef _pwctype
-#ifdef _MSVCRT_
-  extern unsigned short *_pwctype;
-#else
-  extern unsigned short **_imp___pwctype;
-#define _pwctype (*_imp___pwctype)
-#endif
-#endif
-
-#endif
-#endif
+# ifndef _CTYPE_DISABLE_MACROS
+  _CRTDATA(extern unsigned short *_wctype);
+  _CRTIMP const wctype_t * __cdecl __pwctype_func(void);
+#  ifndef _M_CEE_PURE
+  _CRTDATA(extern const wctype_t *_pwctype);
+#  else
+#   define _pwctype (__pwctype_func())
+#  endif /* !_M_CEE_PURE */
+# endif /* !_CTYPE_DISABLE_MACROS */
+#endif /* !_CRT_WCTYPEDATA_DEFINED */
 
 #define _UPPER 0x1
 #define _LOWER 0x2
 
 #define _UPPER 0x1
 #define _LOWER 0x2
@@ -211,48 +175,46 @@ extern "C" {
 
 #ifndef _WCTYPE_DEFINED
 #define _WCTYPE_DEFINED
 
 #ifndef _WCTYPE_DEFINED
 #define _WCTYPE_DEFINED
-
-  int __cdecl iswalpha(wint_t _C);
+  _CRTIMP int __cdecl iswalpha(wint_t _C);
   _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswalpha_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswupper(wint_t _C);
+  _CRTIMP int __cdecl iswupper(wint_t _C);
   _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswupper_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswlower(wint_t _C);
+  _CRTIMP int __cdecl iswlower(wint_t _C);
   _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswlower_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswdigit(wint_t _C);
+  _CRTIMP int __cdecl iswdigit(wint_t _C);
   _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswdigit_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswxdigit(wint_t _C);
+  _CRTIMP int __cdecl iswxdigit(wint_t _C);
   _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswxdigit_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswspace(wint_t _C);
+  _CRTIMP int __cdecl iswspace(wint_t _C);
   _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswspace_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswpunct(wint_t _C);
+  _CRTIMP int __cdecl iswpunct(wint_t _C);
   _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswpunct_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswalnum(wint_t _C);
+  _CRTIMP int __cdecl iswalnum(wint_t _C);
   _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswalnum_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswprint(wint_t _C);
+  _CRTIMP int __cdecl iswprint(wint_t _C);
   _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswprint_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswgraph(wint_t _C);
+  _CRTIMP int __cdecl iswgraph(wint_t _C);
   _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswgraph_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswcntrl(wint_t _C);
+  _CRTIMP int __cdecl iswcntrl(wint_t _C);
   _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswcntrl_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswascii(wint_t _C);
-  int __cdecl isleadbyte(int _C);
+  _CRTIMP int __cdecl iswascii(wint_t _C);
+  _CRTIMP int __cdecl isleadbyte(int _C);
   _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
   _CRTIMP int __cdecl _isleadbyte_l(int _C,_locale_t _Locale);
-  wint_t __cdecl towupper(wint_t _C);
+  _CRTIMP wint_t __cdecl towupper(wint_t _C);
   _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
   _CRTIMP wint_t __cdecl _towupper_l(wint_t _C,_locale_t _Locale);
-  wint_t __cdecl towlower(wint_t _C);
+  _CRTIMP wint_t __cdecl towlower(wint_t _C);
   _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
   _CRTIMP wint_t __cdecl _towlower_l(wint_t _C,_locale_t _Locale);
-  int __cdecl iswctype(wint_t _C,wctype_t _Type);
+  _CRTIMP int __cdecl iswctype(wint_t _C,wctype_t _Type);
   _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsymf(wint_t _C);
   _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsym(wint_t _C);
   _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl _iswctype_l(wint_t _C,wctype_t _Type,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsymf(wint_t _C);
   _CRTIMP int __cdecl _iswcsymf_l(wint_t _C,_locale_t _Locale);
   _CRTIMP int __cdecl __iswcsym(wint_t _C);
   _CRTIMP int __cdecl _iswcsym_l(wint_t _C,_locale_t _Locale);
-  int __cdecl is_wctype(wint_t _C,wctype_t _Type);
+  _CRTIMP int __cdecl is_wctype(wint_t _C,wctype_t _Type);
 #endif
 
 #ifndef _WDIRECT_DEFINED
 #define _WDIRECT_DEFINED
 #endif
 
 #ifndef _WDIRECT_DEFINED
 #define _WDIRECT_DEFINED
-
   _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
   _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
   wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
   _CRTIMP wchar_t *__cdecl _wgetcwd(wchar_t *_DstBuf,int _SizeInWords);
   _CRTIMP wchar_t *__cdecl _wgetdcwd(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
   wchar_t *__cdecl _wgetdcwd_nolock(int _Drive,wchar_t *_DstBuf,int _SizeInWords);
@@ -263,7 +225,6 @@ extern "C" {
 
 #ifndef _WIO_DEFINED
 #define _WIO_DEFINED
 
 #ifndef _WIO_DEFINED
 #define _WIO_DEFINED
-
   _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
   _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
   _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
   _CRTIMP int __cdecl _waccess(const wchar_t *_Filename,int _AccessMode);
   _CRTIMP int __cdecl _wchmod(const wchar_t *_Filename,int _Mode);
   _CRTIMP int __cdecl _wcreat(const wchar_t *_Filename,int _PermissionMode);
@@ -274,10 +235,10 @@ extern "C" {
   _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
   _CRTIMP wchar_t *__cdecl _wmktemp(wchar_t *_TemplateName);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP intptr_t __cdecl _wfindfirst32i64(const wchar_t *_Filename,struct _wfinddata32i64_t *_FindData);
-  intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
+  _CRTIMP intptr_t __cdecl _wfindfirst64i32(const wchar_t *_Filename,struct _wfinddata64i32_t *_FindData);
   _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
   _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
   _CRTIMP intptr_t __cdecl _wfindfirst64(const wchar_t *_Filename,struct _wfinddata64_t *_FindData);
   _CRTIMP int __cdecl _wfindnext32i64(intptr_t _FindHandle,struct _wfinddata32i64_t *_FindData);
-  int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
+  _CRTIMP int __cdecl _wfindnext64i32(intptr_t _FindHandle,struct _wfinddata64i32_t *_FindData);
   _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
 #endif
   _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
   _CRTIMP int __cdecl _wfindnext64(intptr_t _FindHandle,struct _wfinddata64_t *_FindData);
 #endif
   _CRTIMP errno_t __cdecl _wsopen_s(int *_FileHandle,const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionFlag);
@@ -288,7 +249,7 @@ extern "C" {
   extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
   extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
 #endif
   extern "C++" _CRTIMP int __cdecl _wopen(const wchar_t *_Filename,int _OpenFlag,int _PermissionMode = 0);
   extern "C++" _CRTIMP int __cdecl _wsopen(const wchar_t *_Filename,int _OpenFlag,int _ShareFlag,int _PermissionMode = 0);
 #endif
-#endif
+#endif /* !_WIO_DEFINED */
 
 #ifndef _WLOCALE_DEFINED
 #define _WLOCALE_DEFINED
 
 #ifndef _WLOCALE_DEFINED
 #define _WLOCALE_DEFINED
@@ -297,7 +258,6 @@ extern "C" {
 
 #ifndef _WPROCESS_DEFINED
 #define _WPROCESS_DEFINED
 
 #ifndef _WPROCESS_DEFINED
 #define _WPROCESS_DEFINED
-
   _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
   _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
   _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
   _CRTIMP intptr_t __cdecl _wexecl(const wchar_t *_Filename,const wchar_t *_ArgList,...);
   _CRTIMP intptr_t __cdecl _wexecle(const wchar_t *_Filename,const wchar_t *_ArgList,...);
   _CRTIMP intptr_t __cdecl _wexeclp(const wchar_t *_Filename,const wchar_t *_ArgList,...);
@@ -317,8 +277,8 @@ extern "C" {
 #ifndef _CRT_WSYSTEM_DEFINED
 #define _CRT_WSYSTEM_DEFINED
   _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
 #ifndef _CRT_WSYSTEM_DEFINED
 #define _CRT_WSYSTEM_DEFINED
   _CRTIMP int __cdecl _wsystem(const wchar_t *_Command);
-#endif
-#endif
+#endif /* !_CRT_WSYSTEM_DEFINED */
+#endif /* !_WPROCESS_DEFINED */
 
 #ifndef _WCTYPE_INLINE_DEFINED
 #undef _CRT_WCTYPE_NOINLINE
 
 #ifndef _WCTYPE_INLINE_DEFINED
 #undef _CRT_WCTYPE_NOINLINE
@@ -373,19 +333,16 @@ extern "C" {
 
 #ifndef _OFF_T_DEFINED
 #define _OFF_T_DEFINED
 
 #ifndef _OFF_T_DEFINED
 #define _OFF_T_DEFINED
-#ifndef _OFF_T_
-#define _OFF_T_
   typedef long _off_t;
   typedef long _off_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
+#ifndef NO_OLDNAMES
   typedef long off_t;
 #endif
 #endif
   typedef long off_t;
 #endif
 #endif
-#endif
 
 #ifndef _OFF64_T_DEFINED
 #define _OFF64_T_DEFINED
   typedef long long _off64_t;
 
 #ifndef _OFF64_T_DEFINED
 #define _OFF64_T_DEFINED
   typedef long long _off64_t;
-#if !defined(NO_OLDNAMES) || defined(_POSIX)
+#ifndef NO_OLDNAMES
   typedef long long off64_t;
 #endif
 #endif
   typedef long long off64_t;
 #endif
 #endif
@@ -393,28 +350,6 @@ extern "C" {
 #ifndef _STAT_DEFINED
 #define _STAT_DEFINED
 
 #ifndef _STAT_DEFINED
 #define _STAT_DEFINED
 
-#ifdef _USE_32BIT_TIME_T
-#ifdef WIN64
-#define _fstat _fstat32
-#define _stat _stat32
-#define _wstat _wstat32
-#else
-#define _fstat32 _fstat
-#define _stat32 _stat
-#define _wstat32 _wstat
-#endif
-#define _fstati64 _fstat32i64
-#define _stati64 _stat32i64
-#define _wstati64 _wstat32i64
-#else
-#define _fstat _fstat64i32
-#define _fstati64 _fstat64
-#define _stat _stat64i32
-#define _stati64 _stat64
-#define _wstat _wstat64i32
-#define _wstati64 _wstat64
-#endif
-
   struct _stat32 {
     _dev_t st_dev;
     _ino_t st_ino;
   struct _stat32 {
     _dev_t st_dev;
     _ino_t st_ino;
@@ -429,6 +364,20 @@ extern "C" {
     __time32_t st_ctime;
   };
 
     __time32_t st_ctime;
   };
 
+  struct _stat {
+    _dev_t st_dev;
+    _ino_t st_ino;
+    unsigned short st_mode;
+    short st_nlink;
+    short st_uid;
+    short st_gid;
+    _dev_t st_rdev;
+    _off_t st_size;
+    time_t st_atime;
+    time_t st_mtime;
+    time_t st_ctime;
+  };
+
 #ifndef        NO_OLDNAMES
   struct stat {
     _dev_t st_dev;
 #ifndef        NO_OLDNAMES
   struct stat {
     _dev_t st_dev;
@@ -445,7 +394,7 @@ extern "C" {
   };
 #endif
 
   };
 #endif
 
-/* #if _INTEGRAL_MAX_BITS >= 64 */
+#if _INTEGRAL_MAX_BITS >= 64
 
   struct _stat32i64 {
     _dev_t st_dev;
 
   struct _stat32i64 {
     _dev_t st_dev;
@@ -488,7 +437,7 @@ extern "C" {
     __time64_t st_mtime;
     __time64_t st_ctime;
   };
     __time64_t st_mtime;
     __time64_t st_ctime;
   };
-/* #endif */
+#endif
 
 #define __stat64 _stat64
 
 
 #define __stat64 _stat64
 
@@ -496,11 +445,11 @@ extern "C" {
 
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
 
 #ifndef _WSTAT_DEFINED
 #define _WSTAT_DEFINED
-
+  _CRTIMP int __cdecl _wstat(const wchar_t *_Name,struct _stat *_Stat);
   _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
   _CRTIMP int __cdecl _wstat32(const wchar_t *_Name,struct _stat32 *_Stat);
 #if _INTEGRAL_MAX_BITS >= 64
   _CRTIMP int __cdecl _wstat32i64(const wchar_t *_Name,struct _stat32i64 *_Stat);
-  int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
+  _CRTIMP int __cdecl _wstat64i32(const wchar_t *_Name,struct _stat64i32 *_Stat);
   _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
 #endif
 #endif
   _CRTIMP int __cdecl _wstat64(const wchar_t *_Name,struct _stat64 *_Stat);
 #endif
 #endif
@@ -508,11 +457,6 @@ extern "C" {
 
 #ifndef _WCONIO_DEFINED
 #define _WCONIO_DEFINED
 
 #ifndef _WCONIO_DEFINED
 #define _WCONIO_DEFINED
-
-#ifndef WEOF
-#define WEOF (wint_t)(0xFFFF)
-#endif
-
   _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
   _CRTIMP wint_t __cdecl _getwch(void);
   _CRTIMP wint_t __cdecl _getwche(void);
   _CRTIMP wchar_t *_cgetws(wchar_t *_Buffer);
   _CRTIMP wint_t __cdecl _getwch(void);
   _CRTIMP wint_t __cdecl _getwche(void);
@@ -539,34 +483,30 @@ extern "C" {
 #ifndef _WSTDIO_DEFINED
 #define _WSTDIO_DEFINED
 
 #ifndef _WSTDIO_DEFINED
 #define _WSTDIO_DEFINED
 
-#ifndef WEOF
-#define WEOF (wint_t)(0xFFFF)
-#endif
-
 #ifdef _POSIX_
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
 #else
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
 #endif
 
 #ifdef _POSIX_
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode);
 #else
   _CRTIMP FILE *__cdecl _wfsopen(const wchar_t *_Filename,const wchar_t *_Mode,int _ShFlag);
 #endif
 
-  wint_t __cdecl fgetwc(FILE *_File);
+  _CRTIMP_ALT wint_t __cdecl fgetwc(FILE *_File);
   _CRTIMP wint_t __cdecl _fgetwchar(void);
   _CRTIMP wint_t __cdecl _fgetwchar(void);
-  wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl fputwc(wchar_t _Ch,FILE *_File);
   _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
   _CRTIMP wint_t __cdecl _fputwchar(wchar_t _Ch);
-  wint_t __cdecl getwc(FILE *_File);
-  wint_t __cdecl getwchar(void);
-  wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
-  wint_t __cdecl putwchar(wchar_t _Ch);
-  wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
-  wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
-  int __cdecl fputws(const wchar_t *_Str,FILE *_File);
+  _CRTIMP wint_t __cdecl getwc(FILE *_File);
+  _CRTIMP wint_t __cdecl getwchar(void);
+  _CRTIMP wint_t __cdecl putwc(wchar_t _Ch,FILE *_File);
+  _CRTIMP wint_t __cdecl putwchar(wchar_t _Ch);
+  _CRTIMP_ALT wint_t __cdecl ungetwc(wint_t _Ch,FILE *_File);
+  _CRTIMP wchar_t *__cdecl fgetws(wchar_t *_Dst,int _SizeInWords,FILE *_File);
+  _CRTIMP int __cdecl fputws(const wchar_t *_Str,FILE *_File);
   _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
   _CRTIMP int __cdecl _putws(const wchar_t *_Str);
   _CRTIMP wchar_t *__cdecl _getws(wchar_t *_String);
   _CRTIMP int __cdecl _putws(const wchar_t *_Str);
-  int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
-  int __cdecl wprintf(const wchar_t *_Format,...);
+  _CRTIMP int __cdecl fwprintf(FILE *_File,const wchar_t *_Format,...);
+  _CRTIMP int __cdecl wprintf(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
   _CRTIMP int __cdecl _scwprintf(const wchar_t *_Format,...);
-  int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
-  int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vfwprintf(FILE *_File,const wchar_t *_Format,va_list _ArgList);
+  _CRTIMP int __cdecl vwprintf(const wchar_t *_Format,va_list _ArgList);
   _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
   _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
   _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
   _CRTIMP int __cdecl swprintf(wchar_t*, const wchar_t*, ...);
   _CRTIMP int __cdecl vswprintf(wchar_t*, const wchar_t*,va_list);
   _CRTIMP int __cdecl _swprintf_c(wchar_t *_DstBuf,size_t _SizeInWords,const wchar_t *_Format,...);
@@ -574,11 +514,11 @@ extern "C" {
   _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
   _CRTIMP int __cdecl _snwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _vsnwprintf(wchar_t *_Dest,size_t _Count,const wchar_t *_Format,va_list _Args);
 #ifndef __NO_ISOCEXT  /* externs in libmingwex.a */
-  int __cdecl snwprintf (wchar_t *s, size_t n, const wchar_t * format, ...);
+  _CRTIMP int __cdecl snwprintf (wchar_t *s, size_t n, const wchar_t * format, ...);
   __CRT_INLINE int __cdecl vsnwprintf (wchar_t *s, size_t n, const wchar_t *format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
   __CRT_INLINE int __cdecl vsnwprintf (wchar_t *s, size_t n, const wchar_t *format, va_list arg) { return _vsnwprintf(s,n,format,arg); }
-  int __cdecl vwscanf (const wchar_t *, va_list);
-  int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
-  int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
+  _CRTIMP int __cdecl vwscanf (const wchar_t *, va_list);
+  _CRTIMP int __cdecl vfwscanf (FILE *,const wchar_t *,va_list);
+  _CRTIMP int __cdecl vswscanf (const wchar_t *,const wchar_t *,va_list);
 #endif
   _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...);
 #endif
   _CRTIMP int __cdecl _fwprintf_p(FILE *_File,const wchar_t *_Format,...);
   _CRTIMP int __cdecl _wprintf_p(const wchar_t *_Format,...);
@@ -609,9 +549,6 @@ extern "C" {
   _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
   _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
   _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
   _CRTIMP int __cdecl _vswprintf(wchar_t *_Dest,const wchar_t *_Format,va_list _Args);
   _CRTIMP int __cdecl __swprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,...);
   _CRTIMP int __cdecl __vswprintf_l(wchar_t *_Dest,const wchar_t *_Format,_locale_t _Plocinfo,va_list _Args);
-#ifndef RC_INVOKED
-#include <vadefs.h>
-#endif
 
 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
 #ifndef __cplusplus
 
 #ifdef _CRT_NON_CONFORMING_SWPRINTFS
 #ifndef __cplusplus
@@ -766,11 +703,6 @@ extern "C" {
   _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
   _CRTIMP int __cdecl _wcsnicoll_l(const wchar_t *_Str1,const wchar_t *_Str2,size_t _MaxCount,_locale_t _Locale);
 
 #ifndef        NO_OLDNAMES
-    /* NOTE: There is no _wcscmpi, but this is for compatibility. */
-  int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2);
-  __CRT_INLINE int __cdecl wcscmpi (const wchar_t * __ws1, const wchar_t * __ws2) { return _wcsicmp (__ws1, __ws2); }
-  #define              _wcscmpi        _wcsicmp
-
   wchar_t *__cdecl wcsdup(const wchar_t *_Str);
 #define wcswcs wcsstr
   int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
   wchar_t *__cdecl wcsdup(const wchar_t *_Str);
 #define wcswcs wcsstr
   int __cdecl wcsicmp(const wchar_t *_Str1,const wchar_t *_Str2);
@@ -864,5 +796,5 @@ __CRT_INLINE wchar_t *__cdecl _wctime(const time_t *_Time) { return _wctime64(_T
 
 #pragma pack(pop)
 
 
 #pragma pack(pop)
 
-#include <sec_api/wchar_s.h>
+//#include <sec_api/wchar_s.h>
 #endif
 #endif
index a44cb38..93ff61e 100644 (file)
@@ -10,7 +10,7 @@
 #error Only Win32 target is supported!
 #endif
 
 #error Only Win32 target is supported!
 #endif
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index 2ac65cf..9f99412 100644 (file)
@@ -6,7 +6,7 @@
 #ifndef _YVALS
 #define _YVALS
 
 #ifndef _YVALS
 #define _YVALS
 
-#include <_mingw.h>
+#include <crtdefs.h>
 
 #pragma pack(push,_CRT_PACKING)
 
 
 #pragma pack(push,_CRT_PACKING)
 
index 378c2a0..1a45c2e 100644 (file)
@@ -49,7 +49,6 @@ typedef struct __SEH2Frame
 {
        _SEH2Registration_t SF_Registration;
        volatile struct __SEH2TryLevel * volatile SF_TopTryLevel;
 {
        _SEH2Registration_t SF_Registration;
        volatile struct __SEH2TryLevel * volatile SF_TopTryLevel;
-       struct _EXCEPTION_POINTERS * volatile SF_ExceptionInformation;
        volatile unsigned long SF_Code;
 }
 _SEH2Frame_t;
        volatile unsigned long SF_Code;
 }
 _SEH2Frame_t;
@@ -143,15 +142,23 @@ void * _SEHClosureFromTrampoline(_SEHTrampoline_t * trampoline_)
 #define __SEH_FORCE_NEST \
        __asm__ __volatile__("#%0" : : "r" (&_SEHFrame))
 
 #define __SEH_FORCE_NEST \
        __asm__ __volatile__("#%0" : : "r" (&_SEHFrame))
 
-#define __SEH_DECLARE_EXCEPT_PFN(NAME_) int (__cdecl * NAME_)(void)
-#define __SEH_DECLARE_EXCEPT(NAME_) int __cdecl NAME_(void)
-#define __SEH_DEFINE_EXCEPT(NAME_) int __cdecl NAME_(void)
-
-#define __SEH_DECLARE_FINALLY_PFN(NAME_) void (__cdecl * NAME_)(void)
-#define __SEH_DECLARE_FINALLY(NAME_) void __cdecl NAME_(void)
-#define __SEH_DEFINE_FINALLY(NAME_) void __cdecl NAME_(void)
-
-#define __SEH_RETURN_EXCEPT(R_) return (int)(R_)
+#define __SEH_EXCEPT_RET long
+#define __SEH_EXCEPT_ARGS __attribute__((unused)) _SEH2Frame_t * _SEH2FrameP, __attribute__((unused)) struct _EXCEPTION_POINTERS * _SEHExceptionInformation
+#define __SEH_EXCEPT_ARGS_ , __SEH_EXCEPT_ARGS
+#define __SEH_EXCEPT_PFN __SEH_DECLARE_EXCEPT_PFN
+#define __SEH_DECLARE_EXCEPT_PFN(NAME_) __SEH_EXCEPT_RET (__cdecl * NAME_)(__SEH_EXCEPT_ARGS)
+#define __SEH_DECLARE_EXCEPT(NAME_) __SEH_EXCEPT_RET __cdecl NAME_(__SEH_EXCEPT_ARGS)
+#define __SEH_DEFINE_EXCEPT(NAME_) __SEH_EXCEPT_RET __cdecl NAME_(__SEH_EXCEPT_ARGS)
+
+#define __SEH_FINALLY_RET void
+#define __SEH_FINALLY_ARGS void
+#define __SEH_FINALLY_ARGS_
+#define __SEH_FINALLY_PFN __SEH_DECLARE_FINALLY_PFN
+#define __SEH_DECLARE_FINALLY_PFN(NAME_) __SEH_FINALLY_RET (__cdecl * NAME_)(__SEH_FINALLY_ARGS)
+#define __SEH_DECLARE_FINALLY(NAME_) __SEH_FINALLY_RET __cdecl NAME_(__SEH_FINALLY_ARGS)
+#define __SEH_DEFINE_FINALLY(NAME_) __SEH_FINALLY_RET __cdecl NAME_(__SEH_FINALLY_ARGS)
+
+#define __SEH_RETURN_EXCEPT(R_) return (long)(R_)
 #define __SEH_RETURN_FINALLY() return
 
 #define __SEH_BEGIN_TRY \
 #define __SEH_RETURN_FINALLY() return
 
 #define __SEH_BEGIN_TRY \
@@ -178,9 +185,9 @@ void * _SEHClosureFromTrampoline(_SEHTrampoline_t * trampoline_)
 #define __SEH_LEAVE_TRYLEVEL() __SEH_SET_TRYLEVEL(_SEHPrevTryLevelP)
 
 #define __SEH_END_SCOPE_CHAIN \
 #define __SEH_LEAVE_TRYLEVEL() __SEH_SET_TRYLEVEL(_SEHPrevTryLevelP)
 
 #define __SEH_END_SCOPE_CHAIN \
-       static const int _SEH2ScopeKind = 1; \
-       static _SEH2Frame_t * const _SEH2FrameP = 0; \
-       static _SEH2TryLevel_t * const _SEH2TryLevelP = 0;
+       static __attribute__((unused)) const int _SEH2ScopeKind = 1; \
+       static __attribute__((unused)) _SEH2Frame_t * const _SEH2FrameP = 0; \
+       static __attribute__((unused)) _SEH2TryLevel_t * const _SEH2TryLevelP = 0;
 
 #define __SEH_BEGIN_SCOPE \
        for(;;) \
 
 #define __SEH_BEGIN_SCOPE \
        for(;;) \
@@ -290,35 +297,39 @@ void * _SEHClosureFromTrampoline(_SEHTrampoline_t * trampoline_)
  \
                _SEHBeforeTry:; \
  \
  \
                _SEHBeforeTry:; \
  \
-               if(__builtin_constant_p((__VA_ARGS__))) \
                { \
                { \
-                       if((__VA_ARGS__) > 0) \
-                       { \
-                               _SEHTryLevel.ST_Filter = (void *)1; \
-                               _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \
-                               __SEH_USE_LABEL(_SEHBeginExcept); \
-                       } \
-                       else if((__VA_ARGS__) < 0) \
+                       __attribute__((unused)) struct _EXCEPTION_POINTERS * volatile _SEHExceptionInformation; \
+ \
+                       if(__builtin_constant_p((__VA_ARGS__))) \
                        { \
                        { \
-                               _SEHTryLevel.ST_Filter = (void *)-1; \
-                               _SEHTryLevel.ST_Body = NULL; \
+                               if((__VA_ARGS__) > 0) \
+                               { \
+                                       _SEHTryLevel.ST_Filter = (void *)1; \
+                                       _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \
+                                       __SEH_USE_LABEL(_SEHBeginExcept); \
+                               } \
+                               else if((__VA_ARGS__) < 0) \
+                               { \
+                                       _SEHTryLevel.ST_Filter = (void *)-1; \
+                                       _SEHTryLevel.ST_Body = NULL; \
+                               } \
+                               else \
+                               { \
+                                       _SEHTryLevel.ST_Filter = (void *)0; \
+                                       _SEHTryLevel.ST_Body = NULL; \
+                               } \
                        } \
                        else \
                        { \
                        } \
                        else \
                        { \
-                               _SEHTryLevel.ST_Filter = (void *)0; \
-                               _SEHTryLevel.ST_Body = NULL; \
-                       } \
-               } \
-               else \
-               { \
-                       __SEH_DEFINE_EXCEPT(_SEHExcept) \
-                       { \
-                               __SEH_RETURN_EXCEPT((__VA_ARGS__)); \
-                       } \
+                               __SEH_DEFINE_EXCEPT(_SEHExcept) \
+                               { \
+                                       __SEH_RETURN_EXCEPT((__VA_ARGS__)); \
+                               } \
  \
  \
-                       _SEHTryLevel.ST_Filter = &_SEHExcept; \
-                       _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \
-                       __SEH_USE_LABEL(_SEHBeginExcept); \
+                               _SEHTryLevel.ST_Filter = &_SEHExcept; \
+                               _SEHTryLevel.ST_Body = &&_SEHBeginExcept; \
+                               __SEH_USE_LABEL(_SEHBeginExcept); \
+                       } \
                } \
  \
                __SEH_BARRIER; \
                } \
  \
                __SEH_BARRIER; \
@@ -350,8 +361,6 @@ void * _SEHClosureFromTrampoline(_SEHTrampoline_t * trampoline_)
                _SEHBeginExcept:; \
                { \
                        { \
                _SEHBeginExcept:; \
                { \
                        { \
-                               _SEH2Frame_t * const _SEH2FrameP = _SEHTopTryLevel ? &_SEHFrame : _SEHCurFrameP; \
-                               (void)_SEH2FrameP; \
                                __SEH_BARRIER;
 
 #define _SEH2_END \
                                __SEH_BARRIER;
 
 #define _SEH2_END \
@@ -363,7 +372,7 @@ void * _SEHClosureFromTrampoline(_SEHTrampoline_t * trampoline_)
        } \
        __SEH_END_SCOPE;
 
        } \
        __SEH_END_SCOPE;
 
-#define _SEH2_GetExceptionInformation() ((_SEH2FrameP)->SF_ExceptionInformation)
+#define _SEH2_GetExceptionInformation() (_SEHExceptionInformation)
 #define _SEH2_GetExceptionCode() ((_SEH2FrameP)->SF_Code)
 #define _SEH2_AbnormalTermination() (_SEHAbnormalTermination)
 
 #define _SEH2_GetExceptionCode() ((_SEH2FrameP)->SF_Code)
 #define _SEH2_AbnormalTermination() (_SEHAbnormalTermination)
 
index 487b9e6..56e3b52 100644 (file)
@@ -277,6 +277,27 @@ typedef struct _SERVERINFO
   COLORREF SysColors[COLOR_MENUBAR+1];       // GetSysColor
   HBRUSH   SysColorBrushes[COLOR_MENUBAR+1]; // GetSysColorBrush
   HPEN     SysColorPens[COLOR_MENUBAR+1];    // ReactOS exclusive
   COLORREF SysColors[COLOR_MENUBAR+1];       // GetSysColor
   HBRUSH   SysColorBrushes[COLOR_MENUBAR+1]; // GetSysColorBrush
   HPEN     SysColorPens[COLOR_MENUBAR+1];    // ReactOS exclusive
+  HBRUSH   hbrGray;
+  POINTL   ptCursor;
+  //
+  DWORD    cxSysFontChar;
+  DWORD    cySysFontChar;
+  DWORD    cxMsgFontChar;
+  DWORD    cyMsgFontChar;
+  TEXTMETRICW tmSysFont;
+  //
+  RECTL    rcScreen;
+  WORD     BitCount;
+  WORD     dmLogPixels;
+  BYTE     BitsPixel;
+  BYTE     Planes;
+  WORD     reserved;
+  DWORD    PUSIFlags; // PERUSERSERVERINFO Flags.
+  ULONG    uCaretWidth;
+  LANGID   UILangID;
+  UINT     LastRITWasKeyboard : 1;
+  UINT     bKeyboardPref : 1;
+  DWORD    TimeTick;
   DWORD    SrvEventActivity;
 } SERVERINFO, *PSERVERINFO;
 
   DWORD    SrvEventActivity;
 } SERVERINFO, *PSERVERINFO;
 
index e4f02e7..d48b672 100644 (file)
 
 /* Define to 1 if the system has the type `pid_t'. */
 #if !defined(_MSC_VER)
 
 /* Define to 1 if the system has the type `pid_t'. */
 #if !defined(_MSC_VER)
-#define HAVE_PID_T 1
+//#define HAVE_PID_T 1
 #endif
 
 /* Define to 1 if you have the <poll.h> header file. */
 #endif
 
 /* Define to 1 if you have the <poll.h> header file. */
index af39050..ec156ad 100644 (file)
@@ -9,6 +9,9 @@
 extern "C" {
 #endif
 
 extern "C" {
 #endif
 
+typedef EXCEPTION_DISPOSITION (*PEXCEPTION_HANDLER)
+               (struct _EXCEPTION_RECORD*, void*, struct _CONTEXT*, void*);
+
 struct _EXCEPTION_REGISTRATION_RECORD;
 typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
 
 struct _EXCEPTION_REGISTRATION_RECORD;
 typedef struct _EXCEPTION_REGISTRATION_RECORD EXCEPTION_REGISTRATION_RECORD, *PEXCEPTION_REGISTRATION_RECORD;
 
@@ -37,6 +40,13 @@ struct _EXCEPTION_REGISTRATION_RECORD
 #define AbnormalTermination() _SEH2_AbnormalTermination()
 #endif
 
 #define AbnormalTermination() _SEH2_AbnormalTermination()
 #endif
 
+/* Win32 seems to use the same flags as ExceptionFlags in an EXCEPTION_RECORD */
+#define EH_NONCONTINUABLE   0x01
+#define EH_UNWINDING        0x02
+#define EH_EXIT_UNWIND      0x04
+#define EH_STACK_INVALID    0x08
+#define EH_NESTED_CALL      0x10
+
 #define EXCEPTION_WINE_STUB       0x80000100
 #define EXCEPTION_WINE_ASSERTION  0x80000101
 
 #define EXCEPTION_WINE_STUB       0x80000100
 #define EXCEPTION_WINE_ASSERTION  0x80000101
 
index efb9cbb..d69f788 100644 (file)
        DEALINGS IN THE SOFTWARE.
 */
 
        DEALINGS IN THE SOFTWARE.
 */
 
-#define _NTSYSTEM_
+#define _NTSYSTEM_ /* removes dllimport attribute from RtlUnwind */
+
 #define STRICT
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #include <pseh/pseh2.h>
 #define STRICT
 #define WIN32_LEAN_AND_MEAN
 #include <windows.h>
 
 #include <pseh/pseh2.h>
-
 #include <excpt.h>
 #include <excpt.h>
+#include <intrin.h>
 
 #ifndef EXCEPTION_EXIT_UNWIND
 #define EXCEPTION_EXIT_UNWIND 4
 
 #ifndef EXCEPTION_EXIT_UNWIND
 #define EXCEPTION_EXIT_UNWIND 4
 #define EXCEPTION_UNWINDING 2
 #endif
 
 #define EXCEPTION_UNWINDING 2
 #endif
 
-extern _SEH2Registration_t * __cdecl _SEH2CurrentRegistration(void);
-
-extern int __SEH2Except(void *, void *);
-extern void __SEH2Finally(void *, void *);
 extern DECLSPEC_NORETURN int __SEH2Handle(void *, void *, void *);
 extern DECLSPEC_NORETURN int __SEH2Handle(void *, void *, void *);
-
-extern void __cdecl __SEH2EnterFrame(_SEH2Registration_t *);
-extern void __cdecl __SEH2LeaveFrame(void);
-
 extern int __cdecl __SEH2FrameHandler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
 extern int __cdecl __SEH2NestedHandler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
 
 extern int __cdecl __SEH2FrameHandler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
 extern int __cdecl __SEH2NestedHandler(struct _EXCEPTION_RECORD *, void *, struct _CONTEXT *, void *);
 
+FORCEINLINE
+_SEH2Registration_t * __cdecl _SEH2CurrentRegistration(void)
+{
+       return (_SEH2Registration_t *)__readfsdword(0);
+}
+
+FORCEINLINE
+void __cdecl __SEH2EnterFrame(_SEH2Registration_t * frame)
+{
+       frame->SER_Prev = _SEH2CurrentRegistration();
+       __writefsdword(0, (unsigned long)frame);
+}
+
+FORCEINLINE
+void __cdecl __SEH2LeaveFrame(void)
+{
+       __writefsdword(0, (unsigned long)_SEH2CurrentRegistration()->SER_Prev);
+}
+
 FORCEINLINE
 void _SEH2GlobalUnwind(void * target)
 {
 FORCEINLINE
 void _SEH2GlobalUnwind(void * target)
 {
@@ -67,11 +79,12 @@ void _SEH2GlobalUnwind(void * target)
        );
 }
 
        );
 }
 
-FORCEINLINE
-int _SEH2Except(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel)
+static
+__SEH_EXCEPT_RET _SEH2Except(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel, struct _EXCEPTION_POINTERS * ep)
 {
        void * filter = trylevel->ST_Filter;
        void * context = NULL;
 {
        void * filter = trylevel->ST_Filter;
        void * context = NULL;
+       __SEH_EXCEPT_RET ret;
 
        if(filter == (void *)0)
                return 0;
 
        if(filter == (void *)0)
                return 0;
@@ -88,10 +101,22 @@ int _SEH2Except(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel)
                filter = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)filter);
        }
 
                filter = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)filter);
        }
 
-       return __SEH2Except(filter, context);
+       __asm__ __volatile__
+       (
+               "push %[ep]\n"
+               "push %[frame]\n"
+               "call *%[filter]\n"
+               "pop %%edx\n"
+               "pop %%edx\n" :
+               [ret] "=a" (ret) :
+               "c" (context), [filter] "r" (filter), [frame] "g" (frame), [ep] "g" (ep) :
+               "edx", "flags", "memory"
+       );
+
+       return ret;
 }
 
 }
 
-FORCEINLINE
+static
 void _SEH2Finally(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel)
 {
        if(trylevel->ST_Filter == NULL && trylevel->ST_Body != NULL)
 void _SEH2Finally(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel)
 {
        if(trylevel->ST_Filter == NULL && trylevel->ST_Body != NULL)
@@ -105,7 +130,7 @@ void _SEH2Finally(_SEH2Frame_t * frame, volatile _SEH2TryLevel_t * trylevel)
                        body = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)body);
                }
 
                        body = _SEHFunctionFromTrampoline((_SEHTrampoline_t *)body);
                }
 
-               __SEH2Finally(body, context);
+               __asm__ __volatile__("call *%1\n" : : "c" (context), "r" (body) : "eax", "edx", "flags", "memory");
        }
 }
 
        }
 }
 
@@ -179,11 +204,10 @@ int __cdecl _SEH2FrameHandler
                ep.ContextRecord = ContextRecord;
 
                frame->SF_Code = ExceptionRecord->ExceptionCode;
                ep.ContextRecord = ContextRecord;
 
                frame->SF_Code = ExceptionRecord->ExceptionCode;
-               frame->SF_ExceptionInformation = &ep;
 
                for(trylevel = frame->SF_TopTryLevel; trylevel != NULL; trylevel = trylevel->ST_Next)
                {
 
                for(trylevel = frame->SF_TopTryLevel; trylevel != NULL; trylevel = trylevel->ST_Next)
                {
-                       ret = _SEH2Except(frame, trylevel);
+                       ret = _SEH2Except(frame, trylevel, &ep);
 
                        if(ret < 0)
                                return ExceptionContinueExecution;
 
                        if(ret < 0)
                                return ExceptionContinueExecution;
index 191921f..d60f6cf 100644 (file)
 .text
 .intel_syntax noprefix
 
 .text
 .intel_syntax noprefix
 
-.func _SEH2CurrentRegistration
-.globl __SEH2CurrentRegistration
-__SEH2CurrentRegistration:
-       mov eax, [fs:0]
-       ret
-.endfunc
-
-.func __SEH2EnterFrame
-.globl ___SEH2EnterFrame
-___SEH2EnterFrame:
-       mov eax, [esp+4]
-       mov ecx, [fs:0]
-       mov [eax], ecx
-       mov [fs:0], eax
-       ret
-.endfunc
-
-.func __SEH2LeaveFrame
-.globl ___SEH2LeaveFrame
-___SEH2LeaveFrame:
-       mov eax, [fs:0]
-       mov eax, [eax]
-       mov [fs:0], eax
-       ret
-.endfunc
-
 .func __SEH2Handle
 .globl ___SEH2Handle
 ___SEH2Handle:
 .func __SEH2Handle
 .globl ___SEH2Handle
 ___SEH2Handle:
@@ -56,28 +30,6 @@ ___SEH2Handle:
        jmp eax
 .endfunc
 
        jmp eax
 .endfunc
 
-.func __SEH2Except
-.globl ___SEH2Except
-___SEH2Except:
-       mov eax, [esp+4]
-       mov ecx, [esp+8]
-
-       call eax
-
-       ret
-.endfunc
-
-.func __SEH2Finally
-.globl ___SEH2Finally
-___SEH2Finally:
-       mov eax, [esp+4]
-       mov ecx, [esp+8]
-
-       call eax
-
-       ret
-.endfunc
-
 .func __SEH2FrameHandler
 .globl ___SEH2FrameHandler
 ___SEH2FrameHandler:
 .func __SEH2FrameHandler
 .globl ___SEH2FrameHandler
 ___SEH2FrameHandler:
index 1977afe..692c5e7 100644 (file)
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
-#include "wine/config.h"
-#include "wine/port.h"
-
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "wine/exception.h"
-#include "winnt.h"
-#include "excpt.h"
-#include "wine/debug.h"
-#include <malloc.h>
-#include <stdlib.h>
-#include <stdio.h>
+#include <precomp.h>
 
 #include <internal/wine/msvcrt.h>
 #include <internal/wine/cppexcept.h>
 
 #include <internal/wine/msvcrt.h>
 #include <internal/wine/cppexcept.h>
-#include <internal/mtdll.h>
-
-WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 typedef exception bad_cast;
 typedef exception bad_typeid;
 
 typedef exception bad_cast;
 typedef exception bad_typeid;
@@ -76,7 +58,6 @@ typedef struct _rtti_object_locator
   const rtti_object_hierarchy *type_hierarchy;
 } rtti_object_locator;
 
   const rtti_object_hierarchy *type_hierarchy;
 } rtti_object_locator;
 
-
 #ifdef __i386__  /* thiscall functions are i386-specific */
 
 #define THISCALL(func) __thiscall_ ## func
 #ifdef __i386__  /* thiscall functions are i386-specific */
 
 #define THISCALL(func) __thiscall_ ## func
index ae6d9c3..5e301da 100644 (file)
  * www.thecodeproject.com.
  */
 
  * www.thecodeproject.com.
  */
 
-#include "wine/config.h"
-#include "wine/port.h"
-
+#define __WINE_DEBUG_CHANNEL__
+#include <precomp.h>
 #include <stdarg.h>
 
 #include <stdarg.h>
 
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
 #include <internal/wine/msvcrt.h>
 #include <internal/wine/msvcrt.h>
-#include "wine/exception.h"
-#include "excpt.h"
-#include "wine/debug.h"
-
 #include <internal/wine/cppexcept.h>
 
 #ifdef __i386__  /* CxxFrameHandler is not supported on non-i386 */
 #include <internal/wine/cppexcept.h>
 
 #ifdef __i386__  /* CxxFrameHandler is not supported on non-i386 */
@@ -328,7 +319,7 @@ static inline void call_catch_block( PEXCEPTION_RECORD rec, cxx_exception_frame
 
             /* setup an exception block for nested exceptions */
 
 
             /* setup an exception block for nested exceptions */
 
-            nested_frame.frame.Handler = (PEXCEPTION_HANDLER)catch_function_nested_handler;
+            nested_frame.frame.Handler = (PEXCEPTION_ROUTINE)catch_function_nested_handler;
             nested_frame.prev_rec  = thread_data->exc_record;
             nested_frame.cxx_frame = frame;
             nested_frame.descr     = descr;
             nested_frame.prev_rec  = thread_data->exc_record;
             nested_frame.cxx_frame = frame;
             nested_frame.descr     = descr;
index 2b34f55..2cead03 100644 (file)
 #ifndef __MSVCRT_CPPEXCEPT_H
 #define __MSVCRT_CPPEXCEPT_H
 
 #ifndef __MSVCRT_CPPEXCEPT_H
 #define __MSVCRT_CPPEXCEPT_H
 
+#include <pseh/pseh2.h>
+
+/* Macros to define assembler functions somewhat portably */
+
+#define __ASM_FUNC(name) ".def " __ASM_NAME(name) "; .scl 2; .type 32; .endef"
+#define __ASM_NAME(name) "_" name
+
+#ifdef __GNUC__
+# define __ASM_GLOBAL_FUNC(name,code) \
+      __asm__( ".align 4\n\t" \
+               ".globl " __ASM_NAME(#name) "\n\t" \
+               __ASM_FUNC(#name) "\n" \
+               __ASM_NAME(#name) ":\n\t" \
+               code );
+#else  /* __GNUC__ */
+# define __ASM_GLOBAL_FUNC(name,code) \
+      void __asm_dummy_##name(void) { \
+          asm( ".align 4\n\t" \
+               ".globl " __ASM_NAME(#name) "\n\t" \
+               __ASM_FUNC(#name) "\n" \
+               __ASM_NAME(#name) ":\n\t" \
+               code ); \
+      }
+#endif  /* __GNUC__ */
+
+#define EH_NONCONTINUABLE   0x01
+#define EH_UNWINDING        0x02
+#define EH_EXIT_UNWIND      0x04
+#define EH_STACK_INVALID    0x08
+#define EH_NESTED_CALL      0x10
+
+static inline EXCEPTION_REGISTRATION_RECORD *__wine_push_frame( EXCEPTION_REGISTRATION_RECORD *frame )
+{
+    frame->Next = (struct _EXCEPTION_REGISTRATION_RECORD *)__readfsdword(0);
+       __writefsdword(0, (unsigned long)frame);
+    return frame->Next;
+}
+
+static inline EXCEPTION_REGISTRATION_RECORD *__wine_pop_frame( EXCEPTION_REGISTRATION_RECORD *frame )
+{
+       __writefsdword(0, (unsigned long)frame->Next);
+    return frame->Next;
+}
+
+#define __TRY _SEH2_TRY
+#define __EXCEPT(func) _SEH2_EXCEPT(func(_SEH2_GetExceptionInformation()))
+#define __EXCEPT_PAGE_FAULT _SEH2_EXCEPT(_SEH2_GetExceptionCode() == STATUS_ACCESS_VIOLATION)
+#define __EXCEPT_ALL _SEH2_EXCEPT(_SEH_EXECUTE_HANDLER)
+#define __ENDTRY _SEH2_END
+#define __FINALLY(func) _SEH2_FINALLY { func(!_SEH2_AbnormalTermination()); }
+
 #define CXX_FRAME_MAGIC    0x19930520
 #define CXX_EXCEPTION      0xe06d7363
 
 #define CXX_FRAME_MAGIC    0x19930520
 #define CXX_EXCEPTION      0xe06d7363
 
index e4ffa64..2832688 100644 (file)
@@ -150,7 +150,7 @@ static void remap_synonym(char *name)
   size_t i;
   for (i = 0; i < sizeof(_country_synonyms)/sizeof(char*); i += 2 )
   {
   size_t i;
   for (i = 0; i < sizeof(_country_synonyms)/sizeof(char*); i += 2 )
   {
-    if (!strcasecmp(_country_synonyms[i],name))
+    if (!_stricmp(_country_synonyms[i],name))
     {
       TRACE(":Mapping synonym %s to %s\n",name,_country_synonyms[i+1]);
       name[0] = _country_synonyms[i+1][0];
     {
       TRACE(":Mapping synonym %s to %s\n",name,_country_synonyms[i+1]);
       name[0] = _country_synonyms[i+1][0];
@@ -172,7 +172,7 @@ static int compare_info(LCID lcid, DWORD flags, char* buff, const char* cmp)
   if (!buff[0] || !cmp[0])
     return 0;
   /* Partial matches are allowed, e.g. "Germ" matches "Germany" */
   if (!buff[0] || !cmp[0])
     return 0;
   /* Partial matches are allowed, e.g. "Germ" matches "Germany" */
-  return !strncasecmp(cmp, buff, strlen(cmp));
+  return !_strnicmp(cmp, buff, strlen(cmp));
 }
 
 
 }
 
 
@@ -271,12 +271,12 @@ static LCID MSVCRT_locale_to_LCID(locale_search_t* locale)
       else
       {
         /* Special codepage values: OEM & ANSI */
       else
       {
         /* Special codepage values: OEM & ANSI */
-        if (strcasecmp(locale->search_codepage,"OCP"))
+        if (_stricmp(locale->search_codepage,"OCP"))
         {
           GetLocaleInfoA(lcid, LOCALE_IDEFAULTCODEPAGE,
                          locale->found_codepage, MAX_ELEM_LEN);
         }
         {
           GetLocaleInfoA(lcid, LOCALE_IDEFAULTCODEPAGE,
                          locale->found_codepage, MAX_ELEM_LEN);
         }
-        if (strcasecmp(locale->search_codepage,"ACP"))
+        if (_stricmp(locale->search_codepage,"ACP"))
         {
           GetLocaleInfoA(lcid, LOCALE_IDEFAULTANSICODEPAGE,
                          locale->found_codepage, MAX_ELEM_LEN);
         {
           GetLocaleInfoA(lcid, LOCALE_IDEFAULTANSICODEPAGE,
                          locale->found_codepage, MAX_ELEM_LEN);
index 9b315ae..30511b8 100644 (file)
@@ -45,7 +45,7 @@ int _ismbslead( const unsigned char *start, const unsigned char *str)
 /*
  * @implemented
  */
 /*
  * @implemented
  */
-const unsigned char *__p__mbctype(void)
+unsigned char *__p__mbctype(void)
 {
   return _mbctype;
 }
 {
   return _mbctype;
 }
index d4979dd..0d8afa0 100644 (file)
@@ -39,7 +39,9 @@
 /* kernelmode libcnt should not include Wine-debugging crap */
 #ifndef _LIBCNT_
 #include "wine/debug.h"
 /* kernelmode libcnt should not include Wine-debugging crap */
 #ifndef _LIBCNT_
 #include "wine/debug.h"
+#ifndef __WINE_DEBUG_CHANNEL__
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
+#endif
 #else
 #include <debug.h>
 #define TRACE DPRINT
 #else
 #include <debug.h>
 #define TRACE DPRINT
index 07e6a06..178ff88 100755 (executable)
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  */
 
-#include "wine/config.h"
-#include "wine/port.h"
-
+#define __WINE_DEBUG_CHANNEL__
+#include <precomp.h>
 #include <assert.h>
 #include <assert.h>
-#include <stdio.h>
-#include <stdarg.h>
-
-#include "windef.h"
-#include "winbase.h"
-#include "winreg.h"
-#include "winternl.h"
-#include "wine/exception.h"
-#include "winnt.h"
-#include "excpt.h"
-#include "wine/debug.h"
-#include <malloc.h>
-#include <stdlib.h>
 
 #include <internal/wine/msvcrt.h>
 #include <internal/wine/cppexcept.h>
 
 #include <internal/wine/msvcrt.h>
 #include <internal/wine/cppexcept.h>
-#include <internal/mtdll.h>
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
 
 WINE_DEFAULT_DEBUG_CHANNEL(msvcrt);
 
index 7e6d9d2..79c35d4 100644 (file)
@@ -492,16 +492,7 @@ CmpDoCreate(IN PHHIVE Hive,
         ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyCell == Cell);
         ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyHive == Hive);
         ASSERT(KeyBody->KeyControlBlock->ParentKcb == ParentKcb);
         ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyCell == Cell);
         ASSERT(KeyBody->KeyControlBlock->ParentKcb->KeyHive == Hive);
         ASSERT(KeyBody->KeyControlBlock->ParentKcb == ParentKcb);
-        //ASSERT(KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen == KeyNode->MaxNameLen);
-        if (KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen != KeyNode->MaxNameLen)
-        {
-            /* HACK: this gets unsynced due to (?) mismatching KCB referencing */
-            DPRINT1("BUG: KCB MaxNameLen %d does not match KeyNode's MaxNameLen %d!\n",
-                KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen, KeyNode->MaxNameLen);
-
-            /* Manually sync MaxNameLens, remove once fixed */
-            KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen = KeyNode->MaxNameLen;
-        }
+        ASSERT(KeyBody->KeyControlBlock->ParentKcb->KcbMaxNameLen == KeyNode->MaxNameLen);
 
         /* Update the timestamp */
         KeQuerySystemTime(&TimeStamp);
 
         /* Update the timestamp */
         KeQuerySystemTime(&TimeStamp);
@@ -599,38 +590,74 @@ CmpDoOpen(IN PHHIVE Hive,
     /* If we have a KCB, make sure it's locked */
     //ASSERT(CmpIsKcbLockedExclusive(*CachedKcb));
 
     /* If we have a KCB, make sure it's locked */
     //ASSERT(CmpIsKcbLockedExclusive(*CachedKcb));
 
-    /* Check if this is a symlink */
-    if ((Node->Flags & KEY_SYM_LINK) && !(Attributes & OBJ_OPENLINK))
+    /* Check if caller doesn't want to create a KCB */
+    if (ControlFlags & CMP_OPEN_KCB_NO_CREATE)
     {
     {
-        /* Create the KCB for the symlink */
+        /* Check if this is a symlink */
+        if ((Node->Flags & KEY_SYM_LINK) && !(Attributes & OBJ_OPENLINK))
+        {
+            /* This case for a cached KCB is not implemented yet */
+            ASSERT(FALSE);
+        }
+
+        /* The caller wants to open a cached KCB */
+        if (!CmpReferenceKeyControlBlock(*CachedKcb))
+        {
+            /* Release the registry lock */
+            CmpUnlockRegistry();
+
+            /* Return failure code */
+            return STATUS_INSUFFICIENT_RESOURCES;
+        }
+
+        /* Our kcb is that one */
+        Kcb = *CachedKcb;
+    }
+    else
+    {
+        /* Check if this is a symlink */
+        if ((Node->Flags & KEY_SYM_LINK) && !(Attributes & OBJ_OPENLINK))
+        {
+            /* Create the KCB for the symlink */
+            Kcb = CmpCreateKeyControlBlock(Hive,
+                                           Cell,
+                                           Node,
+                                           *CachedKcb,
+                                           0,
+                                           KeyName);
+            if (!Kcb)
+            {
+                /* Release registry lock and return failure */
+                CmpUnlockRegistry();
+                return STATUS_INSUFFICIENT_RESOURCES;
+            }
+
+            /* Make sure it's also locked, and set the pointer */
+            //ASSERT(CmpIsKcbLockedExclusive(Kcb));
+            *CachedKcb = Kcb;
+
+            /* Release the registry lock */
+            CmpUnlockRegistry();
+
+            /* Return reparse required */
+            return STATUS_REPARSE;
+        }
+
+        /* Create the KCB. FIXME: Use lock flag */
         Kcb = CmpCreateKeyControlBlock(Hive,
                                        Cell,
                                        Node,
                                        *CachedKcb,
                                        0,
                                        KeyName);
         Kcb = CmpCreateKeyControlBlock(Hive,
                                        Cell,
                                        Node,
                                        *CachedKcb,
                                        0,
                                        KeyName);
-        if (!Kcb) return STATUS_INSUFFICIENT_RESOURCES;
-
-        /* Make sure it's also locked, and set the pointer */
-        //ASSERT(CmpIsKcbLockedExclusive(Kcb));
-        *CachedKcb = Kcb;
-
-        /* Release the registry lock */
-        CmpUnlockRegistry();
-
-        /* Return reparse required */
-        return STATUS_REPARSE;
+        if (!Kcb)
+        {
+            /* Release registry lock and return failure */
+            CmpUnlockRegistry();
+            return STATUS_INSUFFICIENT_RESOURCES;
+        }
     }
 
     }
 
-    /* Create the KCB. FIXME: Use lock flag */
-    Kcb = CmpCreateKeyControlBlock(Hive,
-                                   Cell,
-                                   Node,
-                                   *CachedKcb,
-                                   0,
-                                   KeyName);
-    if (!Kcb) return STATUS_INSUFFICIENT_RESOURCES;
-
     /* Make sure it's also locked, and set the pointer */
     //ASSERT(CmpIsKcbLockedExclusive(Kcb));
     *CachedKcb = Kcb;
     /* Make sure it's also locked, and set the pointer */
     //ASSERT(CmpIsKcbLockedExclusive(Kcb));
     *CachedKcb = Kcb;
@@ -977,7 +1004,13 @@ CmpBuildHashStackAndLookupCache(IN PCM_KEY_BODY ParseObject,
     /* Return hive and cell data */
     *Hive = (*Kcb)->KeyHive;
     *Cell = (*Kcb)->KeyCell;
     /* Return hive and cell data */
     *Hive = (*Kcb)->KeyHive;
     *Cell = (*Kcb)->KeyCell;
-    
+
+    /* Make sure it's not a dead KCB */
+    ASSERT((*Kcb)->RefCount > 0);
+
+    /* Reference it */
+    (VOID)CmpReferenceKeyControlBlock(*Kcb);
+
     /* Return success for now */
     return STATUS_SUCCESS;
 }
     /* Return success for now */
     return STATUS_SUCCESS;
 }
@@ -1197,7 +1230,7 @@ CmpParseKey(IN PVOID ParseObject,
                     if (!Kcb) ASSERT(FALSE);
                     
                     /* Dereference the parent and set the new one */
                     if (!Kcb) ASSERT(FALSE);
                     
                     /* Dereference the parent and set the new one */
-                    //CmpDereferenceKeyControlBlock(ParentKcb);
+                    CmpDereferenceKeyControlBlock(ParentKcb);
                     ParentKcb = Kcb;
                 }
                 else
                     ParentKcb = Kcb;
                 }
                 else
@@ -1302,10 +1335,7 @@ CmpParseKey(IN PVOID ParseObject,
                                   &CellToRelease);
                 if (!Node) ASSERT(FALSE);
             }
                                   &CellToRelease);
                 if (!Node) ASSERT(FALSE);
             }
-            
-            /* FIXME: This hack seems required? */
-            RtlInitUnicodeString(&NextName, L"\\REGISTRY");
-            
+
             /* Do the open */
             Status = CmpDoOpen(Hive,
                                Cell,
             /* Do the open */
             Status = CmpDoOpen(Hive,
                                Cell,
@@ -1314,7 +1344,7 @@ CmpParseKey(IN PVOID ParseObject,
                                AccessMode,
                                Attributes,
                                ParseContext,
                                AccessMode,
                                Attributes,
                                ParseContext,
-                               0,
+                               CMP_OPEN_KCB_NO_CREATE /* | CMP_CREATE_KCB_KCB_LOCKED */,
                                &Kcb,
                                &NextName,
                                Object);
                                &Kcb,
                                &NextName,
                                Object);
@@ -1336,7 +1366,7 @@ CmpParseKey(IN PVOID ParseObject,
 
     /* Dereference the parent if it exists */
 Quickie:
 
     /* Dereference the parent if it exists */
 Quickie:
-    //if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
+    if (ParentKcb) CmpDereferenceKeyControlBlock(ParentKcb);
     
     /* Unlock the registry */
     CmpUnlockRegistry();
     
     /* Unlock the registry */
     CmpUnlockRegistry();
index 4cc872d..91a0717 100644 (file)
 #define CMP_CREATE_FAKE_KCB                             0x1
 #define CMP_LOCK_HASHES_FOR_KCB                         0x2
 
 #define CMP_CREATE_FAKE_KCB                             0x1
 #define CMP_LOCK_HASHES_FOR_KCB                         0x2
 
+//
+// CmpDoCreate and CmpDoOpen flags
+//
+#define CMP_CREATE_KCB_KCB_LOCKED                       0x2
+#define CMP_OPEN_KCB_NO_CREATE                          0x4
+
 //
 // EnlistKeyBodyWithKCB Flags
 //
 #define CMP_ENLIST_KCB_LOCKED_SHARED                    0x1
 #define CMP_ENLIST_KCB_LOCKED_EXCLUSIVE                 0x2
 
 //
 // EnlistKeyBodyWithKCB Flags
 //
 #define CMP_ENLIST_KCB_LOCKED_SHARED                    0x1
 #define CMP_ENLIST_KCB_LOCKED_EXCLUSIVE                 0x2
 
+//
+// Unload Flags
+//
+#define CMP_UNLOCK_KCB_LOCKED                    0x1
+#define CMP_UNLOCK_REGISTRY_LOCKED               0x2
+
 //
 // Maximum size of Value Cache
 //
 //
 // Maximum size of Value Cache
 //
@@ -1420,6 +1432,13 @@ CmLoadKey(
     IN PCM_KEY_BODY KeyBody
 );
 
     IN PCM_KEY_BODY KeyBody
 );
 
+NTSTATUS
+NTAPI
+CmUnloadKey(
+    IN PCM_KEY_CONTROL_BLOCK Kcb,
+    IN ULONG Flags
+);
+
 //
 // Startup and Shutdown
 //
 //
 // Startup and Shutdown
 //
index 370be0a..d97adbe 100644 (file)
 .macro UNHANDLED_PATH
     /* Get EIP */
     call $+5
 .macro UNHANDLED_PATH
     /* Get EIP */
     call $+5
-    pop eax
 
     /* Print debug message */
 
     /* Print debug message */
-    push eax
     push offset _UnhandledMsg
     call _DbgPrint
     add esp, 8
     push offset _UnhandledMsg
     call _DbgPrint
     add esp, 8
index e940eb2..8e1638d 100644 (file)
@@ -104,6 +104,8 @@ DWORD FASTCALL ftGdiGetFontData(PFONTGDI,DWORD,DWORD,PVOID,DWORD);
 BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
 BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
 DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
 BOOL FASTCALL IntGdiGetFontResourceInfo(PUNICODE_STRING,PVOID,DWORD*,DWORD);
 BOOL FASTCALL ftGdiRealizationInfo(PFONTGDI,PREALIZATION_INFO);
 DWORD FASTCALL ftGdiGetKerningPairs(PFONTGDI,DWORD,LPKERNINGPAIR);
+BOOL NTAPI GreExtTextOutW(IN HDC,IN INT,IN INT,IN UINT,IN OPTIONAL LPRECT,
+    IN LPWSTR, IN INT, IN OPTIONAL LPINT, IN DWORD);
 
 #define IntLockProcessPrivateFonts(W32Process) \
   ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)
 
 #define IntLockProcessPrivateFonts(W32Process) \
   ExEnterCriticalRegionAndAcquireFastMutexUnsafe(&W32Process->PrivateFontListLock)
index c7a932c..5c09b29 100644 (file)
@@ -1536,7 +1536,7 @@ NtUserPaintDesktop(HDC hDC)
          align_old = IntGdiSetTextAlign(hDC, TA_RIGHT);
          mode_old = IntGdiSetBkMode(hDC, TRANSPARENT);
 
          align_old = IntGdiSetTextAlign(hDC, TA_RIGHT);
          mode_old = IntGdiSetBkMode(hDC, TRANSPARENT);
 
-         NtGdiExtTextOutW(hDC, rect.right-16, rect.bottom-48, 0, NULL, s_wszVersion, len, NULL, 0);
+         GreExtTextOutW(hDC, rect.right-16, rect.bottom-48, 0, NULL, s_wszVersion, len, NULL, 0);
 
          IntGdiSetBkMode(hDC, mode_old);
          IntGdiSetTextAlign(hDC, align_old);
 
          IntGdiSetBkMode(hDC, mode_old);
          IntGdiSetTextAlign(hDC, align_old);
index 10e2622..995dddf 100644 (file)
@@ -1594,7 +1594,7 @@ UserDrawCaptionText(HDC hDc,
 
    //FIXME: If string doesn't fit to rc, truncate it and add ellipsis.
 
 
    //FIXME: If string doesn't fit to rc, truncate it and add ellipsis.
 
-   NtGdiExtTextOutW(hDc, lpRc->left,
+   GreExtTextOutW(hDc, lpRc->left,
       lpRc->top, 0, NULL, Text->Buffer,
       Text->Length/sizeof(WCHAR), NULL, 0);
 
       lpRc->top, 0, NULL, Text->Buffer,
       Text->Length/sizeof(WCHAR), NULL, 0);
 
index 4bb1b28..8925dd2 100644 (file)
@@ -315,6 +315,11 @@ co_IntInitializeDesktopGraphics(VOID)
    NtGdiSelectFont( hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
    IntGdiSetDCOwnerEx( hSystemBM, GDI_OBJ_HMGR_PUBLIC, FALSE);
 
    NtGdiSelectFont( hSystemBM, NtGdiGetStockObject(SYSTEM_FONT));
    IntGdiSetDCOwnerEx( hSystemBM, GDI_OBJ_HMGR_PUBLIC, FALSE);
 
+   // FIXME! Move these to a update routine.
+   gpsi->Planes    = NtGdiGetDeviceCaps(ScreenDeviceContext, PLANES);
+   gpsi->BitsPixel = NtGdiGetDeviceCaps(ScreenDeviceContext, BITSPIXEL);
+   gpsi->BitCount  = gpsi->Planes * gpsi->BitsPixel;
+
    return TRUE;
 }
 
    return TRUE;
 }
 
index f1c7a1c..1f49571 100644 (file)
@@ -728,6 +728,10 @@ NtGdiHfontCreate(
   PTEXTOBJ TextObj;
   NTSTATUS Status = STATUS_SUCCESS;
 
   PTEXTOBJ TextObj;
   NTSTATUS Status = STATUS_SUCCESS;
 
+  /* Silence GCC warnings */
+  SafeLogfont.elfEnumLogfontEx.elfLogFont.lfEscapement = 0;
+  SafeLogfont.elfEnumLogfontEx.elfLogFont.lfOrientation = 0;
+
   if (!pelfw)
   {
       return NULL;
   if (!pelfw)
   {
       return NULL;
index af69675..9763661 100644 (file)
@@ -3079,15 +3079,15 @@ NtGdiGetFontFamilyInfo(HDC Dc,
 
 BOOL
 APIENTRY
 
 BOOL
 APIENTRY
-NtGdiExtTextOutW(
+GreExtTextOutW(
     IN HDC hDC,
     IN INT XStart,
     IN INT YStart,
     IN UINT fuOptions,
     IN OPTIONAL LPRECT lprc,
     IN HDC hDC,
     IN INT XStart,
     IN INT YStart,
     IN UINT fuOptions,
     IN OPTIONAL LPRECT lprc,
-    IN LPWSTR UnsafeString,
+    IN LPWSTR String,
     IN INT Count,
     IN INT Count,
-    IN OPTIONAL LPINT UnsafeDx,
+    IN OPTIONAL LPINT Dx,
     IN DWORD dwCodePage)
 {
     /*
     IN DWORD dwCodePage)
 {
     /*
@@ -3108,7 +3108,7 @@ NtGdiExtTextOutW(
     LONGLONG TextLeft, RealXStart;
     ULONG TextTop, previous, BackgroundLeft;
     FT_Bool use_kerning;
     LONGLONG TextLeft, RealXStart;
     ULONG TextTop, previous, BackgroundLeft;
     FT_Bool use_kerning;
-    RECTL DestRect, MaskRect, SpecifiedDestRect;
+    RECTL DestRect, MaskRect;
     POINTL SourcePoint, BrushOrigin;
     HBRUSH hBrushFg = NULL;
     PGDIBRUSHOBJ BrushFg = NULL;
     POINTL SourcePoint, BrushOrigin;
     HBRUSH hBrushFg = NULL;
     PGDIBRUSHOBJ BrushFg = NULL;
@@ -3129,12 +3129,10 @@ NtGdiExtTextOutW(
     ULONG Mode;
     FT_Render_Mode RenderMode;
     BOOLEAN Render;
     ULONG Mode;
     FT_Render_Mode RenderMode;
     BOOLEAN Render;
-    NTSTATUS Status;
-    INT *Dx = NULL;
     POINT Start;
     BOOL DoBreak = FALSE;
     POINT Start;
     BOOL DoBreak = FALSE;
-    LPCWSTR String, SafeString = NULL;
     HPALETTE hDestPalette;
     HPALETTE hDestPalette;
+    USHORT DxShift;
 
     // TODO: Write test-cases to exactly match real Windows in different
     // bad parameters (e.g. does Windows check the DC or the RECT first?).
 
     // TODO: Write test-cases to exactly match real Windows in different
     // bad parameters (e.g. does Windows check the DC or the RECT first?).
@@ -3155,49 +3153,13 @@ NtGdiExtTextOutW(
     if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
 
     /* Check if String is valid */
     if (!Dc_Attr) Dc_Attr = &dc->Dc_Attr;
 
     /* Check if String is valid */
-    if ((Count > 0xFFFF) || (Count > 0 && UnsafeString == NULL))
+    if ((Count > 0xFFFF) || (Count > 0 && String == NULL))
     {
         SetLastWin32Error(ERROR_INVALID_PARAMETER);
         goto fail;
     }
     {
         SetLastWin32Error(ERROR_INVALID_PARAMETER);
         goto fail;
     }
-    if (Count > 0)
-    {
-        SafeString = ExAllocatePoolWithTag(PagedPool, Count * sizeof(WCHAR), TAG_GDITEXT);
-        if (!SafeString)
-        {
-            goto fail;
-        }
-        Status = MmCopyFromCaller(SafeString, UnsafeString, Count * sizeof(WCHAR));
-        if (! NT_SUCCESS(Status))
-        {
-            goto fail;
-        }
-    }
-    String = SafeString;
-
-    if (NULL != UnsafeDx && Count > 0)
-    {
-        Dx = ExAllocatePoolWithTag(PagedPool, Count * sizeof(INT), TAG_GDITEXT);
-        if (NULL == Dx)
-        {
-            goto fail;
-        }
-        Status = MmCopyFromCaller(Dx, UnsafeDx, Count * sizeof(INT));
-        if (!NT_SUCCESS(Status))
-        {
-            goto fail;
-        }
-    }
 
 
-    if (lprc)
-    {
-        Status = MmCopyFromCaller(&SpecifiedDestRect, lprc, sizeof(RECT));
-        if (!NT_SUCCESS(Status))
-        {
-            SetLastWin32Error(ERROR_INVALID_PARAMETER);
-            goto fail;
-        }
-    }
+    DxShift = fuOptions & ETO_PDY ? 1 : 0;
 
     if (PATH_IsPathOpen(dc->DcLevel))
     {
 
     if (PATH_IsPathOpen(dc->DcLevel))
     {
@@ -3205,8 +3167,8 @@ NtGdiExtTextOutW(
                               XStart,
                               YStart,
                               fuOptions,
                               XStart,
                               YStart,
                               fuOptions,
-                              (const RECT *)&SpecifiedDestRect,
-                              SafeString,
+                              (const RECT *)lprc,
+                              String,
                               Count,
                               (const INT *)Dx)) goto fail;
         goto good;
                               Count,
                               (const INT *)Dx)) goto fail;
         goto good;
@@ -3214,7 +3176,7 @@ NtGdiExtTextOutW(
 
     if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
     {
 
     if (lprc && (fuOptions & (ETO_OPAQUE | ETO_CLIPPED)))
     {
-        IntLPtoDP(dc, (POINT *) &SpecifiedDestRect, 2);
+        IntLPtoDP(dc, (POINT *)lprc, 2);
     }
 
     BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
     }
 
     BitmapObj = BITMAPOBJ_LockBitmap(dc->w.hBitmap);
@@ -3288,10 +3250,10 @@ NtGdiExtTextOutW(
 
     if ((fuOptions & ETO_OPAQUE) && lprc)
     {
 
     if ((fuOptions & ETO_OPAQUE) && lprc)
     {
-        DestRect.left   = SpecifiedDestRect.left   + dc->ptlDCOrig.x;
-        DestRect.top    = SpecifiedDestRect.top    + dc->ptlDCOrig.y;
-        DestRect.right  = SpecifiedDestRect.right  + dc->ptlDCOrig.x;
-        DestRect.bottom = SpecifiedDestRect.bottom + dc->ptlDCOrig.y;
+        DestRect.left   = lprc->left   + dc->ptlDCOrig.x;
+        DestRect.top    = lprc->top    + dc->ptlDCOrig.y;
+        DestRect.right  = lprc->right  + dc->ptlDCOrig.x;
+        DestRect.bottom = lprc->bottom + dc->ptlDCOrig.y;
         IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
         IntEngBitBlt(
             &BitmapObj->SurfObj,
         IntLPtoDP(dc, (LPPOINT)&DestRect, 2);
         IntEngBitBlt(
             &BitmapObj->SurfObj,
@@ -3405,7 +3367,7 @@ NtGdiExtTextOutW(
         if (NULL != Dx)
         {
             Start = Count < 2 ? 0 : Count - 2;
         if (NULL != Dx)
         {
             Start = Count < 2 ? 0 : Count - 2;
-            TextWidth = Count < 2 ? 0 : (Dx[Count - 2] << 6);
+            TextWidth = Count < 2 ? 0 : (Dx[(Count-2)<<DxShift] << 6);
         }
         else
         {
         }
         else
         {
@@ -3602,12 +3564,12 @@ NtGdiExtTextOutW(
 
         if (lprc &&
                 (fuOptions & ETO_CLIPPED) &&
 
         if (lprc &&
                 (fuOptions & ETO_CLIPPED) &&
-                DestRect.right >= SpecifiedDestRect.right + dc->ptlDCOrig.x)
+                DestRect.right >= lprc->right + dc->ptlDCOrig.x)
         {
             // We do the check '>=' instead of '>' to possibly save an iteration
             // through this loop, since it's breaking after the drawing is done,
             // and x is always incremented.
         {
             // We do the check '>=' instead of '>' to possibly save an iteration
             // through this loop, since it's breaking after the drawing is done,
             // and x is always incremented.
-            DestRect.right = SpecifiedDestRect.right + dc->ptlDCOrig.x;
+            DestRect.right = lprc->right + dc->ptlDCOrig.x;
             DoBreak = TRUE;
         }
 
             DoBreak = TRUE;
         }
 
@@ -3638,7 +3600,7 @@ NtGdiExtTextOutW(
         }
         else
         {
         }
         else
         {
-            TextLeft += Dx[i] << 6;
+            TextLeft += Dx[i<<DxShift] << 6;
 //         DbgPrint("new TextLeft2: %d\n", TextLeft);
         }
         previous = glyph_index;
 //         DbgPrint("new TextLeft2: %d\n", TextLeft);
         }
         previous = glyph_index;
@@ -3661,14 +3623,6 @@ NtGdiExtTextOutW(
     BRUSHOBJ_UnlockBrush(BrushFg);
     NtGdiDeleteObject(hBrushFg);
 good:
     BRUSHOBJ_UnlockBrush(BrushFg);
     NtGdiDeleteObject(hBrushFg);
 good:
-    if (NULL != SafeString)
-    {
-        ExFreePoolWithTag((void*)SafeString, TAG_GDITEXT);
-    }
-    if (NULL != Dx)
-    {
-        ExFreePoolWithTag(Dx, TAG_GDITEXT);
-    }
     DC_UnlockDc( dc );
 
     return TRUE;
     DC_UnlockDc( dc );
 
     return TRUE;
@@ -3692,19 +3646,132 @@ fail:
         BRUSHOBJ_UnlockBrush(BrushFg);
         NtGdiDeleteObject(hBrushFg);
     }
         BRUSHOBJ_UnlockBrush(BrushFg);
         NtGdiDeleteObject(hBrushFg);
     }
-    if (NULL != SafeString)
+    DC_UnlockDc(dc);
+
+    return FALSE;
+}
+
+#define STACK_TEXT_BUFFER_SIZE 50
+BOOL
+APIENTRY
+NtGdiExtTextOutW(
+    IN HDC hDC,
+    IN INT XStart,
+    IN INT YStart,
+    IN UINT fuOptions,
+    IN OPTIONAL LPRECT UnsafeRect,
+    IN LPWSTR UnsafeString,
+    IN INT Count,
+    IN OPTIONAL LPINT UnsafeDx,
+    IN DWORD dwCodePage)
+{
+    BOOL Result = FALSE;
+    NTSTATUS Status = STATUS_SUCCESS;
+    RECT SafeRect;
+    BYTE LocalBuffer[STACK_TEXT_BUFFER_SIZE];
+    PVOID Buffer = LocalBuffer;
+    LPWSTR SafeString = NULL;
+    LPINT SafeDx = NULL;
+    ULONG BufSize, StringSize, DxSize = 0;
+
+    /* Check if String is valid */
+    if ((Count > 0xFFFF) || (Count > 0 && UnsafeString == NULL))
     {
     {
-        ExFreePoolWithTag((void*)SafeString, TAG_GDITEXT);
+        SetLastWin32Error(ERROR_INVALID_PARAMETER);
+        return FALSE;
     }
     }
-    if (NULL != Dx)
+
+    if (Count > 0)
     {
     {
-        ExFreePoolWithTag(Dx, TAG_GDITEXT);
+        /* Calculate buffer size for string and Dx values */
+        BufSize = StringSize = Count * sizeof(WCHAR);
+        if (UnsafeDx)
+        {
+            /* If ETO_PDY is specified, we have pairs of INTs */
+            DxSize = (Count * sizeof(INT)) * (fuOptions & ETO_PDY ? 2 : 1);
+            BufSize += DxSize;
+        }
+
+        /* Check if our local buffer is large enough */
+        if (BufSize > STACK_TEXT_BUFFER_SIZE)
+        {
+            /* It's not, allocate a temp buffer */
+            Buffer = ExAllocatePoolWithTag(PagedPool, BufSize, TAG_GDITEXT);
+            if (!Buffer)
+            {
+                return FALSE;
+            }
+        }
+
+        /* Probe and copy user mode data to the buffer */
+        _SEH2_TRY
+        {
+            /* Probe and copy the string */
+            ProbeForRead(UnsafeString, StringSize, 1);
+            SafeString = Buffer;
+            memcpy((PVOID)SafeString, UnsafeString, StringSize);
+
+            /* If we have Dx values... */
+            if (UnsafeDx)
+            {
+                /* ... probe and copy them */
+                ProbeForRead(UnsafeDx, DxSize, 1);
+                SafeDx = (LPINT)(((ULONG_PTR)Buffer) + StringSize);
+                memcpy(SafeDx, UnsafeDx, DxSize);
+            }
+        }
+        _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+        {
+            Status = _SEH2_GetExceptionCode();
+        }
+        _SEH2_END
+        if (!NT_SUCCESS(Status))
+        {
+            goto cleanup;
+        }
     }
     }
-    DC_UnlockDc(dc);
 
 
-    return FALSE;
+    /* If we have a rect, copy it */
+    if (UnsafeRect)
+    {
+        _SEH2_TRY
+        {
+            ProbeForRead(UnsafeRect, sizeof(RECT), 1);
+            SafeRect = *UnsafeRect;
+        }
+        _SEH2_EXCEPT(EXCEPTION_EXECUTE_HANDLER)
+        {
+            Status = _SEH2_GetExceptionCode();
+        }
+        _SEH2_END
+        if (!NT_SUCCESS(Status))
+        {
+            goto cleanup;
+        }
+    }
+
+    /* Finally call the internal routine */
+    Result = GreExtTextOutW(hDC,
+                            XStart,
+                            YStart,
+                            fuOptions,
+                            &SafeRect,
+                            SafeString,
+                            Count,
+                            SafeDx,
+                            dwCodePage);
+
+cleanup:
+    /* If we allocated a buffer, free it */
+    if (Buffer != LocalBuffer)
+    {
+        ExFreePoolWithTag(Buffer, TAG_GDITEXT);
+    }
+
+    return Result;;
 }
 
 }
 
+
 /*
 * @implemented
 */
 /*
 * @implemented
 */
index ac13ac1..2f3aa85 100644 (file)
@@ -60,7 +60,7 @@ SourceFile::Open ()
        if ( !f )
                throw FileNotFoundException ( filename );
 
        if ( !f )
                throw FileNotFoundException ( filename );
 
-       if ( fstat ( fileno ( f ), &statbuf ) != 0 )
+       if ( fstat ( _fileno ( f ), &statbuf ) != 0 )
        {
                fclose ( f );
                throw AccessDeniedException ( filename );
        {
                fclose ( f );
                throw AccessDeniedException ( filename );
index c722768..51ae59c 100644 (file)
@@ -32,7 +32,7 @@ Backend::Factory::ref = 0;
 Backend::Factory::Factory ( const std::string& name_, const std::string& description_ )
 {
        string name(name_);
 Backend::Factory::Factory ( const std::string& name_, const std::string& description_ )
 {
        string name(name_);
-       strlwr ( &name[0] );
+       _strlwr ( &name[0] );
        if ( !ref++ )
                factories = new map<string,Factory*>;
        (*factories)[name] = this;
        if ( !ref++ )
                factories = new map<string,Factory*>;
        (*factories)[name] = this;
@@ -55,7 +55,7 @@ Backend::Factory::Create ( const string& name,
                            Configuration& configuration )
 {
        string sname ( name );
                            Configuration& configuration )
 {
        string sname ( name );
-       strlwr ( &sname[0] );
+       _strlwr ( &sname[0] );
        if ( !factories || !factories->size () )
                throw InvalidOperationException ( __FILE__,
                                                  __LINE__,
        if ( !factories || !factories->size () )
                throw InvalidOperationException ( __FILE__,
                                                  __LINE__,
index 9648bc4..5c6c5cf 100644 (file)
@@ -268,7 +268,7 @@ CBBackend::_get_object_files ( const Module& module, vector<string>& out) const
                        string::size_type pos = file.find_last_of (sSep);
                        if ( pos != string::npos )
                                file.erase ( 0, pos+1 );
                        string::size_type pos = file.find_last_of (sSep);
                        if ( pos != string::npos )
                                file.erase ( 0, pos+1 );
-                       if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+                       if ( !_stricmp ( Right(file,3).c_str(), ".rc" ) )
                                file = ReplaceExtension ( file, ".res" );
                        else
                                file = ReplaceExtension ( file, ".obj" );
                                file = ReplaceExtension ( file, ".res" );
                        else
                                file = ReplaceExtension ( file, ".obj" );
@@ -429,7 +429,7 @@ CBBackend::_generate_cbproj ( const Module& module )
                        string fullpath = files[i]->file.relative_path + sSep + files[i]->file.name;
                        string file = string(".") + &fullpath[cbproj_path.size()];
 
                        string fullpath = files[i]->file.relative_path + sSep + files[i]->file.name;
                        string file = string(".") + &fullpath[cbproj_path.size()];
 
-                       if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+                       if ( !_stricmp ( Right(file,3).c_str(), ".rc" ) )
                                resource_files.push_back ( file );
                        else
                                source_files.push_back ( file );
                                resource_files.push_back ( file );
                        else
                                source_files.push_back ( file );
index ae63c05..ad25135 100644 (file)
@@ -625,7 +625,7 @@ MingwBackend::GenerateXmlBuildFilesMacro() const
                if ( !f )
                throw FileNotFoundException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) );
 
                if ( !f )
                throw FileNotFoundException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) );
 
-               if ( fstat ( fileno ( f ), &statbuf ) != 0 )
+               if ( fstat ( _fileno ( f ), &statbuf ) != 0 )
                {
                        fclose ( f );
                        throw AccessDeniedException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) );
                {
                        fclose ( f );
                        throw AccessDeniedException ( NormalizeFilename ( xmlbuildfile.topIncludeFilename ) );
@@ -1068,7 +1068,7 @@ MingwBackend::DetectPipeSupport ()
        {
                usePipe = (exitcode == 0);
                fclose ( f );
        {
                usePipe = (exitcode == 0);
                fclose ( f );
-               unlink ( pipe_detectionObjectFilename.c_str () );
+               _unlink ( pipe_detectionObjectFilename.c_str () );
        }
        else
                usePipe = false;
        }
        else
                usePipe = false;
@@ -1101,7 +1101,7 @@ MingwBackend::DetectPCHSupport ()
                {
                        use_pch = true;
                        fclose ( f );
                {
                        use_pch = true;
                        fclose ( f );
-                       unlink ( path.c_str () );
+                       _unlink ( path.c_str () );
                }
                else
                        use_pch = false;
                }
                else
                        use_pch = false;
index d6c0022..874cec5 100644 (file)
@@ -69,7 +69,7 @@ string
 GetTargetMacro ( const Module& module, bool with_dollar )
 {
        string s ( module.name );
 GetTargetMacro ( const Module& module, bool with_dollar )
 {
        string s ( module.name );
-       strupr ( &s[0] );
+       _strupr ( &s[0] );
        s += "_TARGET";
        if ( with_dollar )
                return ssprintf ( "$(%s)", s.c_str() );
        s += "_TARGET";
        if ( with_dollar )
                return ssprintf ( "$(%s)", s.c_str() );
@@ -2406,13 +2406,13 @@ MingwAddCRTLibrary( Module &module )
        const char * crtAttr = module.CRT.c_str ();
        const char * crtLib = NULL;
 
        const char * crtAttr = module.CRT.c_str ();
        const char * crtLib = NULL;
 
-       if ( stricmp ( crtAttr, "libc" ) == 0 )
+       if ( _stricmp ( crtAttr, "libc" ) == 0 )
                crtLib = "crt";
                crtLib = "crt";
-       else if ( stricmp ( crtAttr, "msvcrt" ) == 0 )
+       else if ( _stricmp ( crtAttr, "msvcrt" ) == 0 )
                crtLib = "msvcrt";
                crtLib = "msvcrt";
-       else if ( stricmp ( crtAttr, "libcntpr" ) == 0 )
+       else if ( _stricmp ( crtAttr, "libcntpr" ) == 0 )
                crtLib = "libcntpr";
                crtLib = "libcntpr";
-       else if ( stricmp ( crtAttr, "ntdll" ) == 0 )
+       else if ( _stricmp ( crtAttr, "ntdll" ) == 0 )
                crtLib = "ntdll";
 
        if ( crtLib )
                crtLib = "ntdll";
 
        if ( crtLib )
index aa29317..573fc36 100644 (file)
@@ -340,7 +340,7 @@ MSVCBackend::_get_object_files ( const Module& module, vector<string>& out) cons
                        string::size_type pos = file.find_last_of (DEF_SSEP);
                        if ( pos != string::npos )
                                file.erase ( 0, pos+1 );
                        string::size_type pos = file.find_last_of (DEF_SSEP);
                        if ( pos != string::npos )
                                file.erase ( 0, pos+1 );
-                       if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+                       if ( !_stricmp ( Right(file,3).c_str(), ".rc" ) )
                                file = ReplaceExtension ( file, ".res" );
                        else
                                file = ReplaceExtension ( file, ".obj" );
                                file = ReplaceExtension ( file, ".res" );
                        else
                                file = ReplaceExtension ( file, ".obj" );
index b437e6d..1a7d171 100644 (file)
@@ -108,11 +108,11 @@ MSVCBackend::_generate_dsp ( const Module& module )
                        string file = path + std::string("\\") + files[i]->file.name;
 
                        source_files.push_back ( file );
                        string file = path + std::string("\\") + files[i]->file.name;
 
                        source_files.push_back ( file );
-                       if ( !stricmp ( Right(file,2).c_str(), ".c" ) )
+                       if ( !_stricmp ( Right(file,2).c_str(), ".c" ) )
                                c_srcs.push_back ( file );
                                c_srcs.push_back ( file );
-                       if ( !stricmp ( Right(file,2).c_str(), ".h" ) )
+                       if ( !_stricmp ( Right(file,2).c_str(), ".h" ) )
                                header_files.push_back ( file );
                                header_files.push_back ( file );
-                       if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+                       if ( !_stricmp ( Right(file,3).c_str(), ".rc" ) )
                                resource_files.push_back ( file );
                }
                const vector<Include*>& incs = data.includes;
                                resource_files.push_back ( file );
                }
                const vector<Include*>& incs = data.includes;
index ed744fb..ac1059d 100644 (file)
@@ -159,9 +159,9 @@ MSVCBackend::_generate_vcproj ( const Module& module )
                                module.output->relative_path );
                        string file = path + std::string("\\") + files[i]->file.name;
 
                                module.output->relative_path );
                        string file = path + std::string("\\") + files[i]->file.name;
 
-                       if ( !stricmp ( Right(file,3).c_str(), ".rc" ) )
+                       if ( !_stricmp ( Right(file,3).c_str(), ".rc" ) )
                                resource_files.push_back ( file );
                                resource_files.push_back ( file );
-                       else if ( !stricmp ( Right(file,2).c_str(), ".h" ) )
+                       else if ( !_stricmp ( Right(file,2).c_str(), ".h" ) )
                                header_files.push_back ( file );
                        else
                                source_files.push_back ( file );
                                header_files.push_back ( file );
                        else
                                source_files.push_back ( file );
index 35d0311..81eb387 100644 (file)
@@ -88,7 +88,7 @@ CompilationUnit::HasFileWithExtension ( const std::string& extension ) const
        {
                const File& file = *files[i];
                string fileExtension = GetExtension ( file.file );
        {
                const File& file = *files[i];
                string fileExtension = GetExtension ( file.file );
-               if ( !stricmp ( fileExtension.c_str (), extension.c_str () ) )
+               if ( !_stricmp ( fileExtension.c_str (), extension.c_str () ) )
                        return true;
        }
        return false;
                        return true;
        }
        return false;
index 3813283..9b9ce3e 100644 (file)
@@ -26,7 +26,7 @@
 #endif//_MSC_VER
 
 #ifdef WIN32
 #endif//_MSC_VER
 
 #ifdef WIN32
-#define MKDIR(s) mkdir(s)
+#define MKDIR(s) _mkdir(s)
 #else
 #define MKDIR(s) mkdir(s, 0755)
 #endif
 #else
 #define MKDIR(s) mkdir(s, 0755)
 #endif
index b0670e2..64823bb 100644 (file)
@@ -238,9 +238,9 @@ bool Module::GetBooleanAttribute ( const XMLElement& moduleNode, const char * na
        if ( att != NULL )
        {
                const char* p = att->value.c_str();
        if ( att != NULL )
        {
                const char* p = att->value.c_str();
-               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
+               if ( !_stricmp ( p, "true" ) || !_stricmp ( p, "yes" ) )
                        return true;
                        return true;
-               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
+               else if ( !_stricmp ( p, "false" ) || !_stricmp ( p, "no" ) )
                        return false;
                else
                {
                        return false;
                else
                {
@@ -358,26 +358,26 @@ Module::Module ( const Project& project,
        {
                CRT = att->value;
 
        {
                CRT = att->value;
 
-               if ( stricmp ( CRT.c_str (), "auto" ) == 0 )
+               if ( _stricmp ( CRT.c_str (), "auto" ) == 0 )
                        CRT = GetDefaultModuleCRT ();
        }
        else
                CRT = GetDefaultModuleCRT ();
 
        const char * crtAttr = CRT.c_str ();
                        CRT = GetDefaultModuleCRT ();
        }
        else
                CRT = GetDefaultModuleCRT ();
 
        const char * crtAttr = CRT.c_str ();
-       if ( crtAttr == NULL || stricmp ( crtAttr, "none" ) == 0 )
+       if ( crtAttr == NULL || _stricmp ( crtAttr, "none" ) == 0 )
                dynamicCRT = false;
                dynamicCRT = false;
-       else if ( stricmp ( crtAttr, "libc" ) == 0 )
+       else if ( _stricmp ( crtAttr, "libc" ) == 0 )
                dynamicCRT = false;
                dynamicCRT = false;
-       else if ( stricmp ( crtAttr, "msvcrt" ) == 0 )
+       else if ( _stricmp ( crtAttr, "msvcrt" ) == 0 )
                dynamicCRT = true;
                dynamicCRT = true;
-       else if ( stricmp ( crtAttr, "libcntpr" ) == 0 )
+       else if ( _stricmp ( crtAttr, "libcntpr" ) == 0 )
                dynamicCRT = false;
                dynamicCRT = false;
-       else if ( stricmp ( crtAttr, "ntdll" ) == 0 )
+       else if ( _stricmp ( crtAttr, "ntdll" ) == 0 )
                dynamicCRT = true;
                dynamicCRT = true;
-       else if ( stricmp ( crtAttr, "static" ) == 0 )
+       else if ( _stricmp ( crtAttr, "static" ) == 0 )
                dynamicCRT = false;
                dynamicCRT = false;
-       else if ( stricmp ( crtAttr, "dll" ) == 0 )
+       else if ( _stricmp ( crtAttr, "dll" ) == 0 )
                dynamicCRT = true;
        else
        {
                dynamicCRT = true;
        else
        {
@@ -609,9 +609,9 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
                const XMLAttribute* att = e.GetAttribute ( "first", false );
                if ( att != NULL )
                {
                const XMLAttribute* att = e.GetAttribute ( "first", false );
                if ( att != NULL )
                {
-                       if ( !stricmp ( att->value.c_str(), "true" ) )
+                       if ( !_stricmp ( att->value.c_str(), "true" ) )
                                first = true;
                                first = true;
-                       else if ( stricmp ( att->value.c_str(), "false" ) )
+                       else if ( _stricmp ( att->value.c_str(), "false" ) )
                        {
                                throw XMLInvalidBuildFileException (
                                        e.location,
                        {
                                throw XMLInvalidBuildFileException (
                                        e.location,
@@ -626,11 +626,11 @@ Module::ProcessXMLSubElement ( const XMLElement& e,
                {
                        // check for c++ file
                        string ext = GetExtension ( e.value );
                {
                        // check for c++ file
                        string ext = GetExtension ( e.value );
-                       if ( !stricmp ( ext.c_str(), ".cpp" ) )
+                       if ( !_stricmp ( ext.c_str(), ".cpp" ) )
                                cplusplus = true;
                                cplusplus = true;
-                       else if ( !stricmp ( ext.c_str(), ".cc" ) )
+                       else if ( !_stricmp ( ext.c_str(), ".cc" ) )
                                cplusplus = true;
                                cplusplus = true;
-                       else if ( !stricmp ( ext.c_str(), ".cxx" ) )
+                       else if ( !_stricmp ( ext.c_str(), ".cxx" ) )
                                cplusplus = true;
                }
                File* pFile = new File ( directory,
                                cplusplus = true;
                }
                File* pFile = new File ( directory,
@@ -1865,9 +1865,9 @@ Property::Property ( const XMLElement& node_,
        if ( att != NULL )
        {
                const char* p = att->value.c_str();
        if ( att != NULL )
        {
                const char* p = att->value.c_str();
-               if ( !stricmp ( p, "true" ) || !stricmp ( p, "yes" ) )
+               if ( !_stricmp ( p, "true" ) || !_stricmp ( p, "yes" ) )
                        isInternal = true;
                        isInternal = true;
-               else if ( !stricmp ( p, "false" ) || !stricmp ( p, "no" ) )
+               else if ( !_stricmp ( p, "false" ) || !_stricmp ( p, "no" ) )
                        isInternal = false;
                else
                {
                        isInternal = false;
                else
                {
index 603e144..7e218d6 100644 (file)
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..,../../lib/inflib,../../include/reactos;../../include"\r
                                Name="VCCLCompilerTool"\r
                                Optimization="0"\r
                                AdditionalIncludeDirectories="..,../../lib/inflib,../../include/reactos;../../include"\r
-                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;INFLIB_HOST;_CRT_SECURE_NO_WARNINGS"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;INFLIB_HOST;_CRT_SECURE_NO_WARNINGS;_CRT_SECURE_NO_DEPRECATE"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                                DefaultCharIsUnsigned="true"\r
                                BasicRuntimeChecks="3"\r
                                RuntimeLibrary="1"\r
                                DefaultCharIsUnsigned="true"\r
index 51d2039..179e60b 100644 (file)
@@ -293,7 +293,7 @@ TestSupportCode::GetTestDispatcherName ( string filename )
 bool
 TestSupportCode::IsTestFile ( string& filename ) const
 {
 bool
 TestSupportCode::IsTestFile ( string& filename ) const
 {
-       if ( stricmp ( GetFilename ( filename ).c_str (), "setup.c" ) == 0 )
+       if ( _stricmp ( GetFilename ( filename ).c_str (), "setup.c" ) == 0 )
                return false;
        return true;
 }
                return false;
        return true;
 }