Kaynağa Gözat

Add #ifdef and #undef where necessary to prevent duplicate definitions.

kestred 12 yıl önce
ebeveyn
işleme
3fd5f58583

+ 6 - 0
dtool/src/dtoolbase/dlmalloc.h

@@ -148,9 +148,15 @@ void* dlvalloc(size_t);
 */
 */
 int dlmallopt(int, int);
 int dlmallopt(int, int);
 
 
+#ifndef M_TRIM_THRESHOLD
 #define M_TRIM_THRESHOLD     (-1)
 #define M_TRIM_THRESHOLD     (-1)
+#endif
+
 #define M_GRANULARITY        (-2)
 #define M_GRANULARITY        (-2)
+
+#ifndef M_MMAP_THRESHOLD
 #define M_MMAP_THRESHOLD     (-3)
 #define M_MMAP_THRESHOLD     (-3)
+#endif
 
 
 
 
 /*
 /*

+ 7 - 0
dtool/src/dtoolbase/dlmalloc_src.cxx

@@ -597,9 +597,15 @@ DEFAULT_MMAP_THRESHOLD       default: 256K
   malloc does support the following options.
   malloc does support the following options.
 */
 */
 
 
+#ifndef M_TRIM_THRESHOLD
 #define M_TRIM_THRESHOLD     (-1)
 #define M_TRIM_THRESHOLD     (-1)
+#endif
+
 #define M_GRANULARITY        (-2)
 #define M_GRANULARITY        (-2)
+
+#ifndef M_MMAP_THRESHOLD
 #define M_MMAP_THRESHOLD     (-3)
 #define M_MMAP_THRESHOLD     (-3)
+#endif
 
 
 /* ------------------------ Mallinfo declarations ------------------------ */
 /* ------------------------ Mallinfo declarations ------------------------ */
 
 
@@ -1180,6 +1186,7 @@ int mspace_mallopt(int, int);
 #include <assert.h>
 #include <assert.h>
 #endif /* ABORT_ON_ASSERT_FAILURE */
 #endif /* ABORT_ON_ASSERT_FAILURE */
 #else  /* DEBUG */
 #else  /* DEBUG */
+#undef assert
 #define assert(x)
 #define assert(x)
 #endif /* DEBUG */
 #endif /* DEBUG */
 #ifndef LACKS_STRING_H
 #ifndef LACKS_STRING_H

+ 1 - 0
dtool/src/dtoolbase/dtoolbase.h

@@ -106,6 +106,7 @@
 #ifdef HAVE_PYTHON
 #ifdef HAVE_PYTHON
 #undef _POSIX_C_SOURCE
 #undef _POSIX_C_SOURCE
 #undef _XOPEN_SOURCE
 #undef _XOPEN_SOURCE
+#undef HAVE_LOCKF
 #include "pyconfig.h"
 #include "pyconfig.h"
 #endif
 #endif