From f7a525a34bf1e09be0b224a1118843b699fa52d4 Mon Sep 17 00:00:00 2001 From: Gunnar Dalsnes Date: Thu, 17 Feb 2005 11:38:16 +0000 Subject: [PATCH] add workarounds for mingw runtime version differences gave directory routines a good cleanup (based on wine) more tcharizing of routines svn path=/trunk/; revision=13615 --- reactos/lib/crt/direct/chdir.c | 7 +- reactos/lib/crt/direct/chdrive.c | 47 ++++++------ reactos/lib/crt/direct/getcwd.c | 42 ++++++----- reactos/lib/crt/direct/getdcwd.c | 71 ++++++++++++++----- reactos/lib/crt/direct/getdrive.c | 41 ++++++----- reactos/lib/crt/direct/mkdir.c | 6 +- reactos/lib/crt/direct/rmdir.c | 6 +- reactos/lib/crt/direct/wchdir.c | 19 ++--- reactos/lib/crt/direct/wgetcwd.c | 29 +------- reactos/lib/crt/direct/wgetdcwd.c | 33 +-------- reactos/lib/crt/direct/wmkdir.c | 18 +---- reactos/lib/crt/direct/wrmdir.c | 18 +---- reactos/lib/crt/float/fpclass.c | 5 ++ .../include/internal/{msvcrtdbg.h => debug.h} | 0 reactos/lib/crt/include/internal/file.h | 4 ++ reactos/lib/crt/io/access.c | 2 +- reactos/lib/crt/io/chmod.c | 2 +- reactos/lib/crt/io/chsize.c | 2 +- reactos/lib/crt/io/close.c | 2 +- reactos/lib/crt/io/create.c | 2 +- reactos/lib/crt/io/find.c | 12 +++- reactos/lib/crt/io/isatty.c | 2 +- reactos/lib/crt/io/mktemp.c | 2 +- reactos/lib/crt/io/open.c | 2 +- reactos/lib/crt/io/pipe.c | 2 +- reactos/lib/crt/io/read.c | 2 +- reactos/lib/crt/io/setmode.c | 2 +- reactos/lib/crt/io/unlink.c | 2 +- reactos/lib/crt/io/wcreate.c | 2 +- reactos/lib/crt/io/wmktemp.c | 2 +- reactos/lib/crt/io/wopen.c | 2 +- reactos/lib/crt/io/write.c | 2 +- reactos/lib/crt/io/wunlink.c | 2 +- reactos/lib/crt/locale/locale.c | 2 +- reactos/lib/crt/misc/crtmain.c | 2 +- reactos/lib/crt/misc/environ.c | 2 +- reactos/lib/crt/misc/lock.c | 2 +- reactos/lib/crt/misc/stubs.c | 2 +- reactos/lib/crt/process/process.c | 2 +- reactos/lib/crt/signal/signal.c | 2 +- reactos/lib/crt/stdio/fwrite.c | 2 +- reactos/lib/crt/stdio/popen.c | 2 +- reactos/lib/crt/stdio/remove.c | 2 +- reactos/lib/crt/stdlib/getenv.c | 2 +- reactos/lib/crt/stdlib/putenv.c | 2 +- reactos/lib/crt/stdlib/senv.c | 2 +- reactos/lib/crt/stdlib/wputenv.c | 2 +- reactos/lib/crt/wine/scanf.c | 3 +- 48 files changed, 204 insertions(+), 219 deletions(-) rename reactos/lib/crt/include/internal/{msvcrtdbg.h => debug.h} (100%) diff --git a/reactos/lib/crt/direct/chdir.c b/reactos/lib/crt/direct/chdir.c index a2d412a8e92..6951d15a151 100644 --- a/reactos/lib/crt/direct/chdir.c +++ b/reactos/lib/crt/direct/chdir.c @@ -2,14 +2,15 @@ #include #include #include +#include /* * @implemented */ -int _chdir(const char* _path) +int _tchdir(const _TCHAR* _path) { - if (!SetCurrentDirectoryA((char*)_path)) { - _dosmaperr(GetLastError()); + if (!SetCurrentDirectory(_path)) { + _dosmaperr(_path?GetLastError():0); return -1; } return 0; diff --git a/reactos/lib/crt/direct/chdrive.c b/reactos/lib/crt/direct/chdrive.c index b65f5218d3e..9f53d40e0f2 100644 --- a/reactos/lib/crt/direct/chdrive.c +++ b/reactos/lib/crt/direct/chdrive.c @@ -6,29 +6,36 @@ #include -int cur_drive = 0; - - /* - * @implemented + * @implemented + * + * _chdrive (MSVCRT.@) + * + * Change the current drive. + * + * PARAMS + * newdrive [I] Drive number to change to (1 = 'A', 2 = 'B', ...) + * + * RETURNS + * Success: 0. The current drive is set to newdrive. + * Failure: -1. errno indicates the error. + * + * NOTES + * See SetCurrentDirectoryA. */ -int _chdrive(int drive) +int _chdrive(int newdrive) { - char d[3]; + WCHAR buffer[] = L"A:"; - if (!( drive >= 1 && drive <= 26)) { - __set_errno(EINVAL); - return -1; - } - if (cur_drive != drive) { - cur_drive = drive; - d[0] = toupper(cur_drive + '@'); - d[1] = ':'; - d[2] = 0; - if (!SetCurrentDirectoryA(d)) { - _dosmaperr(GetLastError()); - return -1; - } + buffer[0] += newdrive - 1; + if (!SetCurrentDirectoryW( buffer )) + { + _dosmaperr(GetLastError()); + if (newdrive <= 0) + { + __set_errno(EACCES); } - return 0; + return -1; + } + return 0; } diff --git a/reactos/lib/crt/direct/getcwd.c b/reactos/lib/crt/direct/getcwd.c index 6d820e395a4..5ae385c7dd4 100644 --- a/reactos/lib/crt/direct/getcwd.c +++ b/reactos/lib/crt/direct/getcwd.c @@ -3,29 +3,33 @@ #include #include #include - +#include /* * @implemented */ -char *_getcwd(char* buffer, int maxlen) +_TCHAR* _tgetcwd(_TCHAR* buf, int size) { - char *cwd; - int len; + _TCHAR dir[MAX_PATH]; + DWORD dir_len = GetCurrentDirectory(MAX_PATH,dir); - if (buffer == NULL) { - if ( (cwd = malloc(MAX_PATH)) == NULL ) { - __set_errno(ENOMEM); - return NULL; - } - len = MAX_PATH; - } else { - cwd = buffer; - len = maxlen; - } - if (GetCurrentDirectoryA(len, cwd) == 0) { - _dosmaperr(GetLastError()); - return NULL; - } - return cwd; + if (dir_len == 0) + { + _dosmaperr(GetLastError()); + return NULL; /* FIXME: Real return value untested */ + } + + if (!buf) + { + return _tcsdup(dir); + } + + if (dir_len >= size) + { + __set_errno(ERANGE); + return NULL; /* buf too small */ + } + + _tcscpy(buf,dir); + return buf; } diff --git a/reactos/lib/crt/direct/getdcwd.c b/reactos/lib/crt/direct/getdcwd.c index cc6b5f6a467..301401aacc0 100644 --- a/reactos/lib/crt/direct/getdcwd.c +++ b/reactos/lib/crt/direct/getdcwd.c @@ -1,27 +1,64 @@ #include "precomp.h" #include #include +#include +#include +#include /* * @implemented + * + * _getdcwd (MSVCRT.@) + * + * Get the current working directory on a given disk. + * + * PARAMS + * drive [I] Drive letter to get the current working directory from. + * buf [O] Destination for the current working directory. + * size [I] Length of drive in characters. + * + * RETURNS + * Success: If drive is NULL, returns an allocated string containing the path. + * Otherwise populates drive with the path and returns it. + * Failure: NULL. errno indicates the error. */ -char* _getdcwd(int nDrive, char* caBuffer, int nBufLen) +_TCHAR* _tgetdcwd(int drive, _TCHAR * buf, int size) { - int i =0; - int dr = _getdrive(); + static _TCHAR* dummy; - if (nDrive < 1 || nDrive > 26) - return NULL; - if (dr != nDrive) { - if ( _chdrive(nDrive) != 0 ) - return NULL; - } - i = GetCurrentDirectoryA(nBufLen, caBuffer); - if (i == nBufLen) - return NULL; - if (dr != nDrive) { - if ( _chdrive(dr) != 0 ) - return NULL; - } - return caBuffer; + TRACE(":drive %d(%c), size %d\n",drive, drive + 'A' - 1, size); + + if (!drive || drive == _getdrive()) + return _tgetcwd(buf,size); /* current */ + else + { + _TCHAR dir[MAX_PATH]; + _TCHAR drivespec[] = _T("A:"); + int dir_len; + + drivespec[0] += drive - 1; + if (GetDriveType(drivespec) < DRIVE_REMOVABLE) + { + __set_errno(EACCES); + return NULL; + } + + /* GetFullPathName for X: means "get working directory on drive X", + * just like passing X: to SetCurrentDirectory means "switch to working + * directory on drive X". -Gunnar */ + dir_len = GetFullPathName(drivespec,MAX_PATH,dir,&dummy); + if (dir_len >= size || dir_len < 1) + { + __set_errno(ERANGE); + return NULL; /* buf too small */ + } + + TRACE(":returning '%s'\n", dir); + if (!buf) + return _tcsdup(dir); /* allocate */ + + _tcscpy(buf,dir); + } + return buf; } + diff --git a/reactos/lib/crt/direct/getdrive.c b/reactos/lib/crt/direct/getdrive.c index 006f9e4e95f..797c743dde5 100644 --- a/reactos/lib/crt/direct/getdrive.c +++ b/reactos/lib/crt/direct/getdrive.c @@ -3,28 +3,33 @@ #include -extern int cur_drive; +/* + * @implemented + * + * _getdrive (MSVCRT.@) + * + * Get the current drive number. + * + * PARAMS + * None. + * + * RETURNS + * Success: The drive letter number from 1 to 26 ("A:" to "Z:"). + * Failure: 0. + */ +int _getdrive(void) +{ + WCHAR buffer[MAX_PATH]; + if (GetCurrentDirectoryW( MAX_PATH, buffer ) && + buffer[0] >= 'A' && buffer[0] <= 'z' && buffer[1] == ':') + return towupper(buffer[0]) - 'A' + 1; + return 0; +} /* * @implemented */ -int _getdrive(void) -{ - char Buffer[MAX_PATH]; - - if (cur_drive == 0) { - GetCurrentDirectoryA(MAX_PATH, Buffer); - cur_drive = toupper(Buffer[0] - '@'); - } - return cur_drive; -} - -/* - * @unimplemented - */ unsigned long _getdrives(void) { - //fixme get logical drives - //return GetLogicalDrives(); - return 5; // drive A and C + return GetLogicalDrives(); } diff --git a/reactos/lib/crt/direct/mkdir.c b/reactos/lib/crt/direct/mkdir.c index 5aea15fac0b..7f8a3d74686 100644 --- a/reactos/lib/crt/direct/mkdir.c +++ b/reactos/lib/crt/direct/mkdir.c @@ -1,14 +1,14 @@ #include "precomp.h" #include #include - +#include /* * @implemented */ -int _mkdir(const char* _path) +int _tmkdir(const _TCHAR* _path) { - if (!CreateDirectoryA(_path, NULL)) { + if (!CreateDirectory(_path, NULL)) { _dosmaperr(GetLastError()); return -1; } diff --git a/reactos/lib/crt/direct/rmdir.c b/reactos/lib/crt/direct/rmdir.c index bdf84d74551..7a28056f986 100644 --- a/reactos/lib/crt/direct/rmdir.c +++ b/reactos/lib/crt/direct/rmdir.c @@ -1,14 +1,14 @@ #include "precomp.h" #include #include - +#include /* * @implemented */ -int _rmdir(const char* _path) +int _trmdir(const _TCHAR* _path) { - if (!RemoveDirectoryA(_path)) { + if (!RemoveDirectory(_path)) { _dosmaperr(GetLastError()); return -1; } diff --git a/reactos/lib/crt/direct/wchdir.c b/reactos/lib/crt/direct/wchdir.c index 3e49d1f851f..0271819c709 100644 --- a/reactos/lib/crt/direct/wchdir.c +++ b/reactos/lib/crt/direct/wchdir.c @@ -1,16 +1,5 @@ -#include "precomp.h" -#include -#include -#include +#define UNICODE +#define _UNICODE + +#include "chdir.c" -/* - * @implemented - */ -int _wchdir (const wchar_t *_path) -{ - if (!SetCurrentDirectoryW((wchar_t *)_path)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} diff --git a/reactos/lib/crt/direct/wgetcwd.c b/reactos/lib/crt/direct/wgetcwd.c index 07454dbf46e..2e946c3fbb5 100644 --- a/reactos/lib/crt/direct/wgetcwd.c +++ b/reactos/lib/crt/direct/wgetcwd.c @@ -1,28 +1,5 @@ -#include "precomp.h" -#include -#include -#include -#include +#define UNICODE +#define _UNICODE +#include "getcwd.c" -/* - * @implemented - */ -wchar_t* _wgetcwd(wchar_t* buffer, int maxlen) -{ - wchar_t *cwd; - int len; - if (buffer == NULL) { - if ( (cwd = malloc(MAX_PATH * sizeof(wchar_t))) == NULL ) { - __set_errno(ENOMEM); - return NULL; - } - len = MAX_PATH; - } else { - cwd = buffer; - len = maxlen; - } - if (GetCurrentDirectoryW(len, cwd) == 0) - return NULL; - return cwd; -} diff --git a/reactos/lib/crt/direct/wgetdcwd.c b/reactos/lib/crt/direct/wgetdcwd.c index ea8d5ed81d9..3c5e8e28e01 100644 --- a/reactos/lib/crt/direct/wgetdcwd.c +++ b/reactos/lib/crt/direct/wgetdcwd.c @@ -1,32 +1,5 @@ -#include "precomp.h" -#include -#include +#define UNICODE +#define _UNICODE +#include "getdcwd.c" -/* - * @implemented - */ -wchar_t* _wgetdcwd(int nDrive, wchar_t* caBuffer, int nBufLen) -{ - int i =0; - int dr = _getdrive(); - - if (nDrive < 1 || nDrive > 26) - return NULL; - - if (dr != nDrive) { - if ( _chdrive(nDrive) != 0 ) - return NULL; - } - - i = GetCurrentDirectoryW(nBufLen, caBuffer); - if (i == nBufLen) - return NULL; - - if (dr != nDrive) { - if ( _chdrive(dr) != 0 ) - return NULL; - } - - return caBuffer; -} diff --git a/reactos/lib/crt/direct/wmkdir.c b/reactos/lib/crt/direct/wmkdir.c index f6693626cc7..f9e11d1fe47 100644 --- a/reactos/lib/crt/direct/wmkdir.c +++ b/reactos/lib/crt/direct/wmkdir.c @@ -1,16 +1,4 @@ -#include "precomp.h" -#include -#include +#define UNICODE +#define _UNICODE - -/* - * @implemented - */ -int _wmkdir(const wchar_t* _path) -{ - if (!CreateDirectoryW(_path, NULL)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} +#include "mkdir.c" diff --git a/reactos/lib/crt/direct/wrmdir.c b/reactos/lib/crt/direct/wrmdir.c index 5033e7e75fb..b592e542605 100644 --- a/reactos/lib/crt/direct/wrmdir.c +++ b/reactos/lib/crt/direct/wrmdir.c @@ -1,16 +1,4 @@ -#include "precomp.h" -#include -#include +#define UNICODE +#define _UNICODE - -/* - * @implemented - */ -int _wrmdir(const wchar_t* _path) -{ - if (!RemoveDirectoryW(_path)) { - _dosmaperr(GetLastError()); - return -1; - } - return 0; -} +#include "rmdir.c" diff --git a/reactos/lib/crt/float/fpclass.c b/reactos/lib/crt/float/fpclass.c index e14a4d72418..42ae380a596 100644 --- a/reactos/lib/crt/float/fpclass.c +++ b/reactos/lib/crt/float/fpclass.c @@ -14,6 +14,9 @@ #define _FPCLASS_PN 0x0100 /* positive normal */ #define _FPCLASS_PINF 0x0200 /* positive infinity */ + +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3 + #define FP_SNAN 0x0001 // signaling NaN #define FP_QNAN 0x0002 // quiet NaN #define FP_NINF 0x0004 // negative infinity @@ -25,6 +28,8 @@ #define FP_NNORM 0x0080 // negative normalized non-zero #define FP_PNORM 0x0100 // positive normalized non-zero +#endif + typedef int fpclass_t; /* diff --git a/reactos/lib/crt/include/internal/msvcrtdbg.h b/reactos/lib/crt/include/internal/debug.h similarity index 100% rename from reactos/lib/crt/include/internal/msvcrtdbg.h rename to reactos/lib/crt/include/internal/debug.h diff --git a/reactos/lib/crt/include/internal/file.h b/reactos/lib/crt/include/internal/file.h index 4c781aa491a..040c47917e6 100644 --- a/reactos/lib/crt/include/internal/file.h +++ b/reactos/lib/crt/include/internal/file.h @@ -185,6 +185,10 @@ int _isinf(double x); wint_t _filwbuf(FILE *f); +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 2 + int __cdecl _filbuf (FILE*); + int __cdecl _flsbuf (int, FILE*); +#endif #endif /* __dj_include_libc_file_h__ */ diff --git a/reactos/lib/crt/io/access.c b/reactos/lib/crt/io/access.c index cbfc7ef3b91..228ef69a093 100644 --- a/reactos/lib/crt/io/access.c +++ b/reactos/lib/crt/io/access.c @@ -5,7 +5,7 @@ #include #define NDEBUG -#include +#include #ifdef _UNICODE #define _TS S diff --git a/reactos/lib/crt/io/chmod.c b/reactos/lib/crt/io/chmod.c index a9aa73aae5d..aadc153f3c6 100644 --- a/reactos/lib/crt/io/chmod.c +++ b/reactos/lib/crt/io/chmod.c @@ -6,7 +6,7 @@ #include #define NDEBUG -#include +#include #define mode_t int diff --git a/reactos/lib/crt/io/chsize.c b/reactos/lib/crt/io/chsize.c index 7826a48d3d1..e52588b0416 100644 --- a/reactos/lib/crt/io/chsize.c +++ b/reactos/lib/crt/io/chsize.c @@ -2,7 +2,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/io/close.c b/reactos/lib/crt/io/close.c index 862a7ea418c..767aafb4bf7 100644 --- a/reactos/lib/crt/io/close.c +++ b/reactos/lib/crt/io/close.c @@ -3,7 +3,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/io/create.c b/reactos/lib/crt/io/create.c index cb306855ea0..ccd93be9196 100644 --- a/reactos/lib/crt/io/create.c +++ b/reactos/lib/crt/io/create.c @@ -2,7 +2,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/find.c b/reactos/lib/crt/io/find.c index 73b4b4fd6f5..def2eb53fe9 100644 --- a/reactos/lib/crt/io/find.c +++ b/reactos/lib/crt/io/find.c @@ -8,7 +8,7 @@ /* * @implemented */ -#ifdef _UNICODE +#if defined(_UNICODE) || !(__MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3) long #else int @@ -60,7 +60,7 @@ _tfindfirst(const _TCHAR* _name, struct _tfinddata_t* result) * @implemented */ int _tfindnext( -#ifdef _UNICODE +#if defined(_UNICODE) || !(__MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3) long handle, #else int handle, @@ -176,7 +176,13 @@ int _tfindnexti64(long handle, struct _tfinddatai64_t *result) /* * @implemented */ -int _findclose(int handle) +int _findclose( +#if __MINGW32_MAJOR_VERSION < 3 || __MINGW32_MINOR_VERSION < 3 + int handle +#else + long handle +#endif + ) { // check no wildcards or invalid handle if (handle == 0 || handle == -1) diff --git a/reactos/lib/crt/io/isatty.c b/reactos/lib/crt/io/isatty.c index 9dae86c800c..d54ae83dfa5 100644 --- a/reactos/lib/crt/io/isatty.c +++ b/reactos/lib/crt/io/isatty.c @@ -2,7 +2,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/io/mktemp.c b/reactos/lib/crt/io/mktemp.c index e54d95fb331..1addbd6011c 100644 --- a/reactos/lib/crt/io/mktemp.c +++ b/reactos/lib/crt/io/mktemp.c @@ -18,7 +18,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/open.c b/reactos/lib/crt/io/open.c index 79bb40bd957..83b7532c7ab 100644 --- a/reactos/lib/crt/io/open.c +++ b/reactos/lib/crt/io/open.c @@ -52,7 +52,7 @@ #include #define NDEBUG -#include +#include diff --git a/reactos/lib/crt/io/pipe.c b/reactos/lib/crt/io/pipe.c index fec88f74bf2..2fe88e95a29 100644 --- a/reactos/lib/crt/io/pipe.c +++ b/reactos/lib/crt/io/pipe.c @@ -15,7 +15,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/read.c b/reactos/lib/crt/io/read.c index a89275bf08a..65c87bb308a 100644 --- a/reactos/lib/crt/io/read.c +++ b/reactos/lib/crt/io/read.c @@ -17,7 +17,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/io/setmode.c b/reactos/lib/crt/io/setmode.c index b774018e606..31e529499b8 100644 --- a/reactos/lib/crt/io/setmode.c +++ b/reactos/lib/crt/io/setmode.c @@ -14,6 +14,6 @@ #include #define NDEBUG -#include +#include diff --git a/reactos/lib/crt/io/unlink.c b/reactos/lib/crt/io/unlink.c index 947b27256c7..aa3b86bfe0a 100644 --- a/reactos/lib/crt/io/unlink.c +++ b/reactos/lib/crt/io/unlink.c @@ -13,7 +13,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/wcreate.c b/reactos/lib/crt/io/wcreate.c index 305d836c23d..e8d353b769b 100644 --- a/reactos/lib/crt/io/wcreate.c +++ b/reactos/lib/crt/io/wcreate.c @@ -2,7 +2,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/wmktemp.c b/reactos/lib/crt/io/wmktemp.c index 9978878861e..62d2185d4cb 100644 --- a/reactos/lib/crt/io/wmktemp.c +++ b/reactos/lib/crt/io/wmktemp.c @@ -18,7 +18,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/wopen.c b/reactos/lib/crt/io/wopen.c index c804539fd44..07f39828bab 100644 --- a/reactos/lib/crt/io/wopen.c +++ b/reactos/lib/crt/io/wopen.c @@ -26,7 +26,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/io/write.c b/reactos/lib/crt/io/write.c index 0387fbde214..e326399a3f8 100644 --- a/reactos/lib/crt/io/write.c +++ b/reactos/lib/crt/io/write.c @@ -16,7 +16,7 @@ #include #define NDEBUG -#include +#include #define BUFSIZE 4096 /* diff --git a/reactos/lib/crt/io/wunlink.c b/reactos/lib/crt/io/wunlink.c index 00420a5b9a2..f862b107bad 100644 --- a/reactos/lib/crt/io/wunlink.c +++ b/reactos/lib/crt/io/wunlink.c @@ -13,7 +13,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/locale/locale.c b/reactos/lib/crt/locale/locale.c index c3b21ddd6c0..ca1a02b7c00 100644 --- a/reactos/lib/crt/locale/locale.c +++ b/reactos/lib/crt/locale/locale.c @@ -13,7 +13,7 @@ #include #define NDEBUG -#include +#include unsigned int __setlc_active; unsigned int __unguarded_readlc_active; diff --git a/reactos/lib/crt/misc/crtmain.c b/reactos/lib/crt/misc/crtmain.c index 5387202824b..60bbfd3a9aa 100644 --- a/reactos/lib/crt/misc/crtmain.c +++ b/reactos/lib/crt/misc/crtmain.c @@ -6,7 +6,7 @@ #include "precomp.h" #define NDEBUG -#include +#include #ifndef __GNUC__ diff --git a/reactos/lib/crt/misc/environ.c b/reactos/lib/crt/misc/environ.c index d99b3695657..9db749c5dd4 100644 --- a/reactos/lib/crt/misc/environ.c +++ b/reactos/lib/crt/misc/environ.c @@ -12,7 +12,7 @@ #include #define NDEBUG -#include +#include unsigned int _osver = 0; diff --git a/reactos/lib/crt/misc/lock.c b/reactos/lib/crt/misc/lock.c index 775f9190486..417df9afb2d 100644 --- a/reactos/lib/crt/misc/lock.c +++ b/reactos/lib/crt/misc/lock.c @@ -19,7 +19,7 @@ #include "precomp.h" #define NDEBUG -#include +#include #include typedef struct diff --git a/reactos/lib/crt/misc/stubs.c b/reactos/lib/crt/misc/stubs.c index 2e7dc702780..21266f52d98 100644 --- a/reactos/lib/crt/misc/stubs.c +++ b/reactos/lib/crt/misc/stubs.c @@ -1,7 +1,7 @@ #include "precomp.h" #define NDEBUG -#include +#include /********************************************************************* * $I10_OUTPUT (MSVCRT.@) diff --git a/reactos/lib/crt/process/process.c b/reactos/lib/crt/process/process.c index 6c7f06efb1e..00ead394836 100644 --- a/reactos/lib/crt/process/process.c +++ b/reactos/lib/crt/process/process.c @@ -7,7 +7,7 @@ #include #define NDEBUG -#include +#include #ifdef _UNICODE #define find_execT find_execW diff --git a/reactos/lib/crt/signal/signal.c b/reactos/lib/crt/signal/signal.c index 3df1deee360..a893fce1669 100644 --- a/reactos/lib/crt/signal/signal.c +++ b/reactos/lib/crt/signal/signal.c @@ -89,7 +89,7 @@ __p_sig_fn_t signal(int sig, __p_sig_fn_t func) int raise(int sig) { - __p_sig_fn_t temp;// = SIG_DFL; + __p_sig_fn_t temp = 0; int i; switch (sig) diff --git a/reactos/lib/crt/stdio/fwrite.c b/reactos/lib/crt/stdio/fwrite.c index 4203526717d..399b63fdea4 100644 --- a/reactos/lib/crt/stdio/fwrite.c +++ b/reactos/lib/crt/stdio/fwrite.c @@ -6,7 +6,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/stdio/popen.c b/reactos/lib/crt/stdio/popen.c index 803104141ba..da1e6ccaeaf 100644 --- a/reactos/lib/crt/stdio/popen.c +++ b/reactos/lib/crt/stdio/popen.c @@ -8,7 +8,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/stdio/remove.c b/reactos/lib/crt/stdio/remove.c index 37909173cbc..265b975d778 100644 --- a/reactos/lib/crt/stdio/remove.c +++ b/reactos/lib/crt/stdio/remove.c @@ -4,7 +4,7 @@ #include #define NDEBUG -#include +#include /* * @implemented diff --git a/reactos/lib/crt/stdlib/getenv.c b/reactos/lib/crt/stdlib/getenv.c index 0a445b0dac2..9b8a2ce8a57 100644 --- a/reactos/lib/crt/stdlib/getenv.c +++ b/reactos/lib/crt/stdlib/getenv.c @@ -2,7 +2,7 @@ #include #define NDEBUG -#include +#include #undef environ diff --git a/reactos/lib/crt/stdlib/putenv.c b/reactos/lib/crt/stdlib/putenv.c index 7edf52d0591..e0e53b15d67 100644 --- a/reactos/lib/crt/stdlib/putenv.c +++ b/reactos/lib/crt/stdlib/putenv.c @@ -3,7 +3,7 @@ #include #define NDEBUG -#include +#include /* misc/environ.c */ int SetEnv(const wchar_t *option); diff --git a/reactos/lib/crt/stdlib/senv.c b/reactos/lib/crt/stdlib/senv.c index d63291c81dd..e2d96747d69 100644 --- a/reactos/lib/crt/stdlib/senv.c +++ b/reactos/lib/crt/stdlib/senv.c @@ -4,7 +4,7 @@ #include #define NDEBUG -#include +#include /* diff --git a/reactos/lib/crt/stdlib/wputenv.c b/reactos/lib/crt/stdlib/wputenv.c index c06d966a257..d9e709a6a0a 100644 --- a/reactos/lib/crt/stdlib/wputenv.c +++ b/reactos/lib/crt/stdlib/wputenv.c @@ -3,7 +3,7 @@ #include #define NDEBUG -#include +#include /* misc/environ.c */ int SetEnv(const wchar_t *option); diff --git a/reactos/lib/crt/wine/scanf.c b/reactos/lib/crt/wine/scanf.c index 33983384b65..f7d923251ee 100644 --- a/reactos/lib/crt/wine/scanf.c +++ b/reactos/lib/crt/wine/scanf.c @@ -42,12 +42,13 @@ #include #include #include +#include #include //#include #define NDEBUG -#include +#include /*