Fill in missing system header files.

Create replacement header files inside openbsd-compat for common headers
that are missing on a given platform.  Usually these are just empty,
but in some cases they'll include the equivalent file.  This avoids
having to wrap those includes in '#ifdef HAVE_FOO_H' and reduces the
diff vs OpenBSD.

If we create any such headers, add the path to includes.

Initially just stdint.h, more to follow.

ok djm@
This commit is contained in:
Darren Tucker committed 2025-09-05 17:06:14 +10:00
1 parent f64701ca25
commit 9b2c5a2db0
55 files changed
+41 -134

No files matched your search

+1 -3
View File
@@ -24,9 +24,7 @@
#include <pwd.h>
#include <string.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdarg.h>
#include <ctype.h>
#include <limits.h>
+1 -3
View File
@@ -61,9 +61,7 @@
#include <poll.h>
#endif
#include <stdarg.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+16 -1
View File
@@ -489,7 +489,6 @@ AC_CHECK_HEADERS([ \
sha2.h \
shadow.h \
stddef.h \
stdint.h \
string.h \
strings.h \
sys/bitypes.h \
@@ -531,6 +530,22 @@ AC_CHECK_HEADERS([ \
wchar.h \
])
# Create replacement header files for common headers that are missing on this
# platform. Usually these are just empty, but in some cases they'll include
# the equivalent file. This avoids having to wrap those includes in
# '#ifdef HAVE_FOO_H'. If we create any such headers, add the path to includes.
compatincludes=no
AC_CHECK_HEADERS([stdint.h], [], [
compatincludes="`pwd`/openbsd-compat/include"
mkdir -p "$compatincludes"
case "$ac_header" in
*) ;;
esac >"$compatincludes/$ac_header"
])
if test "$compatincludes" != "no"; then
CPPFLAGS="$CPPFLAGS -I$compatincludes"
fi
AC_CHECK_DECLS([le32toh, le64toh, htole64], [], [], [
#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
+1 -3
View File
@@ -10,9 +10,7 @@
#include "includes.h"
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
typedef int8_t crypto_int8;
-2
View File
@@ -28,9 +28,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdbool.h>
#include <string.h>
#include <signal.h>
+1 -3
View File
@@ -42,9 +42,7 @@
#include <signal.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
+1 -3
View File
@@ -39,9 +39,7 @@
#endif
#include <pwd.h>
#include <signal.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
-2
View File
@@ -32,9 +32,7 @@
#include <fcntl.h>
#include <limits.h>
#include <signal.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+1 -3
View File
@@ -20,9 +20,7 @@
#include "includes.h"
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#ifndef HAVE_ARC4RANDOM_UNIFORM
-2
View File
@@ -70,9 +70,7 @@
#include <limits.h>
#include <pwd.h>
#include <stdlib.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <string.h>
#include <unistd.h>
-2
View File
@@ -30,9 +30,7 @@
#ifndef HAVE_MEMMEM
#include <string.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
static char *
twobyte_memmem(const unsigned char *h, size_t k, const unsigned char *n)
-2
View File
@@ -22,9 +22,7 @@
#include <sys/types.h>
#include <errno.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
/*
-2
View File
@@ -22,9 +22,7 @@
#include <errno.h>
#include <stdlib.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <string.h>
#include <unistd.h>
+1 -3
View File
@@ -7,9 +7,7 @@
#include "includes.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include "poly1305.h"
-2
View File
@@ -17,9 +17,7 @@
#include "includes.h"
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
-2
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <signal.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <limits.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_POLL_H
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -10,9 +10,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -11,9 +11,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -11,9 +11,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-2
View File
@@ -11,9 +11,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-2
View File
@@ -11,9 +11,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
-2
View File
@@ -9,9 +9,7 @@
#include <sys/types.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -11,9 +11,7 @@
#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
+1 -3
View File
@@ -25,9 +25,7 @@
#include <assert.h>
#include <ctype.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <signal.h>
+1 -3
View File
@@ -29,9 +29,7 @@
#include <math.h>
#include <signal.h>
#include <stdarg.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+1 -3
View File
@@ -23,9 +23,7 @@
#include "includes.h"
#include <sys/types.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#ifdef WITH_OPENSSL
#include <openssl/bn.h>
+1 -3
View File
@@ -113,9 +113,7 @@
#include <pwd.h>
#include <signal.h>
#include <stdarg.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-2
View File
@@ -19,9 +19,7 @@
#define _SK_API_H 1
#include <stddef.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
/* Flags */
#define SSH_SK_USER_PRESENCE_REQD 0x01
+1 -3
View File
@@ -20,9 +20,7 @@
#ifdef ENABLE_SK_INTERNAL
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
+1 -3
View File
@@ -24,9 +24,7 @@
#include "openbsd-compat/openssl-compat.h"
#endif
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <errno.h>
#include <fcntl.h>
#include <netdb.h>
+1 -3
View File
@@ -23,9 +23,7 @@
#include <dlfcn.h>
#include <stddef.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <string.h>
#include <stdio.h>
+1 -3
View File
@@ -24,9 +24,7 @@
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include "ssherr.h"
#include "sshbuf.h"
+1 -3
View File
@@ -22,9 +22,7 @@
#include <netinet/in.h>
#include <errno.h>
#include <stdlib.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <limits.h>
#include <string.h>
-2
View File
@@ -76,9 +76,7 @@
#include <string.h>
#include <stdarg.h>
#include <stdio.h>
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#include <stdlib.h>
#include <stddef.h>
+1 -3
View File
@@ -16,9 +16,7 @@
#include "includes.h"
#include <stdarg.h>
#ifdef HAVE_STDINT_H
# include <stdint.h>
#endif
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>