]> pd.if.org Git - pdclib/blobdiff - functions/_PDCLIB/stdarg.c
* Change the style of inclusion of the internal/ headers. Modern preprocessors
[pdclib] / functions / _PDCLIB / stdarg.c
index 4900cc58de8d607dd7f60af483af575f28677e9d..abb1f4c4f7478b8208b6074b1ca856c997ea381a 100644 (file)
@@ -1,7 +1,5 @@
 /* $Id$ */
 
-/* Release $Name$ */
-
 /* stdarg
 
    This file is part of the Public Domain C Library (PDCLib).
@@ -11,6 +9,7 @@
 #include <stdarg.h>
 #include <limits.h>
 #include <float.h>
+#ifdef TEST
 
 #include <_PDCLIB_test.h>
 
@@ -29,6 +28,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;
@@ -82,7 +86,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;
             }
@@ -95,11 +101,6 @@ static int test( enum tag_t s, ... )
     }
 }
 
-static int dummy( void )
-{
-    return INT_MAX;
-}
-
 int main( void )
 {
     int x = INT_MAX;
@@ -111,3 +112,4 @@ int main( void )
     test( TAG_INTPTR, &x, TAG_LDBLPTR, &d, TAG_FUNCPTR, dummy, TAG_END );
     return TEST_RESULTS;
 }
+#endif