From: caro Date: Mon, 16 May 2011 17:39:20 +0000 (+0000) Subject: fix eina_prefix.c on Windows (at least a part of it, as elm is not working with it) X-Git-Tag: 2.0_alpha~70^2~53 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b898e2d5d77842de57902cb08d3b9c8d1ba99fb8;p=framework%2Fuifw%2Feina.git fix eina_prefix.c on Windows (at least a part of it, as elm is not working with it) git-svn-id: svn+ssh://svn.enlightenment.org/var/svn/e/trunk/eina@59454 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- diff --git a/src/lib/eina_prefix.c b/src/lib/eina_prefix.c index 6174591..a8f7245 100644 --- a/src/lib/eina_prefix.c +++ b/src/lib/eina_prefix.c @@ -20,6 +20,32 @@ # include "config.h" #endif +#ifdef STDC_HEADERS +# include +# include +#else +# ifdef HAVE_STDLIB_H +# include +# endif +#endif +#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 +# ifndef HAVE_ALLOCA +# ifdef __cplusplus +extern "C" +# endif +void *alloca (size_t); +# endif +#endif + #include #include #include @@ -175,7 +201,7 @@ _try_argv(Eina_Prefix *pfx, const char *argv0) /* 1. is argv0 abs path? */ #ifdef _WIN32 - if (argv0[0] && (argv0[1] == PSEP_C)) + if (argv0[0] && (argv0[1] == ':')) #else if (argv0[0] == DSEP_C) #endif @@ -456,11 +482,11 @@ eina_prefix_new(const char *argv0, void *symbol, const char *envprefix, { if (info_dl.dli_fname) { -#ifdef _WIN32 - if (info_dl.dli_fname[0] && (info_dl.dli_fname[0] == PSEP_C)) -#else +# ifdef _WIN32 + if (info_dl.dli_fname[0] && (info_dl.dli_fname[1] == ':')) +# else if (info_dl.dli_fname[0] == DSEP_C) -#endif +# endif STRDUP_REP(pfx->exe_path, info_dl.dli_fname); } }