Browse Source

build: assume assert.h is always available

- Remove assert.h detection from all build configurations.

assert.h is a standard header according to C89.

I had proposed this several years ago as part of a larger change that
was abandoned.

Ref: https://github.com/curl/curl/issues/1237#issuecomment-277500720

Closes https://github.com/curl/curl/pull/9985
Jay Satiro 1 year ago
parent
commit
57d3477e77
9 changed files with 2 additions and 17 deletions
  1. 0 1
      CMakeLists.txt
  2. 1 2
      configure.ac
  3. 0 1
      lib/config-dos.h
  4. 0 1
      lib/config-plan9.h
  5. 0 3
      lib/config-win32.h
  6. 0 3
      lib/config-win32ce.h
  7. 0 3
      lib/curl_config.h.cmake
  8. 0 2
      lib/curl_setup.h
  9. 1 1
      lib/curl_setup_once.h

+ 0 - 1
CMakeLists.txt

@@ -975,7 +975,6 @@ check_include_file_concat("sys/utime.h"      HAVE_SYS_UTIME_H)
 check_include_file_concat("sys/xattr.h"      HAVE_SYS_XATTR_H)
 check_include_file_concat("arpa/inet.h"      HAVE_ARPA_INET_H)
 check_include_file_concat("arpa/tftp.h"      HAVE_ARPA_TFTP_H)
-check_include_file_concat("assert.h"         HAVE_ASSERT_H)
 check_include_file_concat("errno.h"          HAVE_ERRNO_H)
 check_include_file_concat("fcntl.h"          HAVE_FCNTL_H)
 check_include_file_concat("idn2.h"           HAVE_IDN2_H)

+ 1 - 2
configure.ac

@@ -3307,13 +3307,12 @@ AC_CHECK_HEADERS(
         sys/socket.h \
         sys/ioctl.h \
         sys/uio.h \
-        assert.h \
         unistd.h \
         stdlib.h \
         arpa/inet.h \
         net/if.h \
         netinet/in.h \
-	netinet/in6.h \
+        netinet/in6.h \
         sys/un.h \
         linux/tcp.h \
         netinet/tcp.h \

+ 0 - 1
lib/config-dos.h

@@ -44,7 +44,6 @@
 #define USE_MANUAL 1
 
 #define HAVE_ARPA_INET_H       1
-#define HAVE_ASSERT_H          1
 #define HAVE_ERRNO_H           1
 #define HAVE_FCNTL_H           1
 #define HAVE_FREEADDRINFO      1

+ 0 - 1
lib/config-plan9.h

@@ -76,7 +76,6 @@
 
 #define HAVE_ALARM 1
 #define HAVE_ARPA_INET_H 1
-#define HAVE_ASSERT_H 1
 #define HAVE_BASENAME 1
 #define HAVE_BOOL_T 1
 #define HAVE_ERRNO_H 1

+ 0 - 3
lib/config-win32.h

@@ -35,9 +35,6 @@
 /* Define if you have the <arpa/inet.h> header file. */
 /* #define HAVE_ARPA_INET_H 1 */
 
-/* Define if you have the <assert.h> header file. */
-#define HAVE_ASSERT_H 1
-
 /* Define if you have the <errno.h> header file. */
 #define HAVE_ERRNO_H 1
 

+ 0 - 3
lib/config-win32ce.h

@@ -35,9 +35,6 @@
 /* Define if you have the <arpa/inet.h> header file.  */
 /* #define HAVE_ARPA_INET_H 1 */
 
-/* Define if you have the <assert.h> header file.  */
-/* #define HAVE_ASSERT_H 1 */
-
 /* Define if you have the <errno.h> header file.  */
 /* #define HAVE_ERRNO_H 1 */
 

+ 0 - 3
lib/curl_config.h.cmake

@@ -150,9 +150,6 @@
 /* Define to 1 if you have the <arpa/tftp.h> header file. */
 #cmakedefine HAVE_ARPA_TFTP_H 1
 
-/* Define to 1 if you have the <assert.h> header file. */
-#cmakedefine HAVE_ASSERT_H 1
-
 /* Define to 1 if you have _Atomic support. */
 #cmakedefine HAVE_ATOMIC 1
 

+ 0 - 2
lib/curl_setup.h

@@ -322,9 +322,7 @@
 #endif
 
 #include <stdio.h>
-#ifdef HAVE_ASSERT_H
 #include <assert.h>
-#endif
 
 #ifdef __TANDEM /* for ns*-tandem-nsk systems */
 # if ! defined __LP64

+ 1 - 1
lib/curl_setup_once.h

@@ -287,7 +287,7 @@ typedef unsigned int bit;
  */
 
 #undef DEBUGASSERT
-#if defined(DEBUGBUILD) && defined(HAVE_ASSERT_H)
+#if defined(DEBUGBUILD)
 #define DEBUGASSERT(x) assert(x)
 #else
 #define DEBUGASSERT(x) do { } while(0)