]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
Assume STDC_HEADERS will always be defined
authorAlejandro Colomar <alx.manpages@gmail.com>
Tue, 28 Dec 2021 18:19:32 +0000 (19:19 +0100)
committerAlejandro Colomar <alx.manpages@gmail.com>
Wed, 29 Dec 2021 01:39:04 +0000 (02:39 +0100)
We're in 2021.  C89 is everywhere; in fact, there are many other
assumptions in the code that wouldn't probably hold on
pre-standard C environments.  Let's simplify and assume that C89
is available.

The specific assumptions are that:
- <string.h>, and <stdlib.h> are available
- strchr(3), strrchr(3), and strtok(3) are available
- isalpha(3), isspace(3), isdigit(3), and isupper(3) are available

I think we can safely assume we have all of those.

Signed-off-by: Alejandro Colomar <alx.manpages@gmail.com>
configure.ac
lib/defines.h
libmisc/getdate.y

index c9aa37abc77a4812814094fd35d000d3baf583d2..13cbc8c471d43d255877454df138edf1d492ce33 100644 (file)
@@ -38,7 +38,6 @@ dnl Checks for libraries.
 
 dnl Checks for header files.
 AC_HEADER_DIRENT
-AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
 AC_HEADER_STDBOOL
 
index fc1521cbe03380464eb2fb9b25735c2ded3161ef..08483940282ca5f082f87a5349f6ff1629a09037 100644 (file)
@@ -61,16 +61,8 @@ extern char * textdomain (const char * domainname);
 #endif
 #endif
 
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <string.h>
-#else                          /* not STDC_HEADERS */
-# ifndef HAVE_STRCHR
-#  define strchr index
-#  define strrchr rindex
-# endif
-char *strchr (), *strrchr (), *strtok ();
-#endif                         /* not STDC_HEADERS */
+#include <stdlib.h>
+#include <string.h>
 
 #if HAVE_ERRNO_H
 # include <errno.h>
index 7afa995bcdd9f682109a6baf239cd7b62f0657a9..9b9f48c2106345c5491efb4ccc2cd44edcebcb84 100644 (file)
 #include <ctype.h>
 #include <time.h>
 
-#if defined (STDC_HEADERS) || (!defined (isascii) && !defined (HAVE_ISASCII))
-# define IN_CTYPE_DOMAIN(c) 1
-#else
-# define IN_CTYPE_DOMAIN(c) isascii(c)
-#endif
+#define IN_CTYPE_DOMAIN(c) 1
 
 #define ISSPACE(c) (IN_CTYPE_DOMAIN (c) && isspace (c))
 #define ISALPHA(c) (IN_CTYPE_DOMAIN (c) && isalpha (c))
@@ -54,9 +50,7 @@
 
 #include "getdate.h"
 
-#if defined (STDC_HEADERS)
-# include <string.h>
-#endif
+#include <string.h>
 
 /* Some old versions of bison generate parsers that use bcopy.
    That loses on systems that don't provide the function, so we have