* src/bin/evil_test_environment.c:

check returned value
	* src/bin/evil_test_memcpy.c:
	define getpagesize() for vc++
	* src/lib/evil_unistd.c:
	move inclusion of time.h after windsock2.h
	include direct.h for vc++
	use _WIN32_WCE for Windows CE compilers in evil_getcwd()
	* src/lib/Evil.h:
	* src/lib/evil_unistd.h:
	move getcwd() define from Evil.h to evil_unistd.h
	add some C99 types to Evil.h for vc++ (will be used in eina)
	* src/lib/evil_fcntl.c:
	include io.h for vc++
	* src/lib/evil_link_xp.cpp:
	use full name for symlink(). Fix symlink on Windows XP with
	the DOS prompt or the debugger of Visual Studio.
	* src/lib/evil_mman.c:
	don't include unistd.h if vc++ is used
	* src/lib/evil_stdio.h:
	formatting
	* src/lib/evil_stdlib.h:
	* src/lib/evil_stdlib.c:
	define putenv only for mingw32ce
	move the returned value of setenv()



SVN revision: 38333
This commit is contained in:
Vincent Torri 2008-12-27 18:53:56 +00:00
parent b6e27a739f
commit ac3bcc3fa9
12 changed files with 73 additions and 23 deletions

View File

@ -1,3 +1,39 @@
2008-12-27 Vincent Torri <doursse at users dot sf dot net>
* src/bin/evil_test_environment.c:
check returned value
* src/bin/evil_test_memcpy.c:
define getpagesize() for vc++
* src/lib/evil_unistd.c:
move inclusion of time.h after windsock2.h
include direct.h for vc++
use _WIN32_WCE for Windows CE compilers in evil_getcwd()
* src/lib/Evil.h:
* src/lib/evil_unistd.h:
move getcwd() define from Evil.h to evil_unistd.h
add some C99 types to Evil.h for vc++ (will be used in eina)
* src/lib/evil_fcntl.c:
include io.h for vc++
* src/lib/evil_link_xp.cpp:
use full name for symlink(). Fix symlink on Windows XP with
the DOS prompt or the debugger of Visual Studio.
* src/lib/evil_mman.c:
don't include unistd.h if vc++ is used
* src/lib/evil_stdio.h:
formatting
* src/lib/evil_stdlib.h:
* src/lib/evil_stdlib.c:
define putenv only for mingw32ce
move the returned value of setenv()
2008-12-13 Vincent Torri <doursse at users dot sf dot net>
* src/bin/Makefile.am:

View File

@ -22,6 +22,8 @@ test_env_tests_run(suite *s)
return 0;
val = getenv("EVIL_TEST_ENV");
if (!val)
return 0;
if (strcmp(val, "val1"))
return 0;

View File

@ -24,13 +24,13 @@ static unsigned char *buf2 = NULL;
static size_t page_size = 0;
#ifdef __MINGW32CE__
#if defined (__MINGW32CE__) || defined (_MSC_VER)
static int
getpagesize()
{
return 1024;
}
#endif /* __MINGW32CE__ */
#endif /* __MINGW32CE__ || _MSC_VER */
static void

View File

@ -92,6 +92,11 @@ typedef int pid_t;
typedef SSIZE_T ssize_t;
typedef unsigned short mode_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef signed int int32_t;
typedef unsigned __int64 uint64_t;
#endif /* _MSC_VER */
@ -142,7 +147,6 @@ typedef unsigned long gid_t;
# define write(fd,buffer,count) _write((fd),(buffer),(count))
# define unlink(filename) _unlink((filename))
# define mkdir(p,m) _mkdir(p)
# define getcwd(b,s) evil_getcwd((b),(s))
# define lstat(f,s) _stat((f),(s))
# define strdup(s) _strdup(s)

View File

@ -1,6 +1,10 @@
#include <stdio.h>
#ifdef _MSC_VER
# include <io.h> /* for _get_osfhandle _lseek and _locking */
#endif
#ifndef __CEGCC__
# include <sys/locking.h>
#endif /* __CEGCC__ */

View File

