From a1bd1faeebd03825677d111a1350ee04d625f165 Mon Sep 17 00:00:00 2001 From: Willy Tarreau Date: Fri, 29 Mar 2019 17:26:33 +0100 Subject: [PATCH] BUILD: use inttypes.h instead of stdint.h I found on an (old) AIX 5.1 machine that stdint.h didn't exist while inttypes.h which is expected to include it does exist and provides the desired functionalities. As explained here, stdint being just a subset of inttypes for use in freestanding environments, it's probably always OK to switch to inttypes instead: https://pubs.opengroup.org/onlinepubs/009696799/basedefs/stdint.h.html Also it's even clearer here in the autoconf doc : https://www.gnu.org/software/autoconf/manual/autoconf-2.61/html_node/Header-Portability.html "The C99 standard says that inttypes.h includes stdint.h, so there's no need to include stdint.h separately in a standard environment. Some implementations have inttypes.h but not stdint.h (e.g., Solaris 7), but we don't know of any implementation that has stdint.h but not inttypes.h" --- contrib/hpack/decode.c | 2 +- contrib/hpack/gen-enc.c | 2 +- contrib/hpack/gen-rht.c | 2 +- contrib/plug_qdisc/plug_qdisc.c | 2 +- contrib/spoa_example/include/spop_functions.h | 2 +- contrib/wireshark-dissectors/peers/packet-happp.c | 2 +- include/common/buf.h | 2 +- include/common/hash.h | 2 +- include/common/hpack-dec.h | 2 +- include/common/hpack-enc.h | 2 +- include/common/hpack-huff.h | 2 +- include/common/hpack-tbl.h | 2 +- include/common/http-hdr.h | 2 +- include/common/istbuf.h | 2 +- include/common/memory.h | 2 +- include/common/time.h | 2 +- include/proto/channel.h | 2 +- include/proto/protocol_buffers.h | 2 +- include/proto/shctx.h | 2 +- src/h2.c | 2 +- src/hpack-dec.c | 2 +- src/hpack-enc.c | 2 +- src/hpack-huff.c | 2 +- src/hpack-tbl.c | 2 +- src/sha1.c | 2 +- src/time.c | 2 +- src/xxhash.c | 2 +- 27 files changed, 27 insertions(+), 27 deletions(-) diff --git a/contrib/hpack/decode.c b/contrib/hpack/decode.c index 9ef80f03f..51ebbf3ea 100644 --- a/contrib/hpack/decode.c +++ b/contrib/hpack/decode.c @@ -11,7 +11,7 @@ * -o decode decode.c */ #include -#include +#include #include #include #include diff --git a/contrib/hpack/gen-enc.c b/contrib/hpack/gen-enc.c index 68a9dd8ab..3d6b64b50 100644 --- a/contrib/hpack/gen-enc.c +++ b/contrib/hpack/gen-enc.c @@ -8,7 +8,7 @@ * gcc -I../../include -I../../ebtree -o gen-enc gen-enc.c */ #include -#include +#include #include #include #include diff --git a/contrib/hpack/gen-rht.c b/contrib/hpack/gen-rht.c index b1b903172..4260ffbe7 100644 --- a/contrib/hpack/gen-rht.c +++ b/contrib/hpack/gen-rht.c @@ -9,7 +9,7 @@ * 00 => 0x0a, 01 => 0x0d, 10 => 0x16, 11 => EOS */ -#include +#include #include #include #include diff --git a/contrib/plug_qdisc/plug_qdisc.c b/contrib/plug_qdisc/plug_qdisc.c index 294994eb7..606a834c3 100644 --- a/contrib/plug_qdisc/plug_qdisc.c +++ b/contrib/plug_qdisc/plug_qdisc.c @@ -1,4 +1,4 @@ -#include +#include #include #include #include diff --git a/contrib/spoa_example/include/spop_functions.h b/contrib/spoa_example/include/spop_functions.h index e77d38ba2..669038e6a 100644 --- a/contrib/spoa_example/include/spop_functions.h +++ b/contrib/spoa_example/include/spop_functions.h @@ -1,7 +1,7 @@ #ifndef _SPOP_FUNCTIONS_H #define _SPOP_FUNCTIONS_H -#include +#include #include #include diff --git a/contrib/wireshark-dissectors/peers/packet-happp.c b/contrib/wireshark-dissectors/peers/packet-happp.c index 4daf0aa45..980e290c2 100644 --- a/contrib/wireshark-dissectors/peers/packet-happp.c +++ b/contrib/wireshark-dissectors/peers/packet-happp.c @@ -22,7 +22,7 @@ */ #include -#include +#include #include #include diff --git a/include/common/buf.h b/include/common/buf.h index ff03816bc..65770aae5 100644 --- a/include/common/buf.h +++ b/include/common/buf.h @@ -28,7 +28,7 @@ #ifndef _COMMON_BUF_H #define _COMMON_BUF_H -#include +#include #include #include diff --git a/include/common/hash.h b/include/common/hash.h index e225f0435..78fd87b96 100644 --- a/include/common/hash.h +++ b/include/common/hash.h @@ -22,7 +22,7 @@ #ifndef _COMMON_HASH_H_ #define _COMMON_HASH_H_ -#include +#include unsigned int hash_djb2(const char *key, int len); unsigned int hash_wt6(const char *key, int len); diff --git a/include/common/hpack-dec.h b/include/common/hpack-dec.h index 71039d3be..39d1bf0a0 100644 --- a/include/common/hpack-dec.h +++ b/include/common/hpack-dec.h @@ -28,7 +28,7 @@ #ifndef _COMMON_HPACK_DEC_H #define _COMMON_HPACK_DEC_H -#include +#include #include #include #include diff --git a/include/common/hpack-enc.h b/include/common/hpack-enc.h index 4ab38bf5f..555dba810 100644 --- a/include/common/hpack-enc.h +++ b/include/common/hpack-enc.h @@ -28,7 +28,7 @@ #ifndef _COMMON_HPACK_ENC_H #define _COMMON_HPACK_ENC_H -#include +#include #include #include #include diff --git a/include/common/hpack-huff.h b/include/common/hpack-huff.h index 85ca4171b..04276d2c5 100644 --- a/include/common/hpack-huff.h +++ b/include/common/hpack-huff.h @@ -27,7 +27,7 @@ #ifndef _PROTO_HPACK_HUFF_H #define _PROTO_HPACK_HUFF_H -#include +#include int huff_enc(const char *s, char *out); int huff_dec(const uint8_t *huff, int hlen, char *out, int olen); diff --git a/include/common/hpack-tbl.h b/include/common/hpack-tbl.h index 2cbc2bf6c..ca3f2aa96 100644 --- a/include/common/hpack-tbl.h +++ b/include/common/hpack-tbl.h @@ -27,7 +27,7 @@ #ifndef _COMMON_HPACK_TBL_H #define _COMMON_HPACK_TBL_H -#include +#include #include #include #include diff --git a/include/common/http-hdr.h b/include/common/http-hdr.h index 8cc7ee783..ffca828d2 100644 --- a/include/common/http-hdr.h +++ b/include/common/http-hdr.h @@ -27,7 +27,7 @@ #ifndef _COMMON_HTTP_HDR_H #define _COMMON_HTTP_HDR_H -#include +#include #include /* a header field made of a name and a value. Such structure stores 4 longs so diff --git a/include/common/istbuf.h b/include/common/istbuf.h index 7631212cf..274bf5ea8 100644 --- a/include/common/istbuf.h +++ b/include/common/istbuf.h @@ -28,7 +28,7 @@ #ifndef _COMMON_ISTBUF_H #define _COMMON_ISTBUF_H -#include +#include #include #include diff --git a/include/common/memory.h b/include/common/memory.h index 43ab8e90f..e7599dcfb 100644 --- a/include/common/memory.h +++ b/include/common/memory.h @@ -26,7 +26,7 @@ #include #include -#include +#include #include #include diff --git a/include/common/time.h b/include/common/time.h index c3f8f5c9e..42bc9579a 100644 --- a/include/common/time.h +++ b/include/common/time.h @@ -22,7 +22,7 @@ #ifndef _COMMON_TIME_H #define _COMMON_TIME_H -#include +#include #include #include #include diff --git a/include/proto/channel.h b/include/proto/channel.h index a33262e21..cf8505899 100644 --- a/include/proto/channel.h +++ b/include/proto/channel.h @@ -22,7 +22,7 @@ #ifndef _PROTO_CHANNEL_H #define _PROTO_CHANNEL_H -#include +#include #include #include #include diff --git a/include/proto/protocol_buffers.h b/include/proto/protocol_buffers.h index a9deab129..69f0bdf81 100644 --- a/include/proto/protocol_buffers.h +++ b/include/proto/protocol_buffers.h @@ -22,7 +22,7 @@ #ifndef _PROTO_PROTOCOL_BUFFERS_H #define _PROTO_PROTOCOL_BUFFERS_H -#include +#include #include #include #include diff --git a/include/proto/shctx.h b/include/proto/shctx.h index 9fc6fad81..f5448e0f1 100644 --- a/include/proto/shctx.h +++ b/include/proto/shctx.h @@ -17,7 +17,7 @@ #include #include -#include +#include #ifndef USE_PRIVATE_CACHE #ifdef USE_PTHREAD_PSHARED diff --git a/src/h2.c b/src/h2.c index 9c02cd3c5..4803137a9 100644 --- a/src/h2.c +++ b/src/h2.c @@ -25,7 +25,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/src/hpack-dec.c b/src/hpack-dec.c index e179f29d5..7f3e7624b 100644 --- a/src/hpack-dec.c +++ b/src/hpack-dec.c @@ -25,7 +25,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/src/hpack-enc.c b/src/hpack-enc.c index 1e57153f2..1a6fa1cc8 100644 --- a/src/hpack-enc.c +++ b/src/hpack-enc.c @@ -25,7 +25,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/src/hpack-huff.c b/src/hpack-huff.c index cbf1fa021..bdcff7fe7 100644 --- a/src/hpack-huff.c +++ b/src/hpack-huff.c @@ -26,7 +26,7 @@ */ #include -#include +#include #include #include diff --git a/src/hpack-tbl.c b/src/hpack-tbl.c index 24eb7c444..70d7f3583 100644 --- a/src/hpack-tbl.c +++ b/src/hpack-tbl.c @@ -25,7 +25,7 @@ * OTHER DEALINGS IN THE SOFTWARE. */ -#include +#include #include #include #include diff --git a/src/sha1.c b/src/sha1.c index 3b562b55d..b7c2d7091 100644 --- a/src/sha1.c +++ b/src/sha1.c @@ -26,7 +26,7 @@ /* this is only to get definitions for memcpy(), ntohl() and htonl() */ #include -#include +#include #include #include diff --git a/src/time.c b/src/time.c index cd042dee6..94b498cbc 100644 --- a/src/time.c +++ b/src/time.c @@ -10,7 +10,7 @@ * */ -#include +#include #include #include diff --git a/src/xxhash.c b/src/xxhash.c index 8753721a7..31424de0b 100644 --- a/src/xxhash.c +++ b/src/xxhash.c @@ -98,7 +98,7 @@ static void* XXH_memcpy(void* dest, const void* src, size_t size) // Basic Types //************************************** #if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L // C99 -# include +# include typedef uint8_t BYTE; typedef uint16_t U16; typedef uint32_t U32;