From: Erwin Janssen Date: Sun, 18 Dec 2016 15:15:49 +0000 (+0100) Subject: Remove va_* and ast_va_* defines from ast_common.h X-Git-Tag: 2.40.1~2^2~1^2^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=82eef142247695c10db27d517c2a92f5ab3572fc;p=graphviz Remove va_* and ast_va_* defines from ast_common.h These defines are never used, just like the varargs.h include that was removed earlier. They can therefore be safely removed as well. --- diff --git a/ast_common.h.in b/ast_common.h.in index eb5d18b71..2a82271f6 100644 --- a/ast_common.h.in +++ b/ast_common.h.in @@ -45,19 +45,4 @@ typedef int ssize_t; #endif -#ifndef va_listref -#define va_listref(p) (p) /* pass va_list to varargs function */ -#define va_listval(p) (p) /* retrieve va_list from va_arg(ap,va_listarg) */ -#define va_listarg va_list /* va_arg() va_list type */ -#ifndef va_copy -#define va_copy(to,fr) ((to)=(fr)) /* copy va_list fr -> to */ -#endif -#undef _ast_va_list -#ifdef va_start -#define _ast_va_list va_list -#else -#define _ast_va_list void* /* va_list that avoids #include */ -#endif -#endif - #endif /*AST_COMMON_H */ diff --git a/features/common b/features/common index a2d8c38bb..43b59e1d8 100644 --- a/features/common +++ b/features/common @@ -93,86 +93,3 @@ cat{ typedef int ssize_t; #endif }end - -tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ - #define printf ______printf - #ifdef __STDC__ - #include - #else - #include - #endif - #undef printf - _BEGIN_EXTERNS_ - extern int printf(const char*, ...); - _END_EXTERNS_ - static va_list ap; - main() - { - #if TRY == 4 - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (&(p))\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (*(p))\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - printf("#define va_listarg va_list*\t"); - printf("/* va_arg() va_list type */\n"); - #else - #if TRY == 1 - *ap++; - #endif /*TRY == 1*/ - #if TRY == 2 - *ap; - #endif /*TRY == 2*/ - #if TRY == 3 - ap++; - #endif /*TRY == 3*/ - - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (p)\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (p)\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - #if TRY == 2 - printf("#define va_listarg va_list*\t"); - #else - printf("#define va_listarg va_list\t"); - #endif /*TRY == 2*/ - printf("/* va_arg() va_list type */\n"); - #endif /*TRY == 4*/ - - #if defined(_WIN32) || !defined(va_copy) - printf("#ifndef va_copy\n"); - #if TRY == 2 - printf("#define va_copy(to,fr) memcpy(to,fr,sizeof(va_list))\t"); - printf("/* copy va_list fr -> to */\n"); - #else - printf("#define va_copy(to,fr) ((to)=(fr))\t"); - printf("/* copy va_list fr -> to */\n"); - #endif - printf("#endif\n"); - #endif - - printf("#undef _ast_va_list\n"); - printf("#ifdef va_start\n"); - printf("#define _ast_va_list va_list\n"); - printf("#else\n"); - #if TRY == 1 || TRY == 2 - printf("#define _ast_va_list void*\t"); - #else - #if TRY == 3 - if (sizeof(va_list) == sizeof(long)) - printf("#define _ast_va_list long\t"); - else if (sizeof(va_list) == sizeof(short)) - printf("#define _ast_va_list short\t"); - else - printf("#define _ast_va_list int\t"); - #else - printf("#define _ast_va_list ...\t"); - #endif - #endif - printf("/* va_list that avoids #include */\n"); - printf("#endif\n\n"); - printf("#endif\n"); - return 0; - } -}end diff --git a/lib/sfio/features/common b/lib/sfio/features/common index 1d17ddb9d..f67523420 100644 --- a/lib/sfio/features/common +++ b/lib/sfio/features/common @@ -93,84 +93,3 @@ cat{ typedef int ssize_t; #endif }end - -tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ - #define printf ______printf - #ifdef __STDC__ - #include - #else - #include - #endif - #undef printf - _BEGIN_EXTERNS_ - extern int printf(const char*, ...); - _END_EXTERNS_ - static va_list ap; - main() - { - #if TRY == 4 - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (&(p))\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (*(p))\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - printf("#define va_listarg va_list*\t"); - printf("/* va_arg() va_list type */\n"); - #else - #if TRY == 1 - *ap++; - #endif /*TRY == 1*/ - #if TRY == 2 - *ap; - #endif /*TRY == 2*/ - #if TRY == 3 - ap++; - #endif /*TRY == 3*/ - - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (p)\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (p)\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - #if TRY == 2 - printf("#define va_listarg va_list*\t"); - #else - printf("#define va_listarg va_list\t"); - #endif /*TRY == 2*/ - printf("/* va_arg() va_list type */\n"); - #endif /*TRY == 4*/ - - #if defined(_WIN32) || !defined(va_copy) - #if TRY == 2 - printf("#define va_copy(to,fr) memcpy(to,fr,sizeof(va_list))\t"); - printf("/* copy va_list fr -> to */\n"); - #else - printf("#define va_copy(to,fr) ((to)=(fr))\t"); - printf("/* copy va_list fr -> to */\n"); - #endif - #endif - - printf("#undef _ast_va_list\n"); - printf("#ifdef va_start\n"); - printf("#define _ast_va_list va_list\n"); - printf("#else\n"); - #if TRY == 1 || TRY == 2 - printf("#define _ast_va_list void*\t"); - #else - #if TRY == 3 - if (sizeof(va_list) == sizeof(long)) - printf("#define _ast_va_list long\t"); - else if (sizeof(va_list) == sizeof(short)) - printf("#define _ast_va_list short\t"); - else - printf("#define _ast_va_list int\t"); - #else - printf("#define _ast_va_list ...\t"); - #endif - #endif - printf("/* va_list that avoids #include */\n"); - printf("#endif\n\n"); - printf("#endif\n"); - return 0; - } -}end diff --git a/lib/vmalloc/features/common b/lib/vmalloc/features/common index 1d17ddb9d..f67523420 100644 --- a/lib/vmalloc/features/common +++ b/lib/vmalloc/features/common @@ -93,84 +93,3 @@ cat{ typedef int ssize_t; #endif }end - -tst - -DTRY=1 - -DTRY=1 -Dvoid=char - -DTRY=2 - -DTRY=3 - -DTRY=4 output{ - #define printf ______printf - #ifdef __STDC__ - #include - #else - #include - #endif - #undef printf - _BEGIN_EXTERNS_ - extern int printf(const char*, ...); - _END_EXTERNS_ - static va_list ap; - main() - { - #if TRY == 4 - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (&(p))\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (*(p))\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - printf("#define va_listarg va_list*\t"); - printf("/* va_arg() va_list type */\n"); - #else - #if TRY == 1 - *ap++; - #endif /*TRY == 1*/ - #if TRY == 2 - *ap; - #endif /*TRY == 2*/ - #if TRY == 3 - ap++; - #endif /*TRY == 3*/ - - printf("\n#ifndef va_listref\n"); - printf("#define va_listref(p) (p)\t"); - printf("/* pass va_list to varargs function */\n"); - printf("#define va_listval(p) (p)\t"); - printf("/* retrieve va_list from va_arg(ap,va_listarg) */\n"); - #if TRY == 2 - printf("#define va_listarg va_list*\t"); - #else - printf("#define va_listarg va_list\t"); - #endif /*TRY == 2*/ - printf("/* va_arg() va_list type */\n"); - #endif /*TRY == 4*/ - - #if defined(_WIN32) || !defined(va_copy) - #if TRY == 2 - printf("#define va_copy(to,fr) memcpy(to,fr,sizeof(va_list))\t"); - printf("/* copy va_list fr -> to */\n"); - #else - printf("#define va_copy(to,fr) ((to)=(fr))\t"); - printf("/* copy va_list fr -> to */\n"); - #endif - #endif - - printf("#undef _ast_va_list\n"); - printf("#ifdef va_start\n"); - printf("#define _ast_va_list va_list\n"); - printf("#else\n"); - #if TRY == 1 || TRY == 2 - printf("#define _ast_va_list void*\t"); - #else - #if TRY == 3 - if (sizeof(va_list) == sizeof(long)) - printf("#define _ast_va_list long\t"); - else if (sizeof(va_list) == sizeof(short)) - printf("#define _ast_va_list short\t"); - else - printf("#define _ast_va_list int\t"); - #else - printf("#define _ast_va_list ...\t"); - #endif - #endif - printf("/* va_list that avoids #include */\n"); - printf("#endif\n\n"); - printf("#endif\n"); - return 0; - } -}end diff --git a/windows/include/ast_common.h b/windows/include/ast_common.h index abf8304d4..a24abcdfd 100644 --- a/windows/include/ast_common.h +++ b/windows/include/ast_common.h @@ -47,19 +47,5 @@ typedef int ssize_t; #endif -#ifndef va_listref -#define va_listref(p) (p) /* pass va_list to varargs function */ -#define va_listval(p) (p) /* retrieve va_list from va_arg(ap,va_listarg) */ -#define va_listarg va_list /* va_arg() va_list type */ -#ifndef va_copy -#define va_copy(to,fr) ((to)=(fr)) /* copy va_list fr -> to */ -#endif -#undef _ast_va_list -#ifdef va_start -#define _ast_va_list va_list -#else -#define _ast_va_list void* /* va_list that avoids #include */ -#endif - #endif #endif