summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/Evil.h28
-rw-r--r--src/lib/evil/evil_dlfcn.c11
-rw-r--r--src/lib/evil/evil_fcntl.c3
-rw-r--r--src/lib/evil/evil_langinfo.c3
-rw-r--r--src/lib/evil/evil_locale.c9
-rw-r--r--src/lib/evil/evil_macro.h27
-rw-r--r--src/lib/evil/evil_macro_pop.h8
-rw-r--r--src/lib/evil/evil_main.c9
-rw-r--r--src/lib/evil/evil_mman.c8
-rw-r--r--src/lib/evil/evil_private.h49
-rw-r--r--src/lib/evil/evil_pwd.c2
-rw-r--r--src/lib/evil/evil_stdio.c8
-rw-r--r--src/lib/evil/evil_stdlib.c12
-rw-r--r--src/lib/evil/evil_string.c3
-rw-r--r--src/lib/evil/evil_time.c3
-rw-r--r--src/lib/evil/evil_unistd.c3
-rw-r--r--src/lib/evil/evil_util.c9
-rw-r--r--src/lib/evil/meson.build2
-rw-r--r--src/lib/evil/sys/mman.h17
19 files changed, 76 insertions, 138 deletions
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index e09e261..7383fe7 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -94,15 +94,6 @@ extern "C" {
94#endif 94#endif
95 95
96 96
97#ifndef WIN32_LEAN_AND_MEAN
98# define WIN32_LEAN_AND_MEAN
99#endif
100#include <windows.h>
101#undef WIN32_LEAN_AND_MEAN
102
103#include <sys/stat.h> /* for mkdir in evil_macro_wrapper */
104
105
106typedef unsigned long uid_t; 97typedef unsigned long uid_t;
107typedef unsigned long gid_t; 98typedef unsigned long gid_t;
108 99
@@ -117,20 +108,6 @@ typedef unsigned short mode_t;
117# define strdup(str) _strdup(str) 108# define strdup(str) _strdup(str)
118#endif 109#endif
119 110
120
121#include "evil_macro.h"
122#include "evil_dlfcn.h"
123#include "evil_fcntl.h"
124#include "evil_langinfo.h"
125#include "evil_locale.h"
126#include "evil_main.h"
127#include "evil_stdlib.h"
128#include "evil_stdio.h"
129#include "evil_string.h"
130#include "evil_time.h"
131#include "evil_unistd.h"
132#include "evil_util.h"
133
134#ifndef S_ISDIR 111#ifndef S_ISDIR
135# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) 112# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
136#endif 113#endif
@@ -177,10 +154,7 @@ typedef unsigned short mode_t;
177#define _S_IWUSR _S_IWRITE 154#define _S_IWUSR _S_IWRITE
178#define _S_IRUSR _S_IREAD 155#define _S_IRUSR _S_IREAD
179 156
180#define sigsetjmp(Env, Save) setjmp(Env) 157#include "evil_private.h"
181
182#include "evil_macro_wrapper.h"
183#include "evil_macro_pop.h"
184 158
185#ifdef __cplusplus 159#ifdef __cplusplus
186} 160}
diff --git a/src/lib/evil/evil_dlfcn.c b/src/lib/evil/evil_dlfcn.c
index 1a7db5e..ef161cc 100644
--- a/src/lib/evil/evil_dlfcn.c
+++ b/src/lib/evil/evil_dlfcn.c
@@ -4,19 +4,10 @@
4 4
5#include <stdlib.h> 5#include <stdlib.h>
6 6
7#ifndef WIN32_LEAN_AND_MEAN 7#include "evil_private.h"
8# define WIN32_LEAN_AND_MEAN
9#endif
10#include <windows.h>
11#undef WIN32_LEAN_AND_MEAN
12 8
13#include <psapi.h> /* EnumProcessModules(Ex) */ 9#include <psapi.h> /* EnumProcessModules(Ex) */
14 10
15#include "evil_macro.h"
16#include "evil_util.h"
17#include "evil_dlfcn.h"
18#include "evil_private.h"
19
20 11
21static char *_dl_err = NULL; 12static char *_dl_err = NULL;
22static int _dl_err_viewed = 0; 13static int _dl_err_viewed = 0;
diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c
index e222f2b..dd23b7b 100644
--- a/src/lib/evil/evil_fcntl.c
+++ b/src/lib/evil/evil_fcntl.c
@@ -8,8 +8,7 @@
8#include <winsock2.h> /* for ioctlsocket */ 8#include <winsock2.h> /* for ioctlsocket */
9#include <io.h> 9#include <io.h>
10 10
11#include "evil_macro.h" 11#include "evil_private.h"
12#include "evil_fcntl.h"
13 12
14/* SOCKET is defined as a uintptr_t, so passing a fd (int) is not a problem */ 13/* SOCKET is defined as a uintptr_t, so passing a fd (int) is not a problem */
15static int 14static int
diff --git a/src/lib/evil/evil_langinfo.c b/src/lib/evil/evil_langinfo.c
index 25a863a..5e0a344 100644
--- a/src/lib/evil/evil_langinfo.c
+++ b/src/lib/evil/evil_langinfo.c
@@ -5,8 +5,7 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <string.h> 6#include <string.h>
7 7
8#include "evil_macro.h" 8#include "evil_private.h"
9#include "evil_langinfo.h"
10 9
11 10
12static char * 11static char *
diff --git a/src/lib/evil/evil_locale.c b/src/lib/evil/evil_locale.c
index 0a28a5e..a4d056a 100644
--- a/src/lib/evil/evil_locale.c
+++ b/src/lib/evil/evil_locale.c
@@ -6,14 +6,7 @@
6#include <locale.h> 6#include <locale.h>
7#include <errno.h> 7#include <errno.h>
8 8
9#ifndef WIN32_LEAN_AND_MEAN 9#include "evil_private.h"
10# define WIN32_LEAN_AND_MEAN
11#endif
12#include <windows.h>
13#undef WIN32_LEAN_AND_MEAN
14
15#include "evil_macro.h"
16#include "evil_locale.h"
17 10
18/* 11/*
19 * LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME need at least a buffer 12 * LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME need at least a buffer
diff --git a/src/lib/evil/evil_macro.h b/src/lib/evil/evil_macro.h
deleted file mode 100644
index 88cec3d..0000000
--- a/src/lib/evil/evil_macro.h
+++ /dev/null
@@ -1,27 +0,0 @@
1#ifndef __EVIL_MACRO_H__
2#define __EVIL_MACRO_H__
3
4#if _WIN32_WINNT < 0x0600
5# error Windows XP not supported anymore
6#endif
7
8#ifdef EAPI
9# undef EAPI
10#endif
11
12#ifdef EFL_BUILD
13# ifdef DLL_EXPORT
14# define EAPI __declspec(dllexport)
15# else
16# define EAPI
17# endif
18#else
19# define EAPI __declspec(dllimport)
20#endif
21
22
23#ifndef PATH_MAX
24# define PATH_MAX MAX_PATH
25#endif
26
27#endif /* __EVIL_MACRO_H__ */
diff --git a/src/lib/evil/evil_macro_pop.h b/src/lib/evil/evil_macro_pop.h
deleted file mode 100644
index 0fb9122..0000000
--- a/src/lib/evil/evil_macro_pop.h
+++ /dev/null
@@ -1,8 +0,0 @@
1#ifndef __EVIL_MACRO_POP_H__
2#define __EVIL_MACRO_POP_H__
3
4#undef EAPI
5#define EAPI
6
7
8#endif /* __EVIL_MACRO_POP_H__ */
diff --git a/src/lib/evil/evil_main.c b/src/lib/evil/evil_main.c
index 875d6c5..07dcd4a 100644
--- a/src/lib/evil/evil_main.c
+++ b/src/lib/evil/evil_main.c
@@ -4,15 +4,6 @@
4 4
5#include <stdio.h> 5#include <stdio.h>
6 6
7#ifndef WIN32_LEAN_AND_MEAN
8# define WIN32_LEAN_AND_MEAN
9#endif
10#include <winsock2.h>
11#undef WIN32_LEAN_AND_MEAN
12
13#include "evil_macro.h"
14#include "evil_unistd.h"
15#include "evil_main.h"
16#include "evil_private.h" 7#include "evil_private.h"
17 8
18 9
diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c
index 3f632e5..83b9ee7 100644
--- a/src/lib/evil/evil_mman.c
+++ b/src/lib/evil/evil_mman.c
@@ -7,17 +7,9 @@
7#include <sys/types.h> 7#include <sys/types.h>
8#include <unistd.h> 8#include <unistd.h>
9 9
10#ifndef WIN32_LEAN_AND_MEAN
11# define WIN32_LEAN_AND_MEAN
12#endif
13#include <windows.h>
14#undef WIN32_LEAN_AND_MEAN
15
16#include <io.h> 10#include <io.h>
17 11
18#include "evil_macro.h"
19#include "sys/mman.h" 12#include "sys/mman.h"
20#include "evil_util.h"
21#include "evil_private.h" 13#include "evil_private.h"
22 14
23 15
diff --git a/src/lib/evil/evil_private.h b/src/lib/evil/evil_private.h
index 560b4e2..a88572b 100644
--- a/src/lib/evil/evil_private.h
+++ b/src/lib/evil/evil_private.h
@@ -1,6 +1,9 @@
1#ifndef __EVIL_PRIVATE_H__ 1#ifndef __EVIL_PRIVATE_H__
2#define __EVIL_PRIVATE_H__ 2#define __EVIL_PRIVATE_H__
3 3
4#if _WIN32_WINNT < 0x0600
5# error Windows XP not supported anymore
6#endif
4 7
5#ifdef __cplusplus 8#ifdef __cplusplus
6extern "C" { 9extern "C" {
@@ -14,6 +17,52 @@ extern "C" {
14# endif 17# endif
15#endif 18#endif
16 19
20#ifndef WIN32_LEAN_AND_MEAN
21# define WIN32_LEAN_AND_MEAN
22#endif
23#include <windows.h>
24#undef WIN32_LEAN_AND_MEAN
25
26#include <sys/stat.h> /* for mkdir in evil_macro_wrapper */
27
28
29#ifdef EAPI
30# undef EAPI
31#endif
32
33#ifdef EFL_BUILD
34# ifdef DLL_EXPORT
35# define EAPI __declspec(dllexport)
36# else
37# define EAPI
38# endif
39#else
40# define EAPI __declspec(dllimport)
41#endif
42
43#ifndef PATH_MAX
44# define PATH_MAX MAX_PATH
45#endif
46
47#include "evil_dlfcn.h"
48#include "evil_fcntl.h"
49#include "evil_langinfo.h"
50#include "evil_locale.h"
51#include "evil_main.h"
52#include "evil_stdlib.h"
53#include "evil_stdio.h"
54#include "evil_string.h"
55#include "evil_time.h"
56#include "evil_unistd.h"
57#include "evil_util.h"
58
59#define sigsetjmp(Env, Save) setjmp(Env)
60
61#include "evil_macro_wrapper.h"
62
63#undef EAPI
64#define EAPI
65
17#ifdef __cplusplus 66#ifdef __cplusplus
18} 67}
19#endif 68#endif
diff --git a/src/lib/evil/evil_pwd.c b/src/lib/evil/evil_pwd.c
index 841c106..03e7414 100644
--- a/src/lib/evil/evil_pwd.c
+++ b/src/lib/evil/evil_pwd.c
@@ -9,7 +9,7 @@
9#include <io.h> 9#include <io.h>
10#include <lmcons.h> 10#include <lmcons.h>
11 11
12#include "evil_macro.h" 12#include "evil_private.h"
13#include "pwd.h" 13#include "pwd.h"
14 14
15 15
diff --git a/src/lib/evil/evil_stdio.c b/src/lib/evil/evil_stdio.c
index 6b71e92..61afe7c 100644
--- a/src/lib/evil/evil_stdio.c
+++ b/src/lib/evil/evil_stdio.c
@@ -5,14 +5,6 @@
5#include <sys/types.h> 5#include <sys/types.h>
6#include <direct.h> 6#include <direct.h>
7 7
8#ifndef WIN32_LEAN_AND_MEAN
9# define WIN32_LEAN_AND_MEAN
10#endif
11#include <windows.h>
12#undef WIN32_LEAN_AND_MEAN
13
14#include "evil_macro.h"
15#include "evil_stdio.h"
16#include "evil_private.h" 8#include "evil_private.h"
17 9
18#undef rename 10#undef rename
diff --git a/src/lib/evil/evil_stdlib.c b/src/lib/evil/evil_stdlib.c
index b03625a..d6de5a4 100644
--- a/src/lib/evil/evil_stdlib.c
+++ b/src/lib/evil/evil_stdlib.c
@@ -5,20 +5,14 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <stdio.h> 6#include <stdio.h>
7#include <io.h> 7#include <io.h>
8#include <direct.h>
8#include <fcntl.h> 9#include <fcntl.h>
9#include <sys/stat.h> 10#include <sys/stat.h>
10#include <sys/types.h> 11#include <sys/types.h>
11 12
12#include <errno.h> 13#include <errno.h>
13 14
14#ifndef WIN32_LEAN_AND_MEAN 15#include "evil_private.h"
15# define WIN32_LEAN_AND_MEAN
16#endif
17#include <windows.h>
18#undef WIN32_LEAN_AND_MEAN
19
20#include "evil_macro.h"
21#include "evil_stdlib.h"
22 16
23/* 17/*
24 * Environment variable related functions 18 * Environment variable related functions
@@ -146,7 +140,7 @@ mkdtemp(char *__template)
146 { 140 {
147 val = _mkstemp(suffix, val); 141 val = _mkstemp(suffix, val);
148 142
149 if (mkdir(__template) == 0) 143 if (_mkdir(__template) == 0)
150 return __template; 144 return __template;
151 145
152 if (errno == EFAULT || 146 if (errno == EFAULT ||
diff --git a/src/lib/evil/evil_string.c b/src/lib/evil/evil_string.c
index 3620ce5..d135454 100644
--- a/src/lib/evil/evil_string.c
+++ b/src/lib/evil/evil_string.c
@@ -6,8 +6,7 @@
6#include <string.h> 6#include <string.h>
7#include <ctype.h> 7#include <ctype.h>
8 8
9#include "evil_macro.h" 9#include "evil_private.h"
10#include "evil_string.h"
11 10
12 11
13/* 12/*
diff --git a/src/lib/evil/evil_time.c b/src/lib/evil/evil_time.c
index 90b6369..32cfc2c 100644
--- a/src/lib/evil/evil_time.c
+++ b/src/lib/evil/evil_time.c
@@ -7,9 +7,6 @@
7#include <ctype.h> 7#include <ctype.h>
8#include <time.h> 8#include <time.h>
9 9
10#include "evil_macro.h"
11#include "evil_time.h"
12#include "evil_macro_wrapper.h"
13#include "evil_private.h" 10#include "evil_private.h"
14 11
15/* 12/*
diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c
index 765c7aa..3eebf97 100644
--- a/src/lib/evil/evil_unistd.c
+++ b/src/lib/evil/evil_unistd.c
@@ -12,8 +12,7 @@
12#include <winsock2.h> 12#include <winsock2.h>
13#undef WIN32_LEAN_AND_MEAN 13#undef WIN32_LEAN_AND_MEAN
14 14
15#include "evil_macro.h" 15#include "evil_private.h"
16#include "evil_unistd.h"
17 16
18 17
19LONGLONG _evil_time_freq; 18LONGLONG _evil_time_freq;
diff --git a/src/lib/evil/evil_util.c b/src/lib/evil/evil_util.c
index 7add78f..c045bf3 100644
--- a/src/lib/evil/evil_util.c
+++ b/src/lib/evil/evil_util.c
@@ -8,14 +8,7 @@
8#include <limits.h> 8#include <limits.h>
9#include <wchar.h> 9#include <wchar.h>
10 10
11#ifndef WIN32_LEAN_AND_MEAN 11#include "evil_private.h"
12# define WIN32_LEAN_AND_MEAN
13#endif
14#include <windows.h>
15#undef WIN32_LEAN_AND_MEAN
16
17#include "evil_macro.h"
18#include "evil_util.h"
19 12
20DWORD _evil_tls_index; 13DWORD _evil_tls_index;
21 14
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
index db2871c..8ed266c 100644
--- a/src/lib/evil/meson.build
+++ b/src/lib/evil/meson.build
@@ -7,8 +7,6 @@ if target_machine.system() == 'windows'
7 'evil_fcntl.h', 7 'evil_fcntl.h',
8 'evil_langinfo.h', 8 'evil_langinfo.h',
9 'evil_locale.h', 9 'evil_locale.h',
10 'evil_macro.h',
11 'evil_macro_pop.h',
12 'evil_macro_wrapper.h', 10 'evil_macro_wrapper.h',
13 'evil_main.h', 11 'evil_main.h',
14 'evil_stdio.h', 12 'evil_stdio.h',
diff --git a/src/lib/evil/sys/mman.h b/src/lib/evil/sys/mman.h
index 93b6bd4..15f176a 100644
--- a/src/lib/evil/sys/mman.h
+++ b/src/lib/evil/sys/mman.h
@@ -3,7 +3,19 @@
3 3
4#include <sys/types.h> 4#include <sys/types.h>
5 5
6#include <evil_macro.h> 6#ifdef EAPI
7# undef EAPI
8#endif
9
10#ifdef EFL_BUILD
11# ifdef DLL_EXPORT
12# define EAPI __declspec(dllexport)
13# else
14# define EAPI
15# endif
16#else
17# define EAPI __declspec(dllimport)
18#endif
7 19
8 20
9#ifdef __cplusplus 21#ifdef __cplusplus
@@ -148,7 +160,8 @@ EAPI int munmap(void *addr,
148#endif 160#endif
149 161
150 162
151#include <evil_macro_pop.h> 163#undef EAPI
164#define EAPI
152 165
153 166
154#endif /* __EVIL_SYS_MMAN_H__ */ 167#endif /* __EVIL_SYS_MMAN_H__ */