forked from enlightenment/efl
* 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 SVN revision: 36651
This commit is contained in:
parent
9c044c7904
commit
d8fda87e83
|
@ -1,8 +1,19 @@
|
|||
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:
|
||||
* src/lib/Makefile.am:
|
||||
readd guards suppressed in previous commit
|
||||
re-add guards suppressed in previous commit
|
||||
|
||||
* src/lib/Evil.h:
|
||||
include new header files
|
||||
|
|
|
@ -2,6 +2,8 @@
|
|||
#define __EVIL_FCNTL_H__
|
||||
|
||||
|
||||
#ifndef __CEGCC__
|
||||
|
||||
# include <sys/types.h>
|
||||
|
||||
/**
|
||||
|
@ -98,4 +100,7 @@ struct flock
|
|||
EAPI int fcntl(int fd, int cmd, ...);
|
||||
|
||||
|
||||
#endif /* ! __CEGCC__ */
|
||||
|
||||
|
||||
#endif /* __EVIL_FCNTL_H__ */
|
||||
|
|
|
@ -181,7 +181,7 @@ fnmatch(const char *pattern,
|
|||
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);
|
||||
|
|
|
@ -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 @@ putenv(const char *string)
|
|||
#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 @@ mkstemp(char *template)
|
|||
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;
|
||||
|
||||
|
|
Loading…
Reference in New Issue