From 13df195c6217c43981e79515515ba8fda13a644d Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sun, 27 Nov 2016 19:52:08 +0100 Subject: [PATCH] Tweak last commit. --- ChangeLog | 4 ++-- lib/getopt.c | 6 ++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0c82d74..687b364 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,8 @@ Assume the available C compiler supports ANSI C. Remove K&R C cruft. * lib/getopt.h: Assume 'const' is defined. Use ANSI C prototypes. - * lib/getopt.c: Assume 'const' is defined, 'strlen' is declared. Use - ANSI C prototypes. + * lib/getopt.c: Assume 'const' is defined. Use ANSI C prototypes. + Include . Declare strcmp and strlen. * lib/getopt1.c: Assume 'const' and NULL are defined. Use ANSI C prototypes. * lib/getopt.h.patch: Remove file. diff --git a/lib/getopt.c b/lib/getopt.c index 9e7d2f4..b95002a 100644 --- a/lib/getopt.c +++ b/lib/getopt.c @@ -50,6 +50,9 @@ #ifndef ELIDE_CODE +/* Get size_t. */ +#include + /* This needs to come after some library #include to get __GNU_LIBRARY__ defined. */ #ifdef __GNU_LIBRARY__ @@ -206,6 +209,9 @@ my_index (const char *str, int chr) return 0; } +extern int strcmp (const char *, const char *); +extern size_t strlen (const char *); + #endif /* not __GNU_LIBRARY__ */ /* Handle permutation of arguments. */