Edje: update declaration of alloca
authorcaro <caro>
Sat, 18 Feb 2012 14:25:45 +0000 (14:25 +0000)
committercaro <caro@7cbeb6ba-43b4-40fd-8cce-4c39aea84d33>
Sat, 18 Feb 2012 14:25:45 +0000 (14:25 +0000)
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@68107 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33

src/bin/edje_cc_out.c
src/lib/edje_private.h

index f197391..a275347 100644 (file)
@@ -2,21 +2,30 @@
 # include "config.h"
 #endif
 
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
 #ifdef HAVE_ALLOCA_H
 # include <alloca.h>
-#elif defined __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# include <stddef.h>
-# ifdef  __cplusplus
+#elif !defined alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# elif !defined HAVE_ALLOCA
+#  ifdef  __cplusplus
 extern "C"
-# endif
+#  endif
 void *alloca (size_t);
+# endif
 #endif
 
 #include <string.h>
index ecb8234..d9d578c 100644 (file)
@@ -9,18 +9,30 @@
 # define _GNU_SOURCE
 #endif
 
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
 #ifdef HAVE_ALLOCA_H
 # include <alloca.h>
-#elif defined __GNUC__
-# define alloca __builtin_alloca
-#elif defined _AIX
-# define alloca __alloca
-#elif defined _MSC_VER
-# include <malloc.h>
-# define alloca _alloca
-#else
-# include <stddef.h>
+#elif !defined alloca
+# ifdef __GNUC__
+#  define alloca __builtin_alloca
+# elif defined _AIX
+#  define alloca __alloca
+# elif defined _MSC_VER
+#  include <malloc.h>
+#  define alloca _alloca
+# elif !defined HAVE_ALLOCA
+#  ifdef  __cplusplus
+extern "C"
+#  endif
 void *alloca (size_t);
+# endif
 #endif
 
 #include <string.h>
@@ -35,6 +47,8 @@ void *alloca (size_t);
 # include <unistd.h>
 #endif
 
+#include <fcntl.h>
+
 #include <lua.h>
 #include <lualib.h>
 #include <lauxlib.h>