diff options
-rw-r--r-- | fixincludes/ChangeLog | 7 | ||||
-rw-r--r-- | fixincludes/fixincl.x | 68 | ||||
-rw-r--r-- | fixincludes/inclhack.def | 42 |
3 files changed, 111 insertions, 6 deletions
diff --git a/fixincludes/ChangeLog b/fixincludes/ChangeLog index fbda61e..5a6ab70 100644 --- a/fixincludes/ChangeLog +++ b/fixincludes/ChangeLog @@ -1,3 +1,10 @@ +2004-11-01 Mike Stump <mrs@apple.com> + + * inclhack.def (stdio_va_list): Break out clients from here... + (stdio_va_list_clients): ...to here. Also, don't fix if stdarg.h is + included or ifdef va_start. + * fixincl.x: Regenerate. + 2004-10-28 Mike Stump <mrs@apple.com> * inclhack.def (void_null): Avoid changing NULL on C++ friendly diff --git a/fixincludes/fixincl.x b/fixincludes/fixincl.x index eff3376..9e6c386 100644 --- a/fixincludes/fixincl.x +++ b/fixincludes/fixincl.x @@ -2,11 +2,11 @@ * * DO NOT EDIT THIS FILE (fixincl.x) * - * It has been AutoGen-ed Friday October 29, 2004 at 02:14:23 PM PDT + * It has been AutoGen-ed Friday October 29, 2004 at 02:26:49 PM PDT * From the definitions inclhack.def * and the template file fixincl */ -/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Oct 29 14:14:23 PDT 2004 +/* DO NOT CVS-MERGE THIS FILE, EITHER Fri Oct 29 14:26:49 PDT 2004 * * You must regenerate it. Use the ./genfixes script. * @@ -15,7 +15,7 @@ * certain ANSI-incompatible system header files which are fixed to work * correctly with ANSI C and placed in a directory that GNU C will search. * - * This file contains 180 fixup descriptions. + * This file contains 181 fixup descriptions. * * See README for more information. * @@ -4916,7 +4916,7 @@ tSCC zStdio_Va_ListName[] = * File name selection pattern */ tSCC zStdio_Va_ListList[] = - "|stdio.h|internal/stdio_core.h|internal/wchar_core.h|com_err.h|cps.h|curses.h|krb5.h|lc_core.h|pfmt.h|wchar.h|curses_colr/curses.h|"; + "|stdio.h|internal/stdio_core.h|internal/wchar_core.h|"; /* * Machine/OS name selection pattern */ @@ -4954,6 +4954,56 @@ s@_Va_LIST@_VA_LIST@", /* * * * * * * * * * * * * * * * * * * * * * * * * * * + * Description of Stdio_Va_List_Clients fix + */ +tSCC zStdio_Va_List_ClientsName[] = + "stdio_va_list_clients"; + +/* + * File name selection pattern + */ +tSCC zStdio_Va_List_ClientsList[] = + "|com_err.h|cps.h|curses.h|krb5.h|lc_core.h|pfmt.h|wchar.h|curses_colr/curses.h|"; +/* + * Machine/OS name selection pattern + */ +#define apzStdio_Va_List_ClientsMachs (const char**)NULL + +/* + * content bypass pattern - skip fix if pattern found + */ +tSCC zStdio_Va_List_ClientsBypass0[] = + "__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list"; +tSCC zStdio_Va_List_ClientsBypass1[] = + "include <stdarg\\.h>|#ifdef va_start"; + +#define STDIO_VA_LIST_CLIENTS_TEST_CT 2 +static tTestDesc aStdio_Va_List_ClientsTests[] = { + { TT_NEGREP, zStdio_Va_List_ClientsBypass0, (regex_t*)NULL }, + { TT_NEGREP, zStdio_Va_List_ClientsBypass1, (regex_t*)NULL }, }; + +/* + * Fix Command Arguments for Stdio_Va_List_Clients + */ +static const char* apzStdio_Va_List_ClientsPatch[] = { "sed", + "-e", "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n\ +s@(va_list)&@(__gnuc_va_list)\\&@\n\ +s@ _VA_LIST_));@ __gnuc_va_list));@\n\ +s@ __VA_LIST__));@ __gnuc_va_list));@\n\ +s@ va_list@ __not_va_list__@\n\ +s@\\*va_list@*__not_va_list__@\n\ +s@ __va_list)@ __gnuc_va_list)@\n\ +s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;@typedef \\1 __not_va_list__;@\n\ +s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n\ +s@GNUC_VA_LIST@GNUC_Va_LIST@\n\ +s@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n\ +s@_NEED___VA_LIST@_NEED___Va_LIST@\n\ +s@VA_LIST@DUMMY_VA_LIST@\n\ +s@_Va_LIST@_VA_LIST@", + (char*)NULL }; + +/* * * * * * * * * * * * * * * * * * * * * * * * * * + * * Description of Strict_Ansi_Not fix */ tSCC zStrict_Ansi_NotName[] = @@ -7146,9 +7196,9 @@ static const char* apzX11_SprintfPatch[] = { * * List of all fixes */ -#define REGEX_COUNT 204 +#define REGEX_COUNT 206 #define MACH_LIST_SIZE_LIMIT 261 -#define FIX_COUNT 180 +#define FIX_COUNT 181 /* * Enumerate the fixes @@ -7277,6 +7327,7 @@ typedef enum { STATSSWTCH_FIXIDX, STDIO_STDARG_H_FIXIDX, STDIO_VA_LIST_FIXIDX, + STDIO_VA_LIST_CLIENTS_FIXIDX, STRICT_ANSI_NOT_FIXIDX, STRICT_ANSI_NOT_CTD_FIXIDX, STRICT_ANSI_ONLY_FIXIDX, @@ -7952,6 +8003,11 @@ tFixDesc fixDescList[ FIX_COUNT ] = { STDIO_VA_LIST_TEST_CT, FD_MACH_ONLY, aStdio_Va_ListTests, apzStdio_Va_ListPatch, 0 }, + { zStdio_Va_List_ClientsName, zStdio_Va_List_ClientsList, + apzStdio_Va_List_ClientsMachs, + STDIO_VA_LIST_CLIENTS_TEST_CT, FD_MACH_ONLY, + aStdio_Va_List_ClientsTests, apzStdio_Va_List_ClientsPatch, 0 }, + { zStrict_Ansi_NotName, zStrict_Ansi_NotList, apzStrict_Ansi_NotMachs, STRICT_ANSI_NOT_TEST_CT, FD_MACH_ONLY | FD_SUBROUTINE, diff --git a/fixincludes/inclhack.def b/fixincludes/inclhack.def index 1e09014..568600c 100644 --- a/fixincludes/inclhack.def +++ b/fixincludes/inclhack.def @@ -2706,6 +2706,45 @@ fix = { files = stdio.h; files = internal/stdio_core.h; files = internal/wchar_core.h; + bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list'; + + /* + * Use __gnuc_va_list in arg types in place of va_list. + * On 386BSD use __gnuc_va_list instead of _VA_LIST_. On Tru64 UNIX V5.1A + * use __gnuc_va_list instead of __VA_LIST__. We're hoping the + * trailing parentheses and semicolon save all other systems from this. + * Define __not_va_list__ (something harmless and unused) + * instead of va_list. + * Don't claim to have defined va_list. + */ + sed = "s@[ \t]va_list\\([ \t)]\\)@ __gnuc_va_list\\1@\n" + "s@(va_list)&@(__gnuc_va_list)\\&@\n" + "s@ _VA_LIST_));@ __gnuc_va_list));@\n" + "s@ __VA_LIST__));@ __gnuc_va_list));@\n" + "s@ va_list@ __not_va_list__@\n" + "s@\\*va_list@*__not_va_list__@\n" + "s@ __va_list)@ __gnuc_va_list)@\n" + "s@typedef[ \t]\\(.*\\)[ \t]va_list[ \t]*;" + "@typedef \\1 __not_va_list__;@\n" + "s@typedef[ \t]*__va_list__@typedef __gnuc_va_list@\n" + "s@GNUC_VA_LIST@GNUC_Va_LIST@\n" + "s@_VA_LIST_DEFINED@_Va_LIST_DEFINED@\n" + "s@_NEED___VA_LIST@_NEED___Va_LIST@\n" + "s@VA_LIST@DUMMY_VA_LIST@\n" + "s@_Va_LIST@_VA_LIST@"; + test_text = "extern void mumble( va_list);"; +}; + + +/* + * Fix headers that use va_list from stdio.h to use the updated + * va_list from the stdio_va_list change. Note _BSD_VA_LIST_ is + * dealt with elsewhere. The presence of __gnuc_va_list, + * __DJ_va_list, or _G_va_list is taken to indicate that the header + * knows what it's doing. + */ +fix = { + hackname = stdio_va_list_clients; files = com_err.h; files = cps.h; files = curses.h; @@ -2715,6 +2754,9 @@ fix = { files = wchar.h; files = curses_colr/curses.h; bypass = '__gnuc_va_list|_BSD_VA_LIST_|__DJ_va_list|_G_va_list'; + /* Don't fix, if we use va_list from stdarg.h, or if the use is + otherwise protected. */ + bypass = 'include <stdarg\.h>|#ifdef va_start'; /* * Use __gnuc_va_list in arg types in place of va_list. |