From 40c7699e05fa420358703794383caf38de1713fc Mon Sep 17 00:00:00 2001 From: Eric Blake Date: Mon, 5 Oct 2009 14:34:25 -0600 Subject: [PATCH] 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 --- ChangeLog | 5 +++++ lib/getopt.in.h | 1 + lib/getopt_int.h | 4 +++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e3b25c6fe5..557655ea0e 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 15c213f79b..9de467ae98 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 3c6628bb94..69cdf0de49 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, -- 2.30.2