summaryrefslogtreecommitdiff
path: root/legacy
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2008-12-27 18:53:56 +0000
committerVincent Torri <vincent.torri@gmail.com>2008-12-27 18:53:56 +0000
commitac3bcc3fa94028029b20af6385a26af9823ed52e (patch)
tree021ba088b0cf011d06dc602aa6474cf5b2d88c55 /legacy
parentb6e27a739f8973abcb81d7d8593e727105ecd08e (diff)
* 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
Diffstat (limited to '')
-rw-r--r--legacy/evil/ChangeLog36
-rw-r--r--legacy/evil/src/bin/evil_test_environment.c2
-rw-r--r--legacy/evil/src/bin/evil_test_memcpy.c4
-rw-r--r--legacy/evil/src/lib/Evil.h6
-rw-r--r--legacy/evil/src/lib/evil_fcntl.c4
-rw-r--r--legacy/evil/src/lib/evil_link_xp.cpp5
-rw-r--r--legacy/evil/src/lib/evil_mman.c5
-rw-r--r--legacy/evil/src/lib/evil_stdio.h5
-rw-r--r--legacy/evil/src/lib/evil_stdlib.c12
-rw-r--r--legacy/evil/src/lib/evil_stdlib.h4
-rw-r--r--legacy/evil/src/lib/evil_unistd.c12
-rw-r--r--legacy/evil/src/lib/evil_unistd.h1
12 files changed, 73 insertions, 23 deletions
diff --git a/legacy/evil/ChangeLog b/legacy/evil/ChangeLog
index 60fac3e491..7685b0e226 100644
--- a/legacy/evil/ChangeLog
+++ b/legacy/evil/ChangeLog
@@ -1,3 +1,39 @@
12008-12-27 Vincent Torri <doursse at users dot sf dot net>
2
3 * src/bin/evil_test_environment.c:
4 check returned value
5
6 * src/bin/evil_test_memcpy.c:
7 define getpagesize() for vc++
8
9 * src/lib/evil_unistd.c:
10 move inclusion of time.h after windsock2.h
11 include direct.h for vc++
12 use _WIN32_WCE for Windows CE compilers in evil_getcwd()
13
14 * src/lib/Evil.h:
15 * src/lib/evil_unistd.h:
16 move getcwd() define from Evil.h to evil_unistd.h
17 add some C99 types to Evil.h for vc++ (will be used in eina)
18
19 * src/lib/evil_fcntl.c:
20 include io.h for vc++
21
22 * src/lib/evil_link_xp.cpp:
23 use full name for symlink(). Fix symlink on Windows XP with
24 the DOS prompt or the debugger of Visual Studio.
25
26 * src/lib/evil_mman.c:
27 don't include unistd.h if vc++ is used
28
29 * src/lib/evil_stdio.h:
30 formatting
31
32 * src/lib/evil_stdlib.h:
33 * src/lib/evil_stdlib.c:
34 define putenv only for mingw32ce
35 move the returned value of setenv()
36
12008-12-13 Vincent Torri <doursse at users dot sf dot net> 372008-12-13 Vincent Torri <doursse at users dot sf dot net>
2 38
3 * src/bin/Makefile.am: 39 * src/bin/Makefile.am:
diff --git a/legacy/evil/src/bin/evil_test_environment.c b/legacy/evil/src/bin/evil_test_environment.c
index 07ba484f37..e7139a1843 100644
--- a/legacy/evil/src/bin/evil_test_environment.c
+++ b/legacy/evil/src/bin/evil_test_environment.c
@@ -22,6 +22,8 @@ test_env_tests_run(suite *s)
22 return 0; 22 return 0;
23 23
24 val = getenv("EVIL_TEST_ENV"); 24 val = getenv("EVIL_TEST_ENV");
25 if (!val)
26 return 0;
25 if (strcmp(val, "val1")) 27 if (strcmp(val, "val1"))
26 return 0; 28 return 0;
27 29
diff --git a/legacy/evil/src/bin/evil_test_memcpy.c b/legacy/evil/src/bin/evil_test_memcpy.c
index fdd93efe82..9dca042e32 100644
--- a/legacy/evil/src/bin/evil_test_memcpy.c
+++ b/legacy/evil/src/bin/evil_test_memcpy.c
@@ -24,13 +24,13 @@ static unsigned char *buf2 = NULL;
24static size_t page_size = 0; 24static size_t page_size = 0;
25 25
26 26
27#ifdef __MINGW32CE__ 27#if defined (__MINGW32CE__) || defined (_MSC_VER)
28static int 28static int
29getpagesize() 29getpagesize()
30{ 30{
31 return 1024; 31 return 1024;
32} 32}
33#endif /* __MINGW32CE__ */ 33#endif /* __MINGW32CE__ || _MSC_VER */
34 34
35 35
36static void 36static void
diff --git a/legacy/evil/src/lib/Evil.h b/legacy/evil/src/lib/Evil.h
index da8d9bf949..28777611b6 100644
--- a/legacy/evil/src/lib/Evil.h
+++ b/legacy/evil/src/lib/Evil.h
@@ -92,6 +92,11 @@ typedef int pid_t;
92typedef SSIZE_T ssize_t; 92typedef SSIZE_T ssize_t;
93typedef unsigned short mode_t; 93typedef unsigned short mode_t;
94 94
95typedef unsigned short uint16_t;
96typedef unsigned int uint32_t;
97typedef signed int int32_t;
98typedef unsigned __int64 uint64_t;
99
95#endif /* _MSC_VER */ 100#endif /* _MSC_VER */
96 101
97 102
@@ -142,7 +147,6 @@ typedef unsigned long gid_t;
142# define write(fd,buffer,count) _write((fd),(buffer),(count)) 147# define write(fd,buffer,count) _write((fd),(buffer),(count))
143# define unlink(filename) _unlink((filename)) 148# define unlink(filename) _unlink((filename))
144# define mkdir(p,m) _mkdir(p) 149# define mkdir(p,m) _mkdir(p)
145# define getcwd(b,s) evil_getcwd((b),(s))
146# define lstat(f,s) _stat((f),(s)) 150# define lstat(f,s) _stat((f),(s))
147# define strdup(s) _strdup(s) 151# define strdup(s) _strdup(s)
148 152
diff --git a/legacy/evil/src/lib/evil_fcntl.c b/legacy/evil/src/lib/evil_fcntl.c
index 4d0c7196e7..603fd1aaab 100644
--- a/legacy/evil/src/lib/evil_fcntl.c
+++ b/legacy/evil/src/lib/evil_fcntl.c
@@ -1,6 +1,10 @@
1 1
2#include <stdio.h> 2#include <stdio.h>
3 3
4#ifdef _MSC_VER
5# include <io.h> /* for _get_osfhandle _lseek and _locking */
6#endif
7
4#ifndef __CEGCC__ 8#ifndef __CEGCC__
5# include <sys/locking.h> 9# include <sys/locking.h>
6#endif /* __CEGCC__ */ 10#endif /* __CEGCC__ */
diff --git a/legacy/evil/src/lib/evil_link_xp.cpp b/legacy/evil/src/lib/evil_link_xp.cpp
index d0bac6454b..820bea1cb5 100644
--- a/legacy/evil/src/lib/evil_link_xp.cpp
+++ b/legacy/evil/src/lib/evil_link_xp.cpp
@@ -25,12 +25,15 @@
25int 25int
26symlink(const char *oldpath, const char *newpath) 26symlink(const char *oldpath, const char *newpath)
27{ 27{
28 char fullname[PATH_MAX];
28 wchar_t *wnewpath; 29 wchar_t *wnewpath;
29 IShellLink *pISL; 30 IShellLink *pISL;
30 IPersistFile *pIPF; 31 IPersistFile *pIPF;
31 HRESULT res; 32 HRESULT res;
32 size_t size; 33 size_t size;
33 34
35 realpath(oldpath, fullname);
36
34 res = CoInitialize(NULL); 37 res = CoInitialize(NULL);
35 if (FAILED(res)) 38 if (FAILED(res))
36 { 39 {
@@ -46,7 +49,7 @@ symlink(const char *oldpath, const char *newpath)
46 (void **)&pISL))) 49 (void **)&pISL)))
47 goto no_instance; 50 goto no_instance;
48 51
49 if (FAILED(pISL->SetPath(oldpath))) 52 if (FAILED(pISL->SetPath(fullname)))
50 goto no_setpath; 53 goto no_setpath;
51 54
52 if (FAILED(pISL->QueryInterface(IID_IPersistFile, (void **)&pIPF))) 55 if (FAILED(pISL->QueryInterface(IID_IPersistFile, (void **)&pIPF)))
diff --git a/legacy/evil/src/lib/evil_mman.c b/legacy/evil/src/lib/evil_mman.c
index 424cdfa731..0223a6b197 100644
--- a/legacy/evil/src/lib/evil_mman.c
+++ b/legacy/evil/src/lib/evil_mman.c
@@ -1,6 +1,9 @@
1#include <stdio.h> 1#include <stdio.h>
2#include <sys/types.h> 2#include <sys/types.h>
3#include <unistd.h> 3
4#ifndef _MSC_VER
5# include <unistd.h>
6#endif
4 7
5#define WIN32_LEAN_AND_MEAN 8#define WIN32_LEAN_AND_MEAN
6#include <windows.h> 9#include <windows.h>
diff --git a/legacy/evil/src/lib/evil_stdio.h b/legacy/evil/src/lib/evil_stdio.h
index e3924cf427..d68cca347c 100644
--- a/legacy/evil/src/lib/evil_stdio.h
+++ b/legacy/evil/src/lib/evil_stdio.h
@@ -4,9 +4,6 @@
4 4
5#if defined (_WIN32_WCE) && ! defined (__CEGCC__) 5#if defined (_WIN32_WCE) && ! defined (__CEGCC__)
6 6
7
8# include <stdio.h>
9
10/* 7/*
11 * Error related functions 8 * Error related functions
12 * 9 *
@@ -25,7 +22,7 @@ EAPI FILE *evil_fopen(const char *path, const char *mode);
25 22
26EAPI void evil_rewind(FILE *stream); 23EAPI void evil_rewind(FILE *stream);
27 24
28#define rewind(f) evil_rewind(f) 25# define rewind(f) evil_rewind(f)
29 26
30#endif /* _WIN32_WCE && ! __CEGCC__ */ 27#endif /* _WIN32_WCE && ! __CEGCC__ */
31 28
diff --git a/legacy/evil/src/lib/evil_stdlib.c b/legacy/evil/src/lib/evil_stdlib.c
index 7a19cf3676..0f6d72742d 100644
--- a/legacy/evil/src/lib/evil_stdlib.c
+++ b/legacy/evil/src/lib/evil_stdlib.c
@@ -93,14 +93,11 @@ getenv(const char *name)
93 93
94#endif /* __CEGCC__ || __MINGW32CE__ */ 94#endif /* __CEGCC__ || __MINGW32CE__ */
95 95
96#if ! defined(__CEGCC__) 96#ifdef __MINGW32CE__
97 97
98int 98int
99putenv(const char *string) 99putenv(const char *string)
100{ 100{
101#if ! ( defined(__CEGCC__) || defined(__MINGW32CE__) )
102 return _putenv(string);
103#else
104 char *str; 101 char *str;
105 char *egal; 102 char *egal;
106 char *name; 103 char *name;
@@ -120,10 +117,9 @@ putenv(const char *string)
120 free(str); 117 free(str);
121 118
122 return 0; 119 return 0;
123#endif /* __CEGCC__ || __MINGW32CE__ */
124} 120}
125 121
126#endif /* ! __CEGCC__ */ 122#endif /* __MINGW32CE__ */
127 123
128 124
129 125
@@ -233,9 +229,9 @@ setenv(const char *name,
233 return -1; 229 return -1;
234 } 230 }
235 231
236#endif /* __CEGCC__ || __MINGW32CE__ */
237
238 return 0; 232 return 0;
233
234#endif /* __CEGCC__ || __MINGW32CE__ */
239} 235}
240 236
241#if ! defined(__CEGCC__) 237#if ! defined(__CEGCC__)
diff --git a/legacy/evil/src/lib/evil_stdlib.h b/legacy/evil/src/lib/evil_stdlib.h
index a0120972b4..36f300fbd1 100644
--- a/legacy/evil/src/lib/evil_stdlib.h
+++ b/legacy/evil/src/lib/evil_stdlib.h
@@ -14,11 +14,11 @@ EAPI char *getenv(const char *name);
14#endif /* __CEGCC__ || __MINGW32CE__ */ 14#endif /* __CEGCC__ || __MINGW32CE__ */
15 15
16 16
17#if ! defined(__CEGCC__) 17#ifdef __MINGW32CE__
18 18
19EAPI int putenv(const char *string); 19EAPI int putenv(const char *string);
20 20
21#endif /* ! __CEGCC__ */ 21#endif /* __MINGW32CE__ */
22 22
23/** 23/**
24 * @brief Create, modify, or remove environment variables. 24 * @brief Create, modify, or remove environment variables.
diff --git a/legacy/evil/src/lib/evil_unistd.c b/legacy/evil/src/lib/evil_unistd.c
index 5e62233324..6dd97a548f 100644
--- a/legacy/evil/src/lib/evil_unistd.c
+++ b/legacy/evil/src/lib/evil_unistd.c
@@ -7,12 +7,16 @@
7#include <errno.h> 7#include <errno.h>
8#endif /* HAVE_ERRNO_H */ 8#endif /* HAVE_ERRNO_H */
9 9
10#include <sys/time.h>
11
12#define WIN32_LEAN_AND_MEAN 10#define WIN32_LEAN_AND_MEAN
13#include <winsock2.h> 11#include <winsock2.h>
14#undef WIN32_LEAN_AND_MEAN 12#undef WIN32_LEAN_AND_MEAN
15 13
14# include <sys/time.h>
15
16#ifdef _MSC_VER
17# include <direct.h> /* for _getcwd */
18#endif
19
16#include "Evil.h" 20#include "Evil.h"
17#include "evil_private.h" 21#include "evil_private.h"
18 22
@@ -89,7 +93,7 @@ getpid(void)
89char * 93char *
90evil_getcwd(char *buffer, size_t size) 94evil_getcwd(char *buffer, size_t size)
91{ 95{
92#if defined(__CEGCC__) || defined(__MINGW32CE__) 96#ifdef _WIN32_WCE
93 wchar_t wpath[PATH_MAX]; 97 wchar_t wpath[PATH_MAX];
94 char *cpath; 98 char *cpath;
95 char *delim; 99 char *delim;
@@ -136,7 +140,7 @@ evil_getcwd(char *buffer, size_t size)
136 return buffer; 140 return buffer;
137#else 141#else
138 return _getcwd(buffer, size); 142 return _getcwd(buffer, size);
139#endif /* ! __CEGCC__ && ! __MINGW32CE__ */ 143#endif /* ! _WIN32_WCE */
140} 144}
141 145
142#if defined (_WIN32_WCE) && ! defined (__CEGCC__) 146#if defined (_WIN32_WCE) && ! defined (__CEGCC__)
diff --git a/legacy/evil/src/lib/evil_unistd.h b/legacy/evil/src/lib/evil_unistd.h
index 0e494c6a8c..4d558a5b2e 100644
--- a/legacy/evil/src/lib/evil_unistd.h
+++ b/legacy/evil/src/lib/evil_unistd.h
@@ -149,6 +149,7 @@ EAPI int evil_stat(const char *file_name, struct stat *st);
149 */ 149 */
150EAPI char *evil_getcwd(char *buffer, size_t size); 150EAPI char *evil_getcwd(char *buffer, size_t size);
151 151
152#define getcwd(b,s) evil_getcwd((b),(s))
152 153
153/* 154/*
154 * Sockets and pipe related functions 155 * Sockets and pipe related functions