]> pd.if.org Git - pdclib/blobdiff - functions/_PDCLIB/stdarg.c
PDCLib includes with quotes, not <>.
[pdclib] / functions / _PDCLIB / stdarg.c
index e187c76e8dda8360fb02c9cd7ecf5e61243623e8..9e43be6a10bebda6bcb65c4489f5cfd05899abf4 100644 (file)
@@ -1,5 +1,3 @@
-/* $Id$ */
-
 /* stdarg
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -9,8 +7,9 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <float.h>
+#ifdef TEST
 
-#include <_PDCLIB_test.h>
+#include "_PDCLIB_test.h"
 
 typedef int (*intfunc_t)( void );
 
@@ -27,6 +26,11 @@ enum tag_t
     TAG_FUNCPTR
 };
 
+static int dummy( void )
+{
+    return INT_MAX;
+}
+
 static int test( enum tag_t s, ... )
 {
     enum tag_t tag = s;
@@ -80,7 +84,9 @@ static int test( enum tag_t s, ... )
             }
             case TAG_FUNCPTR:
             {
-                TESTCASE( (va_arg( ap, intfunc_t ))() == INT_MAX );
+                intfunc_t function;
+                TESTCASE( ( function = va_arg( ap, intfunc_t ) ) == dummy );
+                TESTCASE( function() == INT_MAX );
                 tag = va_arg( ap, enum tag_t );
                 break;
             }
@@ -93,11 +99,6 @@ static int test( enum tag_t s, ... )
     }
 }
 
-static int dummy( void )
-{
-    return INT_MAX;
-}
-
 int main( void )
 {
     int x = INT_MAX;
@@ -109,3 +110,4 @@ int main( void )
     test( TAG_INTPTR, &x, TAG_LDBLPTR, &d, TAG_FUNCPTR, dummy, TAG_END );
     return TEST_RESULTS;
 }
+#endif