Author: sginsberg Date: Thu Aug 6 13:03:08 2009 New Revision: 42418
URL: http://svn.reactos.org/svn/reactos?rev=42418&view=rev Log: - crt: Use ANSI C types - math.h: Move nonstandard inline using nonstandard function into nonstandard group - crtdefs.h: Don't disable non-ANSI C definitions for MSVC only -- the behaviour should be the same for all compilers, so always disable them -- fixes various msvc build errors introduced by 42369.
Modified: trunk/reactos/include/crt/crtdefs.h trunk/reactos/include/crt/math.h trunk/reactos/lib/sdk/crt/process/process.c trunk/reactos/lib/sdk/crt/stdio/fmode.c trunk/reactos/lib/sdk/crt/stdlib/_exit.c trunk/reactos/lib/sdk/crt/time/ctime.c
Modified: trunk/reactos/include/crt/crtdefs.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/crtdefs.h?rev=4... ============================================================================== --- trunk/reactos/include/crt/crtdefs.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/crtdefs.h [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -19,10 +19,11 @@ #endif #endif
-/* Compatability definition */ -#if _MSC_VER > 0 && __STDC__ -#define NO_OLDNAMES -#endif +/* Disable non-ANSI C definitions if compiling with __STDC__ */ +//HACK: Disabled +//#if __STDC__ +//#define NO_OLDNAMES +//#endif
/** Properties ***************************************************************/
Modified: trunk/reactos/include/crt/math.h URL: http://svn.reactos.org/svn/reactos/trunk/reactos/include/crt/math.h?rev=4241... ============================================================================== --- trunk/reactos/include/crt/math.h [iso-8859-1] (original) +++ trunk/reactos/include/crt/math.h [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -225,6 +225,8 @@ #define HUGE _HUGE /* double __cdecl cabs(struct _complex _X); */ double __cdecl hypot(double _X,double _Y); + __CRT_INLINE float __cdecl hypotf (float x, float y) + { return (float) hypot (x, y);} _CRTIMP double __cdecl j0(double _X); _CRTIMP double __cdecl j1(double _X); _CRTIMP double __cdecl jn(int _X,double _Y); @@ -448,8 +450,6 @@ extern float __cdecl cbrtf (float); extern long double __cdecl cbrtl (long double);
- __CRT_INLINE float __cdecl hypotf (float x, float y) - { return (float) hypot (x, y);} extern long double __cdecl hypotl (long double, long double);
extern long double __cdecl powl (long double, long double);
Modified: trunk/reactos/lib/sdk/crt/process/process.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/process/process... ============================================================================== --- trunk/reactos/lib/sdk/crt/process/process.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/process/process.c [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -521,7 +521,7 @@
if (args) { - ret = do_spawnT(P_OVERLAY, cmdname, args, NULL); + ret = do_spawnT(_P_OVERLAY, cmdname, args, NULL); free(args); } return ret; @@ -533,7 +533,7 @@ intptr_t _texecv(const _TCHAR* cmdname, const _TCHAR* const* argv) { TRACE(MK_STR(_texecv)"('%"sT"')\n", cmdname); - return _tspawnv(P_OVERLAY, cmdname, argv); + return _tspawnv(_P_OVERLAY, cmdname, argv); }
/* @@ -560,7 +560,7 @@ envs = argvtosT(ptr, 0); if (args) { - ret = do_spawnT(P_OVERLAY, cmdname, args, envs); + ret = do_spawnT(_P_OVERLAY, cmdname, args, envs); free(args); } if (envs) @@ -576,7 +576,7 @@ intptr_t _texecve(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { TRACE(MK_STR(_texecve)"('%"sT"')\n", cmdname); - return _tspawnve(P_OVERLAY, cmdname, argv, envp); + return _tspawnve(_P_OVERLAY, cmdname, argv, envp); }
/* @@ -596,7 +596,7 @@
if (args) { - ret = do_spawnT(P_OVERLAY, find_execT(cmdname, pathname), args, NULL); + ret = do_spawnT(_P_OVERLAY, find_execT(cmdname, pathname), args, NULL); free(args); } return ret; @@ -608,7 +608,7 @@ intptr_t _texecvp(const _TCHAR* cmdname, const _TCHAR* const* argv) { TRACE(MK_STR(_texecvp)"('%"sT"')\n", cmdname); - return _tspawnvp(P_OVERLAY, cmdname, argv); + return _tspawnvp(_P_OVERLAY, cmdname, argv); }
/* @@ -636,7 +636,7 @@ envs = argvtosT(ptr, 0); if (args) { - ret = do_spawnT(P_OVERLAY, find_execT(cmdname, pathname), args, envs); + ret = do_spawnT(_P_OVERLAY, find_execT(cmdname, pathname), args, envs); free(args); } if (envs) @@ -652,7 +652,7 @@ intptr_t _texecvpe(const _TCHAR* cmdname, const _TCHAR* const* argv, const _TCHAR* const* envp) { TRACE(MK_STR(_texecvpe)"('%"sT"')\n", cmdname); - return _tspawnvpe(P_OVERLAY, cmdname, argv, envp); -} - - + return _tspawnvpe(_P_OVERLAY, cmdname, argv, envp); +} + +
Modified: trunk/reactos/lib/sdk/crt/stdio/fmode.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdio/fmode.c?r... ============================================================================== --- trunk/reactos/lib/sdk/crt/stdio/fmode.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdio/fmode.c [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -1,7 +1,7 @@ /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */ #include <precomp.h>
-int _fmode = O_TEXT; +int _fmode = _O_TEXT;
/* * @implemented
Modified: trunk/reactos/lib/sdk/crt/stdlib/_exit.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/stdlib/_exit.c?... ============================================================================== --- trunk/reactos/lib/sdk/crt/stdlib/_exit.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/stdlib/_exit.c [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -19,7 +19,7 @@ djgpp_first_dtor[i](); */ /* in case the program set it this way */ - _setmode(0, O_TEXT); + _setmode(0, _O_TEXT); _atexit_cleanup(); _exit(status); for(;;);
Modified: trunk/reactos/lib/sdk/crt/time/ctime.c URL: http://svn.reactos.org/svn/reactos/trunk/reactos/lib/sdk/crt/time/ctime.c?re... ============================================================================== --- trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] (original) +++ trunk/reactos/lib/sdk/crt/time/ctime.c [iso-8859-1] Thu Aug 6 13:03:08 2009 @@ -53,8 +53,8 @@ #define fread_size_t size_t #define fwrite_size_t size_t
-#define ACCESS_MODE O_RDONLY|O_BINARY -#define OPEN_MODE O_RDONLY|O_BINARY +#define ACCESS_MODE _O_RDONLY|_O_BINARY +#define OPEN_MODE _O_RDONLY|_O_BINARY
/* ** Someone might make incorrect use of a time zone abbreviation: