Browse Source

Update alloca logic to work on more platforms

Luke Dashjr 11 years ago
parent
commit
93b3c99e93
1 changed files with 7 additions and 11 deletions
  1. 7 11
      miner.h

+ 7 - 11
miner.h

@@ -56,19 +56,15 @@
 #endif
 #endif
 #ifdef HAVE_ALLOCA_H
 #ifdef HAVE_ALLOCA_H
 # include <alloca.h>
 # include <alloca.h>
-#elif defined __GNUC__
-# ifndef WIN32
+#elif !defined alloca
+# ifdef __GNUC__
 #  define alloca __builtin_alloca
 #  define alloca __builtin_alloca
-# else
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
 #  include <malloc.h>
 #  include <malloc.h>
-# endif
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# ifndef HAVE_ALLOCA
+#  define alloca _alloca
+# elif !defined HAVE_ALLOCA
 #  ifdef  __cplusplus
 #  ifdef  __cplusplus
 extern "C"
 extern "C"
 #  endif
 #  endif