[ros-diffs] [tkreuzer] 38136: fix overcomplicated and broken definitions of __iob_func and _iob

tkreuzer at svn.reactos.org tkreuzer at svn.reactos.org
Wed Dec 17 02:28:38 CET 2008


Author: tkreuzer
Date: Tue Dec 16 19:28:37 2008
New Revision: 38136

URL: http://svn.reactos.org/svn/reactos?rev=38136&view=rev
Log:
fix overcomplicated and broken definitions of __iob_func and _iob

Modified:
    branches/ros-amd64-bringup/reactos/include/crt/stdio.h
    branches/ros-amd64-bringup/reactos/include/crt/wchar.h

Modified: branches/ros-amd64-bringup/reactos/include/crt/stdio.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/crt/stdio.h?rev=38136&r1=38135&r2=38136&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/crt/stdio.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/crt/stdio.h [iso-8859-1] Tue Dec 16 19:28:37 2008
@@ -91,18 +91,8 @@
 #endif
 
 #ifndef _STDIO_DEFINED
-#ifdef _WIN64
   _CRTIMP FILE *__cdecl __iob_func(void);
-#else
-#ifdef _MSVCRT_
-extern FILE _iob[];	/* A pointer to an array of FILE */
-#define __iob_func()	(_iob)
-#else
-extern FILE (*_imp___iob)[];	/* A pointer to an array of FILE */
-#define __iob_func()	(*_imp___iob)
-#define _iob __iob_func()
-#endif
-#endif
+  _CRTIMP extern FILE _iob[];
 #endif
 
 #ifndef _FPOS_T_DEFINED
@@ -120,11 +110,16 @@
 #endif
 
 #ifndef _STDSTREAM_DEFINED
-#define _STDSTREAM_DEFINED
-
-#define stdin (&__iob_func()[0])
-#define stdout (&__iob_func()[1])
-#define stderr (&__iob_func()[2])
+ #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 _IOREAD 0x0001
@@ -403,7 +398,7 @@
 #endif
 
 #define _STDIO_DEFINED
-#endif
+#endif // !_STDIO_DEFINED
 
 #define _fgetc_nolock(_stream) (--(_stream)->_cnt >= 0 ? 0xff & *(_stream)->_ptr++ : _filbuf(_stream))
 #define _fputc_nolock(_c,_stream) (--(_stream)->_cnt >= 0 ? 0xff & (*(_stream)->_ptr++ = (char)(_c)) : _flsbuf((_c),(_stream)))

Modified: branches/ros-amd64-bringup/reactos/include/crt/wchar.h
URL: http://svn.reactos.org/svn/reactos/branches/ros-amd64-bringup/reactos/include/crt/wchar.h?rev=38136&r1=38135&r2=38136&view=diff
==============================================================================
--- branches/ros-amd64-bringup/reactos/include/crt/wchar.h [iso-8859-1] (original)
+++ branches/ros-amd64-bringup/reactos/include/crt/wchar.h [iso-8859-1] Tue Dec 16 19:28:37 2008
@@ -51,20 +51,8 @@
 #endif
 
 #ifndef _STDIO_DEFINED
-#ifdef _WIN64
   _CRTIMP FILE *__cdecl __iob_func(void);
-#else
-#ifdef _MSVCRT_
-extern FILE _iob[];	/* A pointer to an array of FILE */
-#define __iob_func()	(_iob)
-#else
-extern FILE (*_imp___iob)[];	/* A pointer to an array of FILE */
-#define __iob_func()	(*_imp___iob)
-#define _iob __iob_func()
-#endif
-#endif
-
-#define _iob __iob_func()
+  _CRTIMP extern FILE _iob[];
 #endif
 
 #ifndef _STDSTREAM_DEFINED



More information about the Ros-diffs mailing list