]> git.ipfire.org Git - thirdparty/glibc.git/blobdiff - stdlib/isomac.c
hurd: Fix build
[thirdparty/glibc.git] / stdlib / isomac.c
index 0229b3fb4f4086ab3ba1863d362540c28eeaced4..8abf93185b2fadf384f4c796a5ee36a608648e8a 100644 (file)
@@ -1,5 +1,5 @@
 /* Check system header files for ISO 9899:1990 (ISO C) compliance.
-   Copyright (C) 1996,97,98,99,2001,02 Free Software Foundation, Inc.
+   Copyright (C) 1996-2018 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Jens Schweikhardt <schweikh@noc.dfn.de>, 1996.
 
@@ -14,9 +14,8 @@
    Lesser General Public License for more details.
 
    You should have received a copy of the GNU Lesser General Public
-   License along with the GNU C Library; if not, write to the Free
-   Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
-   02111-1307 USA.  */
+   License along with the GNU C Library; if not, see
+   <http://www.gnu.org/licenses/>.  */
 
 /* This is a simple minded program that tries to find illegal macro
    definitions in system header files. Illegal macro definitions are
@@ -71,6 +70,7 @@
 # define _GNU_SOURCE 1
 #endif
 
+#include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -177,7 +177,8 @@ static char *macros[] =
 /* Format string to build command to invoke compiler.  */
 static const char fmt[] = "\
 echo \"#include <%s>\" |\
-%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC -DNOT_IN_libc -I. \
+%s -E -dM -ansi -pedantic %s -D_LIBC -D_ISOMAC \
+-DIN_MODULE=MODULE_extramodules -I. \
 -isystem `%s --print-prog-name=include` - 2> /dev/null > %s";
 
 
@@ -264,6 +265,7 @@ get_null_defines (void)
   if (system (command))
     {
       puts ("system() returned nonzero");
+      free (command);
       return NULL;
     }
   free (command);
@@ -303,14 +305,18 @@ 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, end - start);
 
-      if (first)
+      if (strcmp (result[result_len], "IN_MODULE") != 0)
        {
-         fputs ("The following identifiers will be ignored since the compiler defines them\nby default:\n", stdout);
-         first = 0;
+         if (first)
+           {
+             fputs ("The following identifiers will be ignored since the compiler defines them\nby default:\n", stdout);
+             first = 0;
+           }
+         puts (result[result_len]);
        }
-      puts (result[result_len - 1]);
+      ++result_len;
     }
   if (result_len == result_max)
     {