X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=functions%2F_PDCLIB%2Fstdarg.c;h=7ad1087457da409bd2a9f487839131943c3dabe8;hb=1b1c0ce961e039ee602d179b9257abeabae65010;hp=4900cc58de8d607dd7f60af483af575f28677e9d;hpb=d02f38605b53cdff5460cc6b9e1b2a80c3a2ba4c;p=pdclib diff --git a/functions/_PDCLIB/stdarg.c b/functions/_PDCLIB/stdarg.c old mode 100644 new mode 100755 index 4900cc5..7ad1087 --- 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). @@ -12,7 +8,9 @@ #include #include -#include <_PDCLIB_test.h> +#ifdef TEST + +#include "_PDCLIB_test.h" typedef int (*intfunc_t)( void ); @@ -29,6 +27,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 +85,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 +100,6 @@ static int test( enum tag_t s, ... ) } } -static int dummy( void ) -{ - return INT_MAX; -} - int main( void ) { int x = INT_MAX; @@ -111,3 +111,5 @@ int main( void ) test( TAG_INTPTR, &x, TAG_LDBLPTR, &d, TAG_FUNCPTR, dummy, TAG_END ); return TEST_RESULTS; } + +#endif