remove C99 features and use beautiful C89/BSD code

makes vc++ and win32 gcc/g++ happy


SVN revision: 47766
This commit is contained in:
Vincent Torri 2010-04-05 17:48:08 +00:00
parent f824eac7ff
commit ac2824d126
2 changed files with 20 additions and 2 deletions

View File

@ -162,7 +162,7 @@ extern "C" {
const char *license; /**< if exists, --license will work */
const char *description; /**< long description, possible multiline */
unsigned char strict : 1; /**< fail on errors */
const Ecore_Getopt_Desc descs[]; /* NULL terminated. */
const Ecore_Getopt_Desc *descs; /* NULL terminated. */
};
#define ECORE_GETOPT_STORE_FULL(shortname, longname, help, metavar, type, arg_requirement, default_value) \

View File

@ -6,6 +6,23 @@
# include <config.h>
#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 <stdio.h>
#include <string.h>
#include <stdarg.h>
@ -670,9 +687,10 @@ _ecore_getopt_parse_find_short(const Ecore_Getopt *parser, char name)
static int
_ecore_getopt_parse_find_nonargs_base(const Ecore_Getopt *parser, int argc, char **argv)
{
char *nonargs[argc];
char *nonargs;
int src, dst, used, base;
nonargs = alloca(sizeof(char) * argc);
src = 1;
dst = 1;
used = 0;