forked from enlightenment/efl
* configure.ac:
* src/lib/Makefile.am: readd guards suppressed in previous commit * src/lib/Evil.h: include new header files * src/lib/errno.h: * src/lib/evil_errno.c: add fake errno system with mingw32ce * src/lib/evil_fcntl.c: * src/lib/evil_fcntl.h: fix compilation on cegcc and mingw32 (mainly does nothing on Windows CE) * src/lib/evil_stdio.c: * src/lib/evil_stdio.h: add rewind and perror for mingw32ce * src/lib/evil_string.c: * src/lib/evil_string.h: add strerror for mingw32ce SVN revision: 36587
This commit is contained in:
parent
daf72b327b
commit
c30004b6c9
|
@ -1,3 +1,29 @@
|
|||
2008-10-11 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* configure.ac:
|
||||
* src/lib/Makefile.am:
|
||||
readd guards suppressed in previous commit
|
||||
|
||||
* src/lib/Evil.h:
|
||||
include new header files
|
||||
|
||||
* src/lib/errno.h:
|
||||
* src/lib/evil_errno.c:
|
||||
add fake errno system with mingw32ce
|
||||
|
||||
* src/lib/evil_fcntl.c:
|
||||
* src/lib/evil_fcntl.h:
|
||||
fix compilation on cegcc and mingw32 (mainly does
|
||||
nothing on Windows CE)
|
||||
|
||||
* src/lib/evil_stdio.c:
|
||||
* src/lib/evil_stdio.h:
|
||||
add rewind and perror for mingw32ce
|
||||
|
||||
* src/lib/evil_string.c:
|
||||
* src/lib/evil_string.h:
|
||||
add strerror for mingw32ce
|
||||
|
||||
2008-10-11 Vincent Torri <doursse at users dot sf dot net>
|
||||
|
||||
* configure.ac:
|
||||
|
@ -42,7 +68,7 @@
|
|||
fix mkstemp() on all Windows platform, guard errno stuff
|
||||
|
||||
* src/lib/evil_stdlib.h:
|
||||
template -> __template because 'template ' is a c++ keyword.
|
||||
template -> __template because 'template' is a c++ keyword.
|
||||
|
||||
* src/lib/evil_unistd.c:
|
||||
guard errno stuff
|
||||
|
|
|
@ -97,6 +97,7 @@ if test "x${have_wince}" = "xyes" ; then
|
|||
fi
|
||||
|
||||
AM_CONDITIONAL(EVIL_HAVE_WINCE, test "x${have_wince}" = "xyes")
|
||||
AM_CONDITIONAL(EVIL_HAVE_MINGW32CE, test "x${have_mingw32ce}" = "xyes")
|
||||
|
||||
|
||||
### Checks for linker characteristics
|
||||
|
|
|
@ -105,6 +105,8 @@ typedef unsigned long gid_t;
|
|||
#include "evil_fcntl.h"
|
||||
#include "evil_langinfo.h"
|
||||
#include "evil_stdlib.h"
|
||||
#include "evil_stdio.h"
|
||||
#include "evil_string.h"
|
||||
#include "evil_unistd.h"
|
||||
#include "evil_util.h"
|
||||
|
||||
|
|
|
@ -10,13 +10,22 @@ Evil.h \
|
|||
evil_fcntl.h \
|
||||
evil_langinfo.h \
|
||||
evil_stdlib.h \
|
||||
evil_stdio.h \
|
||||
evil_string.h \
|
||||
evil_unistd.h \
|
||||
evil_util.h
|
||||
|
||||
nobase_include_HEADERS = fnmatch.h pwd.h sys/mman.h
|
||||
nobase_include_HEADERS = pwd.h sys/mman.h
|
||||
|
||||
if EVIL_HAVE_MINGW32CE
|
||||
|
||||
nobase_include_HEADERS += fnmatch.h errno.h
|
||||
|
||||
endif
|
||||
|
||||
libevil_la_SOURCES = \
|
||||
evil.c \
|
||||
evil_errno.c \
|
||||
evil_fcntl.c \
|
||||
evil_fnmatch.c \
|
||||
evil_fnmatch_list_of_states.c \
|
||||
|
@ -24,6 +33,8 @@ evil_langinfo.c \
|
|||
evil_mman.c \
|
||||
evil_pwd.c \
|
||||
evil_stdlib.c \
|
||||
evil_stdio.c \
|
||||
evil_string.c \
|
||||
evil_unistd.c \
|
||||
evil_util.c
|
||||
|
||||
|
|
|
@ -0,0 +1,111 @@
|
|||
#ifndef __EVIL_ERRNO_H__
|
||||
#define __EVIL_ERRNO_H__
|
||||
|
||||
#ifdef EAPI
|
||||
# undef EAPI
|
||||
#endif /* EAPI */
|
||||
|
||||
#ifdef _WIN32
|
||||
# ifdef EFL_EVIL_BUILD
|
||||
# ifdef DLL_EXPORT
|
||||
# define EAPI __declspec(dllexport)
|
||||
# else
|
||||
# define EAPI
|
||||
# endif /* ! DLL_EXPORT */
|
||||
# else
|
||||
# define EAPI __declspec(dllimport)
|
||||
# endif /* ! EFL_EVIL_BUILD */
|
||||
#endif /* _WIN32 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
extern int errno;
|
||||
|
||||
/* Fake values */
|
||||
#define E2BIG 1
|
||||
#define EACCES 2
|
||||
#define EAGAIN 3
|
||||
#define EBADF 4
|
||||
#define EBADMSG 5
|
||||
#define EBUSY 6
|
||||
#define ECANCELED 7
|
||||
#define ECHILD 9
|
||||
#define EDEADLK 10
|
||||
#define EDOM 11
|
||||
#define EEXIST 12
|
||||
#define EFAULT 13
|
||||
#define EFBIG 14
|
||||
#define EINPROGRESS 15
|
||||
#define EINTR 16
|
||||
#define EINVAL 17
|
||||
#define EIO 18
|
||||
#define EISDIR 19
|
||||
#define EMFILE 20
|
||||
#define EMLINK 21
|
||||
#define EMSGSIZE 22
|
||||
#define ENAMETOOLONG 23
|
||||
#define ENFILE 24
|
||||
#define ENODEV 25
|
||||
#define ENOENT 26
|
||||
#define ENOEXEC 27
|
||||
#define ENOLCK 28
|
||||
#define ENOMEM 29
|
||||
#define ENOSPC 30
|
||||
#define ENOSYS 31
|
||||
#define ENOTDIR 32
|
||||
#define ENOTEMPTY 33
|
||||
#define ENOTSUP 34
|
||||
#define ENOTTY 35
|
||||
#define ENXIO 36
|
||||
#define EPERM 37
|
||||
#define EPIPE 38
|
||||
#define ERANGE 39
|
||||
#define EROFS 40
|
||||
#define ESPIPE 41
|
||||
#define ESRCH 42
|
||||
#define ETIMEDOUT 43
|
||||
#define EXDEV 44
|
||||
#define EADDRINUSE 45
|
||||
#define EADDRNOTAVAIL 46
|
||||
#define EAFNOSUPPORT 47
|
||||
#define EALREADY 48
|
||||
#define ECONNABORTED 49
|
||||
#define ECONNREFUSED 50
|
||||
#define ECONNRESET 51
|
||||
#define EDESTADDRREQ 52
|
||||
#define EDQUOT 53
|
||||
#define EHOSTUNREACH 54
|
||||
#define EIDRM 55
|
||||
#define EILSEQ 56
|
||||
#define EISCONN 57
|
||||
#define ELOOP 58
|
||||
#define EMULTIHOP 59
|
||||
#define ENETDOWN 60
|
||||
#define ENETRESET 61
|
||||
#define ENETUNREACH 62
|
||||
#define ENOBUFS 63
|
||||
#define ENODATA 64
|
||||
#define ENOLINK 65
|
||||
#define ENOMSG 66
|
||||
#define ENOPROTOOPT 67
|
||||
#define ENOSR 68
|
||||
#define ENOSTR 69
|
||||
#define ENOTCONN 70
|
||||
#define ENOTSOCK 71
|
||||
#define EOPNOTSUPP 72
|
||||
#define EOVERFLOW 73
|
||||
#define EPROTO 74
|
||||
#define EPROTONOSUPPORT 75
|
||||
#define EPROTOTYPE 76
|
||||
#define ESTALE 77
|
||||
#define ETIME 78
|
||||
#define ETXTBSY 79
|
||||
#define EWOULDBLOCK 80
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __EVIL_ERRNO_H__ */
|
|
@ -0,0 +1,7 @@
|
|||
#ifdef __MINGW32CE__
|
||||
|
||||
#include "Evil.h"
|
||||
|
||||
int errno = 0;
|
||||
|
||||
#endif /* __MINGW32CE__ */
|
|
@ -24,8 +24,6 @@
|
|||
*
|
||||
*/
|
||||
|
||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
||||
|
||||
int fcntl(int fd, int cmd, ...)
|
||||
{
|
||||
va_list va;
|
||||
|
@ -45,10 +43,13 @@ int fcntl(int fd, int cmd, ...)
|
|||
flag = va_arg(va, long);
|
||||
if (flag == FD_CLOEXEC)
|
||||
{
|
||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
||||
if (SetHandleInformation(h, HANDLE_FLAG_INHERIT, 0))
|
||||
res = 0;
|
||||
#endif /* __CEGCC__ || __MINGW32CE__ */
|
||||
}
|
||||
}
|
||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
||||
else if ((cmd == F_SETLK) || (cmd == F_SETLKW))
|
||||
{
|
||||
struct flock fl;
|
||||
|
@ -81,9 +82,9 @@ int fcntl(int fd, int cmd, ...)
|
|||
res = _locking(fd, _LK_UNLCK, fl.l_len);
|
||||
}
|
||||
|
||||
#endif /* __CEGCC__ || __MINGW32CE__ */
|
||||
|
||||
va_end(va);
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif /* __CEGCC__ || __MINGW32CE__ */
|
||||
|
|
|
@ -2,8 +2,6 @@
|
|||
#define __EVIL_FCNTL_H__
|
||||
|
||||
|
||||
#ifndef __CEGCC__
|
||||
|
||||
# include <sys/types.h>
|
||||
|
||||
/**
|
||||
|
@ -100,7 +98,4 @@ struct flock
|
|||
EAPI int fcntl(int fd, int cmd, ...);
|
||||
|
||||
|
||||
#endif /* ! __CEGCC__ */
|
||||
|
||||
|
||||
#endif /* __EVIL_FCNTL_H__ */
|
||||
|
|
|
@ -0,0 +1,31 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "Evil.h"
|
||||
|
||||
|
||||
#ifdef __MINGW32CE__
|
||||
|
||||
/*
|
||||
* Error related functions
|
||||
*
|
||||
*/
|
||||
|
||||
void perror (const char *s)
|
||||
{
|
||||
fprintf(stderr, "[Windows CE] error\n");
|
||||
}
|
||||
|
||||
/*
|
||||
* Stream related functions
|
||||
*
|
||||
*/
|
||||
|
||||
void rewind(FILE *stream)
|
||||
{
|
||||
fseek(stream, 0, SEEK_SET);
|
||||
}
|
||||
|
||||
#endif /* __MINGW32CE__ */
|
|
@ -0,0 +1,27 @@
|
|||
#ifndef __EVIL_STDIO_H__
|
||||
#define __EVIL_STDIO_H__
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
|
||||
#ifdef __MINGW32CE__
|
||||
|
||||
/*
|
||||
* Error related functions
|
||||
*
|
||||
*/
|
||||
|
||||
EAPI void perror (const char *s);
|
||||
|
||||
/*
|
||||
* Stream related functions
|
||||
*
|
||||
*/
|
||||
|
||||
EAPI void rewind(FILE *stream);
|
||||
|
||||
#endif /* __MINGW32CE__ */
|
||||
|
||||
|
||||
#endif /* __EVIL_STDIO_H__ */
|
|
@ -0,0 +1,21 @@
|
|||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
# include "config.h"
|
||||
#endif /* HAVE_CONFIG_H */
|
||||
|
||||
#include "Evil.h"
|
||||
|
||||
|
||||
#ifdef __MINGW32CE__
|
||||
|
||||
/*
|
||||
* Error related functions
|
||||
*
|
||||
*/
|
||||
|
||||
char *strerror (int errnum)
|
||||
{
|
||||
return "[Windows CE] error\n";
|
||||
}
|
||||
|
||||
#endif /* __MINGW32CE__ */
|
|
@ -0,0 +1,17 @@
|
|||
#ifndef __EVIL_STRING_H__
|
||||
#define __EVIL_STRING_H__
|
||||
|
||||
|
||||
#ifdef __MINGW32CE__
|
||||
|
||||
/*
|
||||
* Environment variable related functions
|
||||
*
|
||||
*/
|
||||
|
||||
EAPI char *strerror (int errnum);
|
||||
|
||||
#endif /* __MINGW32CE__ */
|
||||
|
||||
|
||||
#endif /* __EVIL_STRING_H__ */
|
Loading…
Reference in New Issue