X-Git-Url: https://pd.if.org/git/?p=pdclib;a=blobdiff_plain;f=functions%2F_PDCLIB%2Fstdarg.c;h=9e43be6a10bebda6bcb65c4489f5cfd05899abf4;hp=4900cc58de8d607dd7f60af483af575f28677e9d;hb=da0f3f353d417fed71f358a48d5d5394145e460d;hpb=d02f38605b53cdff5460cc6b9e1b2a80c3a2ba4c diff --git a/functions/_PDCLIB/stdarg.c b/functions/_PDCLIB/stdarg.c index 4900cc5..9e43be6 100644 --- a/functions/_PDCLIB/stdarg.c +++ b/functions/_PDCLIB/stdarg.c @@ -1,7 +1,3 @@ -/* $Id$ */ - -/* Release $Name$ */ - /* stdarg This file is part of the Public Domain C Library (PDCLib). @@ -11,8 +7,9 @@ #include #include #include +#ifdef TEST -#include <_PDCLIB_test.h> +#include "_PDCLIB_test.h" typedef int (*intfunc_t)( void ); @@ -29,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; @@ -82,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; } @@ -95,11 +99,6 @@ static int test( enum tag_t s, ... ) } } -static int dummy( void ) -{ - return INT_MAX; -} - int main( void ) { int x = INT_MAX; @@ -111,3 +110,4 @@ int main( void ) test( TAG_INTPTR, &x, TAG_LDBLPTR, &d, TAG_FUNCPTR, dummy, TAG_END ); return TEST_RESULTS; } +#endif