From: Eric Blake Date: Mon, 5 Oct 2009 20:34:25 +0000 (-0600) Subject: getopt: avoid clash with FreeBSD _getopt_internal X-Git-Tag: v0.1~5369 X-Git-Url: http://erislabs.org.uk/gitweb/?a=commitdiff_plain;h=40c7699e05fa420358703794383caf38de1713fc;p=gnulib.git 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. Signed-off-by: Eric Blake --- diff --git a/ChangeLog b/ChangeLog index e3b25c6fe..557655ea0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2009-10-05 Eric Blake + 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. diff --git a/lib/getopt.in.h b/lib/getopt.in.h index 15c213f79..9de467ae9 100644 --- a/lib/getopt.in.h +++ b/lib/getopt.in.h @@ -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 diff --git a/lib/getopt_int.h b/lib/getopt_int.h index 3c6628bb9..69cdf0de4 100644 --- a/lib/getopt_int.h +++ b/lib/getopt_int.h @@ -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 + extern int _getopt_internal (int ___argc, char **___argv, const char *__shortopts, const struct option *__longopts, int *__longind,