]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
BUILD: use inttypes.h instead of stdint.h
authorWilly Tarreau <w@1wt.eu>
Fri, 29 Mar 2019 16:26:33 +0000 (17:26 +0100)
committerWilly Tarreau <w@1wt.eu>
Mon, 1 Apr 2019 05:44:56 +0000 (07:44 +0200)
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"

27 files changed:
contrib/hpack/decode.c
contrib/hpack/gen-enc.c
contrib/hpack/gen-rht.c
contrib/plug_qdisc/plug_qdisc.c
contrib/spoa_example/include/spop_functions.h
contrib/wireshark-dissectors/peers/packet-happp.c
include/common/buf.h
include/common/hash.h
include/common/hpack-dec.h
include/common/hpack-enc.h
include/common/hpack-huff.h
include/common/hpack-tbl.h
include/common/http-hdr.h
include/common/istbuf.h
include/common/memory.h
include/common/time.h
include/proto/channel.h
include/proto/protocol_buffers.h
include/proto/shctx.h
src/h2.c
src/hpack-dec.c
src/hpack-enc.c
src/hpack-huff.c
src/hpack-tbl.c
src/sha1.c
src/time.c
src/xxhash.c

index 9ef80f03fe87a36fe2e555316a36d6cf106c20ce..51ebbf3ea7881d1ed99fd63822f95da7cec5c89b 100644 (file)
@@ -11,7 +11,7 @@
  *        -o decode decode.c
  */
 #include <ctype.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
index 68a9dd8ab15ff921f3a339f23af05bef18601892..3d6b64b50516b7b9d588f97712c6bf7ff3e916b9 100644 (file)
@@ -8,7 +8,7 @@
  *    gcc -I../../include -I../../ebtree -o gen-enc gen-enc.c
  */
 #include <ctype.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>
index b1b9031725577cd0321c3fb55b38d7674e2f42f9..4260ffbe770080745f0ebb37956a7db4a86cc78f 100644 (file)
@@ -9,7 +9,7 @@
  *   00 => 0x0a, 01 => 0x0d, 10 => 0x16, 11 => EOS
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 294994eb7e34ebbc1f0bf2eea6bcaf113fe4c2f4..606a834c31df758b180d71d81623a783263eebd0 100644 (file)
@@ -1,4 +1,4 @@
-#include <stdint.h>
+#include <inttypes.h>
 #include <netlink/cache.h>
 #include <netlink/cli/utils.h>
 #include <netlink/cli/tc.h>
index e77d38ba2635128b13029466a2508f4d8803942f..669038e6a1d1ad787d5cd70743cba6b9d32423c2 100644 (file)
@@ -1,7 +1,7 @@
 #ifndef _SPOP_FUNCTIONS_H
 #define _SPOP_FUNCTIONS_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 #include <spoe_types.h>
 
index 4daf0aa45b6b02d0d202a7d01cc3ce183bd78dcc..980e290c27b6e03cab1e89683a964f7bbc70acbf 100644 (file)
@@ -22,7 +22,7 @@
  */
 
 #include <stdio.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <inttypes.h>
 #include <arpa/inet.h>
 
index ff03816bc99f1059af9e3a083c6bbe164af9f64a..65770aae5cc09e4f7a1499ad7946575d436d516f 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _COMMON_BUF_H
 #define _COMMON_BUF_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 #include <unistd.h>
 
index e225f043551ad030bc96281a25b2aaae9e3fd2d8..78fd87b96a08343c5cc9949bfa7666619f8c04aa 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _COMMON_HASH_H_
 #define _COMMON_HASH_H_
 
-#include <stdint.h>
+#include <inttypes.h>
 
 unsigned int hash_djb2(const char *key, int len);
 unsigned int hash_wt6(const char *key, int len);
index 71039d3beb595f7d64201f818bbd422f5310dffe..39d1bf0a07210eb2bf04910ff516c72733b94460 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _COMMON_HPACK_DEC_H
 #define _COMMON_HPACK_DEC_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <common/chunk.h>
 #include <common/config.h>
 #include <common/hpack-tbl.h>
index 4ab38bf5f068c9211fe1208a14690f915e020052..555dba810edadbb78e36db8d29789be6af429b60 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _COMMON_HPACK_ENC_H
 #define _COMMON_HPACK_ENC_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 #include <common/buf.h>
 #include <common/config.h>
index 85ca4171b9413e19a8c07fb1bd5c60e3960cc6ce..04276d2c5ab3656d9bae6acb539f60ad0996d06f 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef _PROTO_HPACK_HUFF_H
 #define _PROTO_HPACK_HUFF_H
 
-#include <stdint.h>
+#include <inttypes.h>
 
 int huff_enc(const char *s, char *out);
 int huff_dec(const uint8_t *huff, int hlen, char *out, int olen);
