[PATCH v2 25/25] Including <malloc.h> iff it exists.
Alejandro Colomar
alx.manpages at gmail.com
Mon Jun 20 07:11:08 UTC 2022
---
auto/headers | 13 +++++++++++++
src/nxt_unix.h | 6 ++++--
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/auto/headers b/auto/headers
index 4449a999..33cad6aa 100644
--- a/auto/headers
+++ b/auto/headers
@@ -42,6 +42,19 @@ nxt_feature_test="#include <linux/openat2.h>
. auto/feature
+nxt_feature="<malloc.h>"
+nxt_feature_name=NXT_HAVE_MALLOC_H
+nxt_feature_run=no
+nxt_feature_incs=
+nxt_feature_libs=
+nxt_feature_test="#include <malloc.h>
+
+ int main(void) {
+ return 0;
+ }"
+. auto/feature
+
+
nxt_feature="<malloc_np.h>"
nxt_feature_name=NXT_HAVE_MALLOC_NP_H
nxt_feature_run=no
diff --git a/src/nxt_unix.h b/src/nxt_unix.h
index 60062610..891375fc 100644
--- a/src/nxt_unix.h
+++ b/src/nxt_unix.h
@@ -11,6 +11,10 @@
#include <sys/syscall.h>
+#if (NXT_HAVE_MALLOC_H)
+#include <malloc.h>
+#endif
+
#if (NXT_LINUX)
@@ -32,8 +36,6 @@
#define _FILE_OFFSET_BITS 64
-#include <malloc.h> /* malloc_usable_size(). */
-
#if (__GLIBC__ >= 2 && __GLIBC_MINOR__ >= 4)
/*
* POSIX semaphores using NPTL atomic/futex operations
--
2.36.1
More information about the unit
mailing list