getopt: avoid clash with FreeBSD _getopt_internal
authorEric Blake <ebb9@byu.net>
Mon, 5 Oct 2009 20:34:25 +0000 (14:34 -0600)
committerEric Blake <ebb9@byu.net>
Tue, 6 Oct 2009 00:39:25 +0000 (18:39 -0600)
* lib/getopt.in.h (_getopt_internal): Override the name.
* lib/getopt_int.h (includes): Pick up any overrides.
Reported by Reuben Thomas.

Signed-off-by: Eric Blake <ebb9@byu.net>
ChangeLog
lib/getopt.in.h
lib/getopt_int.h

index e3b25c6..557655e 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2009-10-05  Eric Blake  <ebb9@byu.net>
 
+       getopt: avoid clash with FreeBSD _getopt_internal
+       * lib/getopt.in.h (_getopt_internal): Override the name.
+       * lib/getopt_int.h (includes): Pick up any overrides.
+       Reported by Reuben Thomas.
+
        hash: allow C89 compilation
        * lib/hash.c (check_tuning): Move declaration before statement.
        Reported by Reuben Thomas.
index 15c213f..9de467a 100644 (file)
@@ -68,6 +68,7 @@
 # define optind __GETOPT_ID (optind)
 # define optopt __GETOPT_ID (optopt)
 # define option __GETOPT_ID (option)
+# define _getopt_internal __GETOPT_ID (getopt_internal)
 #endif
 
 /* Standalone applications get correct prototypes for getopt_long and
index 3c6628b..69cdf0d 100644 (file)
@@ -1,5 +1,5 @@
 /* Internal declarations for getopt.
-   Copyright (C) 1989-1994,1996-1999,2001,2003,2004
+   Copyright (C) 1989-1994,1996-1999,2001,2003,2004,2009
    Free Software Foundation, Inc.
    This file is part of the GNU C Library.
 
@@ -19,6 +19,8 @@
 #ifndef _GETOPT_INT_H
 #define _GETOPT_INT_H  1
 
+#include <getopt.h>
+
 extern int _getopt_internal (int ___argc, char **___argv,
                             const char *__shortopts,
                             const struct option *__longopts, int *__longind,