]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: include: don't include stddef.h directly
authorWilly Tarreau <w@1wt.eu>
Fri, 5 Jun 2020 13:37:34 +0000 (15:37 +0200)
committerWilly Tarreau <w@1wt.eu>
Thu, 11 Jun 2020 08:18:59 +0000 (10:18 +0200)
Directly including stddef.h in many files results in it being processed
multiple times while it can be centralized in api-t.h and be guarded
against multiple inclusions. Doing so reduces the number of preprocessed
lines by 1200!

include/haproxy/base64.h
include/haproxy/buf-t.h
include/haproxy/http.h
include/haproxy/namespace-t.h

index d7dec58cde50550bd8f2c11f4fca9d76a7ce4649..1756bc058faa421c17312f43fc39bc4b9624f206 100644 (file)
@@ -14,7 +14,7 @@
 #ifndef _HAPROXY_BASE64_H
 #define _HAPROXY_BASE64_H
 
-#include <stddef.h>
+#include <haproxy/api.h>
 
 int a2base64(char *in, int ilen, char *out, int olen);
 int base64dec(const char *in, size_t ilen, char *out, size_t olen);
index cb4310da09e9817a5161b83783d8028612128e0d..3c0f8b551a1271ef394246ac31c246ef876cf298 100644 (file)
@@ -28,7 +28,7 @@
 #ifndef _HAPROXY_BUF_T_H
 #define _HAPROXY_BUF_T_H
 
-#include <stddef.h>
+#include <haproxy/api-t.h>
 
 /* Structure defining a buffer's head */
 struct buffer {
index 64ac4bcece18c27a1bd3133540c17d6ec926a297..1bd9da9adbc9551e1f2503c89ef35d85ffe5da40 100644 (file)
@@ -23,9 +23,9 @@
 #ifndef _HAPROXY_HTTP_H
 #define _HAPROXY_HTTP_H
 
-#include <stddef.h>
 #include <string.h>
 #include <import/ist.h>
+#include <haproxy/api.h>
 #include <haproxy/http-t.h>
 
 extern const int http_err_codes[HTTP_ERR_SIZE];
index 3a9733644e20d40998bc9fdde8cbee8e1622708f..b86ae31a5f22015bd22a98fec847c0e4b051fac8 100644 (file)
@@ -23,8 +23,8 @@
 #ifndef _HAPROXY_NAMESPACE_T_H
 #define _HAPROXY_NAMESPACE_T_H
 
-#include <stddef.h>
 #include <import/ebpttree.h>
+#include <haproxy/api-t.h>
 
 /* the struct is just empty if namespaces are not supported */
 struct netns_entry