From: Enlightenment S. <no-...@en...> - 2008-10-14 06:52:16
|
Log: * src/lib/evil_fcntl.h: don't use it with the cegcc compiler * src/lib/evil_fnmatch.c: fix warning * src/lib/evil_stdlib.c: fix putenv and mkstemp with cegcc and mingw32ce Author: caro Date: 2008-10-13 23:52:09 -0700 (Mon, 13 Oct 2008) New Revision: 36651 Modified: trunk/PROTO/evil/ChangeLog trunk/PROTO/evil/src/lib/evil_fcntl.h trunk/PROTO/evil/src/lib/evil_fnmatch.c trunk/PROTO/evil/src/lib/evil_stdlib.c Modified: trunk/PROTO/evil/ChangeLog =================================================================== --- trunk/PROTO/evil/ChangeLog 2008-10-14 05:30:37 UTC (rev 36650) +++ trunk/PROTO/evil/ChangeLog 2008-10-14 06:52:09 UTC (rev 36651) @@ -1,3 +1,14 @@ +2008-10-14 Vincent Torri <doursse at users dot sf dot net> + + * src/lib/evil_fcntl.h: + don't use it with the cegcc compiler + + * src/lib/evil_fnmatch.c: + fix warning + + * src/lib/evil_stdlib.c: + fix putenv and mkstemp with cegcc and mingw32ce + 2008-10-11 Vincent Torri <doursse at users dot sf dot net> * configure.ac: @@ -2,3 +13,3 @@ * src/lib/Makefile.am: - readd guards suppressed in previous commit + re-add guards suppressed in previous commit Modified: trunk/PROTO/evil/src/lib/evil_fcntl.h =================================================================== --- trunk/PROTO/evil/src/lib/evil_fcntl.h 2008-10-14 05:30:37 UTC (rev 36650) +++ trunk/PROTO/evil/src/lib/evil_fcntl.h 2008-10-14 06:52:09 UTC (rev 36651) @@ -2,6 +2,8 @@ #define __EVIL_FCNTL_H__ +#ifndef __CEGCC__ + # include <sys/types.h> /** @@ -98,4 +100,7 @@ EAPI int fcntl(int fd, int cmd, ...); +#endif /* ! __CEGCC__ */ + + #endif /* __EVIL_FCNTL_H__ */ Modified: trunk/PROTO/evil/src/lib/evil_fnmatch.c =================================================================== --- trunk/PROTO/evil/src/lib/evil_fnmatch.c 2008-10-14 05:30:37 UTC (rev 36650) +++ trunk/PROTO/evil/src/lib/evil_fnmatch.c 2008-10-14 06:52:09 UTC (rev 36651) @@ -181,7 +181,7 @@ fnmatch_init_states(states); - for (c = string; *c && states->size; ++c) + for (c = (char *)string; *c && states->size; ++c) { size_t i; fnmatch_list_of_states_clear(new_states); Modified: trunk/PROTO/evil/src/lib/evil_stdlib.c =================================================================== --- trunk/PROTO/evil/src/lib/evil_stdlib.c 2008-10-14 05:30:37 UTC (rev 36650) +++ trunk/PROTO/evil/src/lib/evil_stdlib.c 2008-10-14 06:52:09 UTC (rev 36651) @@ -6,7 +6,7 @@ #include <stdio.h> #ifndef __CEGCC__ # include <io.h> -#endif /* ! __CEGCC__ */ +#endif /* __CEGCC__ */ #ifdef HAVE_ERRNO_H #include <errno.h> #endif /* HAVE_ERRNO_H */ @@ -112,6 +112,25 @@ #if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) ) return _putenv(string); #else + char *str; + char *egal; + char *name; + char *value; + + str = strdup(string); + if (!str) + return -1; + egal = strchr(str, '='); + if (!egal) + return -1; + + value = egal + 1; + *egal = '\0'; + name = str; + setenv(name, value, 1); + free(str); + + return 0; #endif /* __CEGCC__ || __MINGW32CE__ */ } @@ -281,7 +300,23 @@ suffix[5] = lookup[v % 62]; v /= 62; +#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) ) fd = _open(template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE); +#else /* __CEGCC__ || __MINGW32CE__ */ + { + FILE *f; + + f = fopen(template, "rwb"); + if (!f) + { +#ifdef HAVE_ERRNO_H + errno = EEXIST; +#endif /* HAVE_ERRNO_H */ + return -1; + } + fd = fileno(f); + } +#endif /* __CEGCC__ || __MINGW32CE__ */ if (fd >= 0) return fd; |