forked from enlightenment/efl
Fix compilation with vc++. Based on patch by Dmitriy Mazovka
* src/lib/Evil.h: move typedef's * src/lib/evil.c: remove declaration and include * src/lib/evil_stdlib.c: simplify mkstmp implementation fix getenv * src/lib/evil_unistd.c: include correct headers for readlink and symlink SVN revision: 35983
This commit is contained in:
parent
146b4a86c6
commit
161ab7a975
|
@ -1,3 +1,20 @@
|
||||||
|
2008-09-14 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
|
Fix compilation with vc++. Based on patch by Dmitriy Mazovka
|
||||||
|
|
||||||
|
* src/lib/Evil.h:
|
||||||
|
move typedef's
|
||||||
|
|
||||||
|
* src/lib/evil.c:
|
||||||
|
remove declaration and include
|
||||||
|
|
||||||
|
* src/lib/evil_stdlib.c:
|
||||||
|
simplify mkstmp implementation
|
||||||
|
fix getenv
|
||||||
|
|
||||||
|
* src/lib/evil_unistd.c:
|
||||||
|
include correct headers for readlink and symlink
|
||||||
|
|
||||||
2008-09-13 Vincent Torri <doursse at users dot sf dot net>
|
2008-09-13 Vincent Torri <doursse at users dot sf dot net>
|
||||||
|
|
||||||
* big rework of evil
|
* big rework of evil
|
||||||
|
|
|
@ -68,12 +68,22 @@ extern "C" {
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <locale.h>
|
#include <locale.h>
|
||||||
|
|
||||||
|
|
||||||
#ifdef PATH_MAX
|
#ifdef PATH_MAX
|
||||||
# undef PATH_MAX
|
# undef PATH_MAX
|
||||||
#endif /* PATH_MAX */
|
#endif /* PATH_MAX */
|
||||||
|
|
||||||
#define PATH_MAX MAX_PATH
|
#define PATH_MAX MAX_PATH
|
||||||
|
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
|
||||||
|
typedef SSIZE_T ssize_t;
|
||||||
|
typedef unsigned short mode_t;
|
||||||
|
|
||||||
|
#endif /* _MSC_VER */
|
||||||
|
|
||||||
|
|
||||||
#include "evil_stdlib.h"
|
#include "evil_stdlib.h"
|
||||||
#include "evil_unistd.h"
|
#include "evil_unistd.h"
|
||||||
#include "evil_util.h"
|
#include "evil_util.h"
|
||||||
|
@ -134,13 +144,6 @@ extern "C" {
|
||||||
# define F_UNLCK 2
|
# define F_UNLCK 2
|
||||||
# endif /* ! F_RDLCK */
|
# endif /* ! F_RDLCK */
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
|
||||||
|
|
||||||
typedef long ssize_t;
|
|
||||||
typedef unsigned short mode_t;
|
|
||||||
|
|
||||||
#endif /* _MSC_VER */
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @struct flock
|
* @struct flock
|
||||||
* @brief A structure that control the lock of a file descriptor.
|
* @brief A structure that control the lock of a file descriptor.
|
||||||
|
|
|
@ -9,7 +9,6 @@
|
||||||
# include <errno.h>
|
# include <errno.h>
|
||||||
# include <sys/locking.h>
|
# include <sys/locking.h>
|
||||||
# include <io.h>
|
# include <io.h>
|
||||||
# include <share.h>
|
|
||||||
# include <shlobj.h>
|
# include <shlobj.h>
|
||||||
# include <objidl.h>
|
# include <objidl.h>
|
||||||
#else
|
#else
|
||||||
|
@ -38,9 +37,6 @@
|
||||||
#include "Evil.h"
|
#include "Evil.h"
|
||||||
|
|
||||||
|
|
||||||
static struct passwd pw;
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef __CEGCC__
|
#ifndef __CEGCC__
|
||||||
|
|
||||||
int fcntl(int fd, int cmd, ...)
|
int fcntl(int fd, int cmd, ...)
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#ifndef __CEGCC__
|
||||||
|
# include <io.h>
|
||||||
|
#endif /* ! __CEGCC__ */
|
||||||
#ifndef __MINGW32CE__
|
#ifndef __MINGW32CE__
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
#endif /* ! __MINGW32CE__ */
|
#endif /* ! __MINGW32CE__ */
|
||||||
|
@ -126,6 +129,7 @@ setenv(const char *name,
|
||||||
char *old_name;
|
char *old_name;
|
||||||
char *str;
|
char *str;
|
||||||
int length;
|
int length;
|
||||||
|
int res;
|
||||||
|
|
||||||
if (!name || !*name)
|
if (!name || !*name)
|
||||||
return -1;
|
return -1;
|
||||||
|
@ -139,7 +143,7 @@ setenv(const char *name,
|
||||||
|
|
||||||
/* if name is already set and overwrite is 0, we exit with success */
|
/* if name is already set and overwrite is 0, we exit with success */
|
||||||
old_name = getenv(name);
|
old_name = getenv(name);
|
||||||
if (!overwrite && oldname)
|
if (!overwrite && old_name)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
length = strlen(name) + strlen(value) + 2;
|
length = strlen(name) + strlen(value) + 2;
|
||||||
|
@ -156,6 +160,8 @@ setenv(const char *name,
|
||||||
res = _putenv(str);
|
res = _putenv(str);
|
||||||
free(str);
|
free(str);
|
||||||
|
|
||||||
|
return res;
|
||||||
|
|
||||||
#else /* __CEGCC__ || __MINGW32CE__ */
|
#else /* __CEGCC__ || __MINGW32CE__ */
|
||||||
|
|
||||||
HKEY key;
|
HKEY key;
|
||||||
|
@ -224,29 +230,22 @@ unsetenv(const char *name)
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
|
#ifndef __CEGCC__
|
||||||
|
|
||||||
int
|
int
|
||||||
mkstemp(char *template)
|
mkstemp(char *template)
|
||||||
{
|
{
|
||||||
int fd;
|
int fd;
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
if (!_mktemp(template))
|
if (!_mktemp(template))
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
fd = _sopen(template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _SH_DENYNO, _S_IREAD | _S_IWRITE);
|
fd = _open(template, _O_RDWR | _O_BINARY | _O_CREAT | _O_EXCL, _S_IREAD | _S_IWRITE);
|
||||||
#else
|
|
||||||
if (_mktemp_s(template, PATH_MAX) != 0)
|
|
||||||
return -1;
|
|
||||||
|
|
||||||
_sopen_s(&fd, template, _O_RDWR | _O_BINARY | _O_CREAT, _SH_DENYNO, _S_IREAD | _S_IWRITE);
|
|
||||||
#endif /* ! __MINGW32__ */
|
|
||||||
|
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* ! ( __CEGCC__ || __MINGW32CE__ ) */
|
#endif /* ! __CEGCC__ */
|
||||||
|
|
||||||
|
|
||||||
char *
|
char *
|
||||||
|
|
|
@ -2,6 +2,12 @@
|
||||||
#include <winsock2.h>
|
#include <winsock2.h>
|
||||||
#undef WIN32_LEAN_AND_MEAN
|
#undef WIN32_LEAN_AND_MEAN
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
|
# include <shobjidl.h>
|
||||||
|
# include <errno.h>
|
||||||
|
# include <shlguid.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
# include "config.h"
|
# include "config.h"
|
||||||
#endif /* HAVE_CONFIG_H */
|
#endif /* HAVE_CONFIG_H */
|
||||||
|
|
Loading…
Reference in New Issue