curl requires `stdint.h` from C99, and no longer builds without it since
v8.18.0 (after dropping VS2008 support). Assume it's available, drop
feature checks.
Also:
- drop duplicate `stdint.h` includes.
- introduce internal `HAVE_UINTPTR_T`, enabled by default.
- OS400: disable `HAVE_UINTPTR_T`.
- build: keep cmake pre-fill and `cmp-config.pl` exception because cmake
and autotools both detect `stdint.h` implicitly.
Co-authored-by: Dan Fandrich
Ref: #20405
Ref: #20384
Follow-up to
2e1a045d8985e5daa4d9a4f908ed870a16d8e41e #17931
Closes #20406
check_include_file("pwd.h" HAVE_PWD_H)
check_include_file("stdatomic.h" HAVE_STDATOMIC_H)
check_include_file("stdbool.h" HAVE_STDBOOL_H)
-check_include_file("stdint.h" HAVE_STDINT_H)
check_include_file("strings.h" HAVE_STRINGS_H)
check_include_file("stropts.h" HAVE_STROPTS_H)
check_include_file("termio.h" HAVE_TERMIO_H)
libgen.h \
locale.h \
stdbool.h \
- stdint.h \
sys/filio.h \
sys/eventfd.h,
dnl to do if not found
#define HAVE_STDBOOL_H 1
#endif
-/* Define to 1 if you have the <stdint.h> header file. */
-#if defined(_MSC_VER) || defined(__MINGW32__)
-#define HAVE_STDINT_H 1
-#endif
-
/* Define if you have the <sys/param.h> header file. */
#ifdef __MINGW32__
#define HAVE_SYS_PARAM_H 1
/* Define to 1 if you have the sendmmsg function. */
#cmakedefine HAVE_SENDMMSG 1
-/* Define to 1 if you have the <stdint.h> header file. */
-#cmakedefine HAVE_STDINT_H 1
-
/* Define to 1 if you have the 'fsetxattr' function. */
#cmakedefine HAVE_FSETXATTR 1
#include <curl/stdcheaders.h>
#endif
-#if defined(HAVE_STDINT_H) || defined(USE_WOLFSSL)
#include <stdint.h>
-#endif
+#define HAVE_UINTPTR_T /* assume uintptr_t is provided by stdint.h */
#ifdef __DJGPP__
/* By default, DJGPP provides this type as a version of 'unsigned long' which
#define uint32_t unsigned int
#endif
+/* Disable uintptr_t for targets known to miss it from stdint.h */
+#ifdef __OS400__
+#undef HAVE_UINTPTR_T
+#endif
+
#include <limits.h>
#ifdef _WIN32
/* Macro to strip 'const' without triggering a compiler warning.
Use it for APIs that do not or cannot support the const qualifier. */
-#ifdef HAVE_STDINT_H
+#ifdef HAVE_UINTPTR_T
# define CURL_UNCONST(p) ((void *)(uintptr_t)(const void *)(p))
#else
# define CURL_UNCONST(p) ((void *)(p)) /* Fall back to simple cast */
#elif defined(HAVE_MACH_ABSOLUTE_TIME)
-#include <stdint.h>
#include <mach/mach_time.h>
void curlx_pnow(struct curltime *pnow)
***************************************************************************/
#include "urldata.h"
-#ifdef USE_HTTPSRR
-# include <stdint.h>
-#endif
-
#ifndef CURL_DISABLE_DOH
typedef enum {
#ifdef USE_NGHTTP2
-#include <stdint.h>
#include <nghttp2/nghttp2.h>
nghttp2_nv *Curl_dynhds_to_nva(struct dynhds *dynhds, size_t *pcount);
struct curl_httppost *lastnode = NULL;
#define form_ptr_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
-#ifdef HAVE_STDINT_H
+#ifdef HAVE_UINTPTR_T
#define form_int_arg(t) (forms ? (t)(uintptr_t)avalue : va_arg(params, t))
#else
#define form_int_arg(t) (forms ? (t)(void *)avalue : va_arg(params, t))
#include "hash.h"
#include "curlx/timeval.h" /* for curltime, timediff_t */
-#ifdef USE_HTTPSRR
-# include <stdint.h>
-#endif
-
/* Allocate enough memory to hold the full name information structs and
* everything. OSF1 is known to require at least 8872 bytes. The buffer
* required for storing all possible aliases and IP numbers is according to
#ifndef CURL_DISABLE_HTTP
-#ifdef USE_HTTP3
-#include <stdint.h>
-#endif
-
-
struct dynhds;
struct http_negotiation {
#include "curl_setup.h"
#if !defined(CURL_DISABLE_HTTP) && defined(USE_NGHTTP2)
-#include <stdint.h>
#include <nghttp2/nghttp2.h>
#include "urldata.h"
#include "../curl_setup.h"
#if defined(USE_MBEDTLS) || defined(USE_RUSTLS)
-#include <stdint.h>
/* Lookup IANA id for cipher suite string, returns 0 if not recognized */
uint16_t Curl_cipher_suite_lookup_id(const char *cs_str, size_t cs_len);