On Thu, Dec 24, 2009 at 9:22 AM, Kai Tietz <ktiet...@googlemail.com> wrote: > Ok, I see. I added to the comment that this just happens on > cross-compile. Btw gendef should work as native build on linux, too. > There shouldn't be any dependencies to Windows specific runtime.
Almost true... :) Attached a patch. Alon.
diff --git a/Makefile.am b/Makefile.am index 1fe0933..8ccf260 100644 --- a/Makefile.am +++ b/Makefile.am @@ -3,6 +3,6 @@ bin_PROGRAMS = gendef gendef_LIBS = @LIBMANGLE_LIB@ gendef_CPPFLAGS = @LIBMANGLE_CPPFLAGS@ gendef_LDFLAGS = @LIBMANGLE_LDFLAGS@ -gendef_SOURCES = src/gendef.h src/gendef.c src/gendef_def.c +gendef_SOURCES = src/gendef.h src/gendef.c src/gendef_def.c src/compat_string.c gendef_CFLAGS = -O3 -g -Werror -Wall -Wextra diff --git a/configure.ac b/configure.ac index 3d00cab..85dbc35 100644 --- a/configure.ac +++ b/configure.ac @@ -32,7 +32,7 @@ AC_TYPE_UINT8_T # is not available, it places in config.h the define of malloc as # rpl_malloc. By this linkage could fail on cross-compiles. #AC_FUNC_MALLOC -AC_CHECK_FUNCS([memset strdup strrchr]) +AC_CHECK_FUNCS([memset strdup strrchr strlwr]) # Check for libmangle libmangle_h=no diff --git a/src/compat-string.h b/src/compat-string.h new file mode 100644 index 0000000..769f750 --- /dev/null +++ b/src/compat-string.h @@ -0,0 +1,8 @@ +#ifndef __COMPAT_STRING_H +#define __COMPAT_STRING_H + +#ifndef HAVE_STRLWER +char *strlwr(char *s); +#endif /* HAVE_STRLWER */ + +#endif /* __COMPAT_STRING_H */ diff --git a/src/compat_string.c b/src/compat_string.c new file mode 100644 index 0000000..fbf36d9 --- /dev/null +++ b/src/compat_string.c @@ -0,0 +1,19 @@ +#ifdef CONFIG_H +#include <config.h> +#endif + +#ifndef HAVE_STRLWER + +#include <ctype.h> +#include "compat-string.h" + +char *strlwr(char *s) { + while(*s != '\x0') { + *s = tolower(*s); + s++; + } + + return s; +} + +#endif /* HAVE_STRLWER */ diff --git a/src/gendef.c b/src/gendef.c index 6addc14..c5afd8a 100644 --- a/src/gendef.c +++ b/src/gendef.c @@ -28,6 +28,7 @@ #include <stdlib.h> #include <memory.h> #include <string.h> +#include "compat-string.h" #include "gendef.h" #ifdef HAVE_LIBMANGLE_H #include <libmangle.h> diff --git a/src/gendef_def.c b/src/gendef_def.c index 156369a..09ac82e 100644 --- a/src/gendef_def.c +++ b/src/gendef_def.c @@ -29,6 +29,7 @@ #include <stdlib.h> #include <memory.h> #include <string.h> +#include "compat-string.h" #include "gendef.h" typedef struct sImpDef {
------------------------------------------------------------------------------ This SF.Net email is sponsored by the Verizon Developer Community Take advantage of Verizon's best-in-class app development support A streamlined, 14 day to market process makes app distribution fast and easy Join now and get one step closer to millions of Verizon customers http://p.sf.net/sfu/verizon-dev2dev
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public