浏览代码

OpenBSD malloc.h believes that you should be able to detect headers with autoconf, or build without warnings, but not both. So never include malloc.h on OpenBSD. Backport candidate.

svn:r17891
Nick Mathewson 17 年之前
父节点
当前提交
743c6c8277
共有 2 个文件被更改,包括 7 次插入0 次删除
  1. 5 0
      src/common/util.c
  2. 2 0
      src/or/directory.c

+ 5 - 0
src/common/util.c

@@ -72,8 +72,13 @@
 #include <malloc/malloc.h>
 #endif
 #ifdef HAVE_MALLOC_H
+#ifndef OPENBSD
+/* OpenBSD has a malloc.h, but for our purposes, it only exists in order to
+ * scold us for being so stupid as to autodetect its presence.  To be fair,
+ * they've done this since 1996, when autoconf was only 5 years old. */
 #include <malloc.h>
 #endif
+#endif
 #ifdef HAVE_MALLOC_NP_H
 #include <malloc_np.h>
 #endif

+ 2 - 0
src/or/directory.c

@@ -5,8 +5,10 @@
 
 #include "or.h"
 #if defined(EXPORTMALLINFO) && defined(HAVE_MALLOC_H) && defined(HAVE_MALLINFO)
+#ifndef OPENBSD
 #include <malloc.h>
 #endif
+#endif
 
 /**
  * \file directory.c