msvcmaker generates a bad testlist.c

Francois Gouget fgouget at codeweavers.com
Fri Jul 16 12:39:00 CDT 2004


 From time to time I would not be able to compile the tests anymore due 
to a compilation error in 'testlist.c'. I have finally realized that 
this happens after updating the MSVC test project files. This is because 
we have two scripts generating the testlist.c files and they were not in 
sync:
    tools/make_ctests
    tools/winapi/msvcmaker

The error is because the msvcmaker-generated file does not include 
'stdarg.h'. This compiles fine on Windows but not with Winelib. Sounds 
like a bug? Yes but the reason is that the Unix stdio.h does not include 
stdarg.h whereas the Windows one does. The fix would thus be to compile 
and link all tests with msvcrt. That seems a it extreme so I just 
modified msvcmaker to also include 'stdarg.h'.

We could also modify msvcmaker and/or make_ctests to share the 
testlist.c-generating code but that did not mesh well with msvcmaker's 
current framework so I'm leaving it for more advanturous minds.


Changelog:

  * tools/make_ctests
    tools/winapi/msvcmaker

    Francois Gouget <fgouget at codeweavers.com>
    Fix msvcmaker so the generated testlist.c files include stdarg.h.
    Add comments pointing out the relation between msvcmaker and 
make_ctests.

-- 
Francois Gouget
fgouget at codeweavers.com

-------------- next part --------------
Index: tools/make_ctests
===================================================================
RCS file: /var/cvs/wine/tools/make_ctests,v
retrieving revision 1.3
diff -u -r1.3 make_ctests
--- tools/make_ctests	5 Sep 2003 23:15:41 -0000	1.3
+++ tools/make_ctests	16 Jul 2004 15:08:40 -0000
@@ -20,9 +20,12 @@
 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
 #
 
+# ***** Keep in sync with tools/winapi/msvcmaker:_generate_testlist_c *****
+
 cat <<EOF
 /* Automatically generated file; DO NOT EDIT!! */
 
+/* stdarg.h is needed for Winelib */
 #include <stdarg.h>
 #include <stdio.h>
 #include <stdlib.h>
Index: tools/winapi/msvcmaker
===================================================================
RCS file: /var/cvs/wine/tools/winapi/msvcmaker,v
retrieving revision 1.23
diff -u -r1.23 msvcmaker
--- tools/winapi/msvcmaker	22 Mar 2004 21:29:53 -0000	1.23
+++ tools/winapi/msvcmaker	16 Jul 2004 15:08:27 -0000
@@ -1142,6 +1142,7 @@
     }
 }
 
+# ***** Keep in sync with tools/make_ctests *****
 sub _generate_testlist_c {
     local *OUT = shift;
 
@@ -1149,6 +1150,8 @@
 
     print OUT "/* Automatically generated file; DO NOT EDIT!! */\n";
     print OUT "\n";
+    print OUT "/* stdarg.h is needed for Winelib */\n";
+    print OUT "#include <stdarg.h>\n";
     print OUT "#include <stdio.h>\n";
     print OUT "#include <stdlib.h>\n";
     print OUT "#include \"windef.h\"\n";


More information about the wine-patches mailing list