From: Willy Tarreau Date: Fri, 29 Mar 2019 16:26:33 +0000 (+0100) Subject: BUILD: use inttypes.h instead of stdint.h X-Git-Tag: v2.0-dev3~360 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a1bd1faeebd03825677d111a1350ee04d625f165;p=thirdparty%2Fhaproxy.git 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" --- diff --git a/contrib/hpack/decode.c b/contrib/hpack/decode.c index 9ef80f03fe..51ebbf3ea7 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 68a9dd8ab1..3d6b64b505 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 b1b9031725..4260ffbe77 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 294994eb7e..606a834c31 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 e77d38ba26..669038e6a1 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 4daf0aa45b..980e290c27 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 ff03816bc9..65770aae5c 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 e225f04355..78fd87b96a 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 71039d3beb..39d1bf0a07 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 4ab38bf5f0..555dba810e 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 85ca4171b9..04276d2c5a 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 2cbc2bf6cd..ca3f2aa96a 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 8cc7ee7830..ffca828d22 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 7631212cf6..274bf5ea81 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 43ab8e90fe..e7599dcfb8 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 c3f8f5c9e4..42bc9579ac 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 a33262e21f..cf85058997 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 a9deab1290..69f0bdf816 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 9fc6fad818..f5448e0f1e 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 9c02cd3c54..4803137a9c 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 e179f29d58..7f3e7624b9 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 1e57153f22..1a6fa1cc89 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 cbf1fa0217..bdcff7fe70 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 24eb7c444a..70d7f35834 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 3b562b55d2..b7c2d7091f 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 cd042dee62..94b498cbca 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 8753721a7e..31424de0bc 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;