This is the mail archive of the libffi-discuss@sourceware.org mailing list for the libffi project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] HPUX: fix dlmalloc build


Prevent redefinition of struct mallinfo in HPUX.
HPUX' /usr/include/stdlib.h redefines this struct, unless _STRUCT_MALLINFO is
defined.
---
 src/dlmalloc.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/src/dlmalloc.c b/src/dlmalloc.c
index 0fa235a..5c9f9c2 100644
--- a/src/dlmalloc.c
+++ b/src/dlmalloc.c
@@ -622,6 +622,9 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
 #include "/usr/include/malloc.h"
 #else /* HAVE_USR_INCLUDE_MALLOC_H */
 
+/* HP-UX's stdlib.h redefines mallinfo unless _STRUCT_MALLINFO is defined */
+#define _STRUCT_MALLINFO
+
 struct mallinfo {
   MALLINFO_FIELD_TYPE arena;    /* non-mmapped space allocated from system */
   MALLINFO_FIELD_TYPE ordblks;  /* number of free chunks */
-- 
1.7.2.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]