declare alloca where needed and make it portable
authorVincent Torri <vincent.torri@gmail.com>
Fri, 18 Dec 2009 13:52:23 +0000 (13:52 +0000)
committerVincent Torri <vincent.torri@gmail.com>
Fri, 18 Dec 2009 13:52:23 +0000 (13:52 +0000)
SVN revision: 44544

src/bin/e.h
src/bin/e_fm_main.c
src/bin/e_fm_op.c
src/bin/e_thumb_main.c

index 5c19be7..45f50c5 100644 (file)
 #define _FILE_OFFSET_BITS  64
 #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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
+
 #ifdef __linux__
 #include <features.h>
 #endif
 #define _POSIX_HOST_NAME_MAX 255
 #endif
 
-#ifdef HAVE_ALLOCA_H
-#include <alloca.h>
-#endif
-
 #ifdef HAVE_VALGRIND
 # include <memcheck.h>
 #endif
index 8db3f08..8f2f46e 100644 (file)
@@ -1,10 +1,30 @@
 /*
  * vim:cindent:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
+
+#include "config.h"
+
 #ifndef _FILE_OFFSET_BITS
 #define _FILE_OFFSET_BITS  64
 #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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
 #ifdef __linux__
 #include <features.h>
 #endif
@@ -36,7 +56,6 @@
 #include <E_DBus.h>
 #include <E_Hal.h>
 #include <eina_stringshare.h>
-#include "config.h"
 
 #define E_TYPEDEFS
 #include "e_config_data.h"
index 1225437..5fca5d5 100644 (file)
@@ -2,10 +2,29 @@
  * vim:cindent:ts=8:sw=3:sts=8:expandtab:cino=>5n-3f0^-2{2
  */
 
+#include "config.h"
+
 #ifndef _FILE_OFFSET_BITS
 # define _FILE_OFFSET_BITS  64
 #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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
 #include <unistd.h>
 #include <stdio.h>
 #include <stdlib.h>
index 90ec675..c25470a 100644 (file)
@@ -1,6 +1,26 @@
 /*
  * vim:ts=8:sw=3:sts=8:noexpandtab:cino=>5n-3f0^-2{2
  */
+
+#include "config.h"
+
+#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
+extern "C"
+# endif
+void *alloca (size_t);
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #include <unistd.h>