index 2cbc2bf6cd67df562102393df5fb50f7801d6c85..ca3f2aa96a9654a943ac6c3d60149435015b4d4f 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef _COMMON_HPACK_TBL_H
 #define _COMMON_HPACK_TBL_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <common/config.h>
 #include <common/http-hdr.h>
index 8cc7ee7830e3ee87cd651e231c353005ba4047a5..ffca828d22c029f3f16077b20b4b500335f4e0cf 100644 (file)
@@ -27,7 +27,7 @@
 #ifndef _COMMON_HTTP_HDR_H
 #define _COMMON_HTTP_HDR_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <common/ist.h>
 
 /* a header field made of a name and a value. Such structure stores 4 longs so
index 7631212cf6c30b9b86b33863a566537440cebe40..274bf5ea815a72207f3d6e7959020defb22effe9 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _COMMON_ISTBUF_H
 #define _COMMON_ISTBUF_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <common/buf.h>
 #include <common/ist.h>
 
index 43ab8e90fefedcf5480192d84e9fe7c1f22cf6ae..e7599dcfb8653c86202a394afdde5e474ee4bd67 100644 (file)
@@ -26,7 +26,7 @@
 
 #include <stdlib.h>
 #include <string.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <unistd.h>
 
 #include <common/config.h>
index c3f8f5c9e4ac4b06dd387efc02b478f7aa54ba24..42bc9579acdf1e056d5ac35420d8d498660ac534 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _COMMON_TIME_H
 #define _COMMON_TIME_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/time.h>
index a33262e21f3cede76beae0d59c556918f24348a7..cf85058997399660d97894fb0d010d6da08272e7 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _PROTO_CHANNEL_H
 #define _PROTO_CHANNEL_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index a9deab129017582d65f45e929af66cbcf304f7ab..69f0bdf81639a23e7a3b599ed4e096368a7f175e 100644 (file)
@@ -22,7 +22,7 @@
 #ifndef _PROTO_PROTOCOL_BUFFERS_H
 #define _PROTO_PROTOCOL_BUFFERS_H
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <types/arg.h>
 #include <types/protocol_buffers.h>
 #include <proto/sample.h>
index 9fc6fad8181e5c2616a60d4c3fe26730e19084b8..f5448e0f1ebaae8c958c771828e51947835c01ab 100644 (file)
@@ -17,7 +17,7 @@
 #include <common/mini-clist.h>
 #include <types/shctx.h>
 
-#include <stdint.h>
+#include <inttypes.h>
 
 #ifndef USE_PRIVATE_CACHE
 #ifdef USE_PTHREAD_PSHARED
index 9c02cd3c54ca0c6c0ed01f217dc209ba7c699075..4803137a9c64e044f07c9a1abdd7ffba45430647 100644 (file)
--- a/src/h2.c
+++ b/src/h2.c
@@ -25,7 +25,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <common/config.h>
 #include <common/h2.h>
 #include <common/http-hdr.h>
index e179f29d58f71ebd6e1729d63a96f30b20825676..7f3e7624b96951d4bf9187f69250c23a492a5ec2 100644 (file)
@@ -25,7 +25,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 1e57153f22b64bb4550b6f62520ab615afa848d7..1a6fa1cc89b798cab88b447fff0efe05b5cea03a 100644 (file)
@@ -25,7 +25,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index cbf1fa02171cc6c15408481b4745a15d5f061625..bdcff7fe709b6e03e63fd0aa161c3bc0d8bc331d 100644 (file)
@@ -26,7 +26,7 @@
  */
 
 #include <stdio.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <string.h>
 
 #include <common/config.h>
index 24eb7c444a11fcb3db34cedd943e148289b1b89f..70d7f358346e5e21f9991789538d9eb6837b984f 100644 (file)
@@ -25,7 +25,7 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
index 3b562b55d25d7f0ca96787834a082d5a073a37ef..b7c2d7091f2193302d8bba7dd3a03de50e0dc6e7 100644 (file)
@@ -26,7 +26,7 @@
 
 /* this is only to get definitions for memcpy(), ntohl() and htonl() */
 #include <string.h>
-#include <stdint.h>
+#include <inttypes.h>
 #include <arpa/inet.h>
 
 #include <import/sha1.h>
index cd042dee622322983bd36388f5fa67c7418173cb..94b498cbca048cd9d430ec423ebb6d933dd1eb6c 100644 (file)
@@ -10,7 +10,7 @@
  *
  */
 
-#include <stdint.h>
+#include <inttypes.h>
 #include <unistd.h>
 #include <sys/time.h>
 
index 8753721a7e6847fe2128c02b9124002222a505af..31424de0bc8478d9754f0ac4a0a28ba4843581a7 100644 (file)
@@ -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 <stdint.h>
+# include <inttypes.h>
 typedef uint8_t  BYTE;
 typedef uint16_t U16;
 typedef uint32_t U32;