@ -25,12 +25,15 @@
int
symlink(const char *oldpath, const char *newpath)
{
char fullname[PATH_MAX];
wchar_t *wnewpath;
IShellLink *pISL;
IPersistFile *pIPF;
HRESULT res;
size_t size;
realpath(oldpath, fullname);
res = CoInitialize(NULL);
if (FAILED(res))
{
@ -46,7 +49,7 @@ symlink(const char *oldpath, const char *newpath)
(void **)&pISL)))
goto no_instance;
if (FAILED(pISL->SetPath(oldpath)))
if (FAILED(pISL->SetPath(fullname)))
goto no_setpath;
if (FAILED(pISL->QueryInterface(IID_IPersistFile, (void **)&pIPF)))

View File

@ -1,6 +1,9 @@
#include <stdio.h>
#include <sys/types.h>
#include <unistd.h>
#ifndef _MSC_VER
# include <unistd.h>
#endif
#define WIN32_LEAN_AND_MEAN
#include <windows.h>

View File

@ -4,9 +4,6 @@
#if defined (_WIN32_WCE) && ! defined (__CEGCC__)
# include <stdio.h>
/*
* Error related functions
*
@ -25,7 +22,7 @@ EAPI FILE *evil_fopen(const char *path, const char *mode);
EAPI void evil_rewind(FILE *stream);
#define rewind(f) evil_rewind(f)
# define rewind(f) evil_rewind(f)
#endif /* _WIN32_WCE && ! __CEGCC__ */

View File

@ -93,14 +93,11 @@ getenv(const char *name)
#endif /* __CEGCC__ || __MINGW32CE__ */
#if ! defined(__CEGCC__)
#ifdef __MINGW32CE__
int
putenv(const char *string)
{
#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
return _putenv(string);
#else
char *str;
char *egal;
char *name;
@ -120,10 +117,9 @@ putenv(const char *string)
free(str);
return 0;
#endif /* __CEGCC__ || __MINGW32CE__ */
}
#endif /* ! __CEGCC__ */
#endif /* __MINGW32CE__ */
@ -233,9 +229,9 @@ setenv(const char *name,
return -1;
}
#endif /* __CEGCC__ || __MINGW32CE__ */
return 0;
#endif /* __CEGCC__ || __MINGW32CE__ */
}
#if ! defined(__CEGCC__)

View File

@ -14,11 +14,11 @@ EAPI char *getenv(const char *name);
#endif /* __CEGCC__ || __MINGW32CE__ */
#if ! defined(__CEGCC__)
#ifdef __MINGW32CE__
EAPI int putenv(const char *string);
#endif /* ! __CEGCC__ */
#endif /* __MINGW32CE__ */
/**
* @brief Create, modify, or remove environment variables.

View File

@ -7,12 +7,16 @@
#include <errno.h>
#endif /* HAVE_ERRNO_H */
#include <sys/time.h>
#define WIN32_LEAN_AND_MEAN
#include <winsock2.h>
#undef WIN32_LEAN_AND_MEAN
# include <sys/time.h>
#ifdef _MSC_VER
# include <direct.h> /* for _getcwd */
#endif
#include "Evil.h"
#include "evil_private.h"
@ -89,7 +93,7 @@ getpid(void)
char *
evil_getcwd(char *buffer, size_t size)
{
#if defined(__CEGCC__) || defined(__MINGW32CE__)
#ifdef _WIN32_WCE
wchar_t wpath[PATH_MAX];
char *cpath;
char *delim;
@ -136,7 +140,7 @@ evil_getcwd(char *buffer, size_t size)
return buffer;
#else
return _getcwd(buffer, size);
#endif /* ! __CEGCC__ && ! __MINGW32CE__ */
#endif /* ! _WIN32_WCE */
}
#if defined (_WIN32_WCE) && ! defined (__CEGCC__)

View File

@ -149,6 +149,7 @@ EAPI int evil_stat(const char *file_name, struct stat *st);
*/
EAPI char *evil_getcwd(char *buffer, size_t size);
#define getcwd(b,s) evil_getcwd((b),(s))
/*
* Sockets and pipe related functions