From 8eaaffdeedf5a34a68a785e62b181e4e5fc6cf43 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Mon, 6 Jul 1998 17:09:00 +0000 Subject: Update. 1998-07-06 14:36 Andreas Schwab * posix/Makefile (generated): Remove $(objpfx) from the names. 1998-07-05 Andreas Jaeger * stdio-common/test_rdwr.c: Use %Zu for size_t in printf format string. * libio/iofread_u.c: Include for prototype. * libio/iofwrite_u.c: Likewise. 1998-07-06 Andreas Jaeger * db2/Versions: New file. 1998-07-04 Andreas Schwab * Makefile (lib-noranlib): Don't depend on sysd-versions. ($(common-objpfx)sysd-versions): Remove rule. * Makerules ($(common-objpfx)sysd-versions): Define here instead. Pass name of Versions.def file to script and redirect output to target. Include it and make all generated version maps depend on it. * versions.awk: Print out variable definition containing all generated version maps. Print error messages to stderr. Remove temp file. 1998-07-04 Andreas Schwab * posix/annexc.c (check_header): Terminate macro name before comparing. (get_null_defines): Allow builtin macros with parameters. (fmt, testfmt): Add -D_LIBC. * posix/Makefile: Remove bogus duplicate include directories from annexc test command. 1998-07-06 12:04 Ulrich Drepper * nis/nss_nis/nis-pwd.c (internal_nis_getpwent_r): Handle adjunct password scheme. (_nss_nis_getpwnam_r): Likewise. (_nss_nis_getpwuid_r): Likewise. 1998-07-05 Mark Kettenis * libio/Versions: Move symbols whose source lives in stdio-common to ... * stdio-common/Versions: ... here. * stdio/Versions: Add missing symbols. --- posix/annexc.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'posix/annexc.c') diff --git a/posix/annexc.c b/posix/annexc.c index dbc5e28520..8b95311314 100644 --- a/posix/annexc.c +++ b/posix/annexc.c @@ -609,12 +609,12 @@ static struct header /* Format string to build command to invoke compiler. */ static const char fmt[] = "\ echo \"#include <%s>\" |\ -%s -E -dM -D_POSIX_SOURCE %s \ +%s -E -dM -D_POSIX_SOURCE -D_LIBC %s \ -isystem `%s --print-prog-name=include` - > %s"; static const char testfmt[] = "\ echo \"#include \n#ifndef %s\n#error not defined\n#endif\n\" |\ -%s -E -dM -D_POSIX_SOURCE %s \ +%s -E -dM -D_POSIX_SOURCE -D_LIBC %s \ -isystem `%s --print-prog-name=include` - 2> /dev/null > %s"; @@ -709,7 +709,7 @@ get_null_defines (void) while (fgets (line, sizeof line, input) != NULL) { - char *start, *end; + char *start; if (strlen (line) < 9 || line[7] != ' ') { /* "#define A" */ printf ("Malformed input, expected '#define MACRO'\ngot '%s'\n", @@ -730,9 +730,7 @@ get_null_defines (void) } } start = &line[8]; - for (end = start + 1; !isspace (*end) && *end != '\0'; ++end) - ; - result[result_len++] = xstrndup (start, end - start); + result[result_len++] = xstrndup (start, strcspn (start, " (")); if (first) { @@ -809,7 +807,6 @@ check_header (const struct header *header, const char **except) while (fgets (line, sizeof line, input) != NULL) { - char *endmac; const char **ignore; if (strlen (line) < 9 || line[7] != ' ') { /* "#define A" */ @@ -819,9 +816,13 @@ check_header (const struct header *header, const char **except) continue; } + /* Find next char after the macro identifier; this can be either + a space or an open parenthesis. */ + line[8 + strcspn (&line[8], " (")] = '\0'; + /* Now check whether it's one of the required macros. */ for (i = 0; i < header->nsyms; ++i) - if (!strncmp (&line[8], header->syms[i], strlen (header->syms[i]))) + if (!strcmp (&line[8], header->syms[i])) break; if (i < header->nsyms) { @@ -833,12 +834,6 @@ check_header (const struct header *header, const char **except) if (line[8] == '_') continue; - /* Find next char after the macro identifier; this can be either - a space or an open parenthesis. */ - endmac = strpbrk (&line[8], " ("); - if (endmac != NULL) - *endmac = '\0'; - /* Maybe one of the symbols which are always defined. */ for (ignore = except; *ignore != NULL; ++ignore) if (! strcmp (&line[8], *ignore)) -- cgit v1.2.1