瀏覽代碼

Merge pull request #1319 from RyuKojiro/more_portable_alloca_include-ocornut

Simplify alloca.h include condition (fix for NetBSD)
omar 8 年之前
父節點
當前提交
3420080a35
共有 1 個文件被更改,包括 3 次插入3 次删除
  1. 3 3
      imgui_draw.cpp

+ 3 - 3
imgui_draw.cpp

@@ -21,10 +21,10 @@
 #if !defined(alloca)
 #if !defined(alloca)
 #ifdef _WIN32
 #ifdef _WIN32
 #include <malloc.h>     // alloca
 #include <malloc.h>     // alloca
-#elif (defined(__FreeBSD__) || defined(FreeBSD_kernel) || defined(__DragonFly__)) && !defined(__GLIBC__)
-#include <stdlib.h>     // alloca. FreeBSD uses stdlib.h unless GLIBC
+#elif !defined(__GLIBC__)
+#include <stdlib.h>     // alloca
 #else
 #else
-#include <alloca.h>     // alloca
+#include <alloca.h>     // alloca. glibc has an alloca specific header
 #endif
 #endif
 #endif
 #endif