Fix the headers.c MSVCRT test

Francois Gouget fgouget at free.fr
Wed Aug 11 11:12:22 CDT 2004


Obviously on Windows the msvcrt.h header does not exist so this test
prevents the compilation of all the msvcrt tests on Windows.
The solution is to simply 'skip' this test when compiling with the
Windows headers.

Changelog:

 * dlls/msvcrt/tests/headers.c
   tools/winapi/msvcmaker

   Don't define __WINE_USE_MSVCRT in the Visual C++ project. It is not
needed as it is defined by the Wine headers.
   Use __WINE_USE_MSVCRT to detect whether we are being compiled with
the Wine MSVCRT headers or the Windows ones. In the latter case:
   - don't try to include the Wine-specific msvcrt headers
   - skip all the headers.c tests since there's no MSVCRT_* symbols to
     check


Index: dlls/msvcrt/tests/headers.c
===================================================================
RCS file: /var/cvs/wine/dlls/msvcrt/tests/headers.c,v
retrieving revision 1.3
diff -u -r1.3 headers.c
--- dlls/msvcrt/tests/headers.c	12 Jul 2004 23:48:58 -0000	1.3
+++ dlls/msvcrt/tests/headers.c	11 Aug 2004 15:36:42 -0000
@@ -15,19 +15,16 @@
  * License along with this library; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
  *
- * This file contains tests to ensure consystencies between symbols
- * defined in the msvcrt headers, and corresponding duplciated
+ * This file contains tests to ensure the consistency between symbols
+ * defined in the regular msvcrt headers, and the corresponding duplicated
  * symbol defined in msvcrt.h (prefixed by MSVCRT_).
  */

-#define __WINE_MSVCRT_TEST
 #include "dos.h"
 #include "math.h"
 #include "stdlib.h"
-#include "eh.h"
 #include "io.h"
 #include "errno.h"
-#include "unistd.h"
 #include "fcntl.h"
 #include "malloc.h"
 #include "limits.h"
@@ -42,7 +39,6 @@
 #include "float.h"
 #include "stddef.h"
 #include "mbstring.h"
-#include "sys/unistd.h"
 #include "sys/locking.h"
 #include "sys/utime.h"
 #include "sys/types.h"
@@ -50,15 +46,22 @@
 #include "sys/timeb.h"
 #include "direct.h"
 #include "conio.h"
-#include "dirent.h"
 #include "process.h"
 #include "string.h"
 #include "time.h"
 #include "locale.h"
 #include "setjmp.h"
-#include "msvcrt.h"
 #include "wine/test.h"

+#ifdef __WINE_USE_MSVCRT
+/* Wine-specific msvcrt headers */
+#define __WINE_MSVCRT_TEST
+#include "eh.h"
+#include "unistd.h"
+#include "sys/unistd.h"
+#include "dirent.h"
+#include "msvcrt.h"
+
 #ifdef __GNUC__
 #define TYPEOF(type) typeof(type)
 #else
@@ -453,9 +456,13 @@
 #endif
 }

+#endif /* __WINE_USE_MSVCRT */
+
 START_TEST(headers)
 {
+#ifdef __WINE_USE_MSVCRT
     test_types();
     test_structs();
     test_defines();
+#endif
 }
Index: tools/winapi/msvcmaker
===================================================================
RCS file: /var/cvs/wine/tools/winapi/msvcmaker,v
retrieving revision 1.24
diff -u -r1.24 msvcmaker
--- tools/winapi/msvcmaker	16 Jul 2004 19:14:43 -0000	1.24
+++ tools/winapi/msvcmaker	10 Aug 2004 16:31:43 -0000
@@ -673,7 +673,6 @@
 	if($wine) {
 	    push @defines2, "_\U${project}\E_";
 	    push @defines2, qw(__WINESRC__) if $project !~ /^(?:wine(?:build|test)|.*?_test)$/;
-	    push @defines2, qw(__WINE_USE_MSVCRT);
 	    if ($msvc_headers) {
 	    	push @defines2, qw(__WINE_USE_NATIVE_HEADERS);
 	    }



-- 
Francois Gouget         fgouget at free.fr        http://fgouget.free.fr/
  Good judgment comes from experience, and experience comes from bad judgment
                               -- Barry LePatner



More information about the wine-patches mailing list