From a1980950c9d99319fa9f4f390db18e5c44b03681 Mon Sep 17 00:00:00 2001 From: caro Date: Mon, 21 Mar 2011 23:04:35 +0000 Subject: [PATCH] fix compilation of epp on Windows, plus minor formatting git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@57947 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- configure.ac | 2 +- src/bin/epp/Makefile.am | 1 + src/bin/epp/cppalloc.c | 6 +++++- src/bin/epp/cpperror.c | 6 +++++- src/bin/epp/cppexp.c | 13 ++++++++----- src/bin/epp/cpphash.c | 11 +++++++---- src/bin/epp/cpplib.c | 29 +++++++++++++++++++++-------- src/bin/epp/cppmain.c | 5 ++++- 8 files changed, 52 insertions(+), 21 deletions(-) diff --git a/configure.ac b/configure.ac index 0f377ed..1ad482f 100644 --- a/configure.ac +++ b/configure.ac @@ -316,7 +316,7 @@ fi ### Checks for header files -AC_CHECK_HEADERS([locale.h]) +AC_CHECK_HEADERS([locale.h sys/resource.h]) EFL_CHECK_PATH_MAX diff --git a/src/bin/epp/Makefile.am b/src/bin/epp/Makefile.am index c74430c..6db5016 100644 --- a/src/bin/epp/Makefile.am +++ b/src/bin/epp/Makefile.am @@ -38,6 +38,7 @@ epp_CPPFLAGS = \ $(CWARNFLAGS) DEFS= \ +-DHAVE_CONFIG_H \ -DHAVE_STRERROR \ -DFATAL_EXIT_CODE=1 \ -DSUCCESS_EXIT_CODE=0 \ diff --git a/src/bin/epp/cppalloc.c b/src/bin/epp/cppalloc.c index 2106e1c..4ce0dd0 100644 --- a/src/bin/epp/cppalloc.c +++ b/src/bin/epp/cppalloc.c @@ -23,8 +23,12 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include -#include "config.h" + #include "cpplib.h" static void diff --git a/src/bin/epp/cpperror.c b/src/bin/epp/cpperror.c index caaa513..f4cd5eb 100644 --- a/src/bin/epp/cpperror.c +++ b/src/bin/epp/cpperror.c @@ -23,9 +23,13 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include -#include "config.h" + #include "cpplib.h" /* Print the file names and line numbers of the #include diff --git a/src/bin/epp/cppexp.c b/src/bin/epp/cppexp.c index 507fec3..5fcb33f 100644 --- a/src/bin/epp/cppexp.c +++ b/src/bin/epp/cppexp.c @@ -24,22 +24,25 @@ /* Parse a C expression from text in a string */ -#include "config.h" -#include "cpplib.h" -#include "cpphash.h" +#ifdef HAVE_CONFIG_H +# include +#endif #ifdef __EMX__ -#include +# include #endif #ifdef MULTIBYTE_CHARS -#include +# include #endif #include #include #include +#include "cpplib.h" +#include "cpphash.h" + /* This is used for communicating lists of keywords with cccp.c. */ struct arglist { struct arglist *next; diff --git a/src/bin/epp/cpphash.c b/src/bin/epp/cpphash.c index 8545b9a..e3b68e0 100644 --- a/src/bin/epp/cpphash.c +++ b/src/bin/epp/cpphash.c @@ -23,15 +23,18 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -#include "config.h" +#ifdef HAVE_CONFIG_H +# include +#endif + +#include +#include + #include "cpplib.h" #include "cpphash.h" static HASHNODE *hashtab[HASHSIZE]; -#include -#include - #define IS_IDCHAR(ch) is_idchar[(unsigned char)(ch)] /* diff --git a/src/bin/epp/cpplib.c b/src/bin/epp/cpplib.c index d5db450..0e5b47a 100644 --- a/src/bin/epp/cpplib.c +++ b/src/bin/epp/cpplib.c @@ -23,9 +23,23 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ -const char *version_string = "0.0.0"; +#ifdef HAVE_CONFIG_H +# include +#endif -#include "config.h" +#ifdef HAVE_ALLOCA_H +# include +#elif defined __GNUC__ +# define alloca __builtin_alloca +#elif defined _AIX +# define alloca __alloca +#elif defined _MSC_VER +# include +# define alloca _alloca +#else +# include +void *alloca (size_t); +#endif #ifdef __EMX__ #include @@ -42,6 +56,8 @@ const char *version_string = "0.0.0"; #include "cpplib.h" #include "cpphash.h" +const char *version_string = "0.0.0"; + #ifndef STDC_VALUE #define STDC_VALUE 1 #endif @@ -55,12 +71,7 @@ const char *version_string = "0.0.0"; #include #include #include -#ifdef __STDC__ #include -#endif -#ifdef HAVE_ALLOCA_H -#include -#endif #include #include #include @@ -71,7 +82,9 @@ const char *version_string = "0.0.0"; #ifndef USG #include #include /* for __DATE__ and __TIME__ */ -#include +#ifdef HAVE_SYS_RESOURCE_H +# include +#endif #else #include /* CYGNUS LOCAL: shebs -noquiet */ #include diff --git a/src/bin/epp/cppmain.c b/src/bin/epp/cppmain.c index 543d418..fdcc00c 100644 --- a/src/bin/epp/cppmain.c +++ b/src/bin/epp/cppmain.c @@ -21,11 +21,14 @@ * You are forbidden to forbid anyone else to use, share and improve * what you give them. Help stamp out software-hoarding! */ +#ifdef HAVE_CONFIG_H +# include +#endif + #include #include #include -#include "config.h" #include "cpplib.h" #define EPP_DEBUG 0 -- 2.7.4