summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-05-02 23:29:08 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 22:11:44 -0300
commit3c1425c23e4f1311f55421d540f798ab0b495a9c (patch)
tree443476102cac9c786495a3209d19a77cfce0e945
parenta5caa53f8f351c9ccfaecf10d8aa2be3777df2a6 (diff)
windows: Replace EAPI with EVIL_API in evil library
-rw-r--r--src/lib/evil/evil_api.h24
-rw-r--r--src/lib/evil/evil_dlfcn.h14
-rw-r--r--src/lib/evil/evil_eapi.h18
-rw-r--r--src/lib/evil/evil_fcntl.c4
-rw-r--r--src/lib/evil/evil_fcntl.h2
-rw-r--r--src/lib/evil/evil_langinfo.h2
-rw-r--r--src/lib/evil/evil_locale.c24
-rw-r--r--src/lib/evil/evil_locale.h2
-rw-r--r--src/lib/evil/evil_main.h4
-rw-r--r--src/lib/evil/evil_mman.h6
-rw-r--r--src/lib/evil/evil_private.h13
-rw-r--r--src/lib/evil/evil_stdio.c1
-rw-r--r--src/lib/evil/evil_stdio.h5
-rw-r--r--src/lib/evil/evil_stdlib.c2
-rw-r--r--src/lib/evil/evil_stdlib.h12
-rw-r--r--src/lib/evil/evil_string.h4
-rw-r--r--src/lib/evil/evil_time.h2
-rw-r--r--src/lib/evil/evil_unistd.c18
-rw-r--r--src/lib/evil/evil_unistd.h10
-rw-r--r--src/lib/evil/evil_util.h14
-rw-r--r--src/lib/evil/evil_windows.h11
-rw-r--r--src/lib/evil/meson.build2
-rw-r--r--src/lib/evil/unposix/limits.h15
-rw-r--r--src/lib/evil/unposix/sys/stat.h7
-rw-r--r--src/lib/evil/unposix/sys/time.h2
25 files changed, 104 insertions, 114 deletions
diff --git a/src/lib/evil/evil_api.h b/src/lib/evil/evil_api.h
new file mode 100644
index 0000000000..673bb1d2d0
--- /dev/null
+++ b/src/lib/evil/evil_api.h
@@ -0,0 +1,24 @@
1#ifndef EVIL_API_H
2#define EVIL_API_H
3
4#ifdef EVIL_API
5#error EVIL_API cant be already defined
6#endif
7
8#ifdef _MSC_VER
9# ifndef EVIL_DLL
10# define EVIL_API
11# elif defined(EVIL_BUILD)
12# define EVIL_API __declspec(dllexport)
13# else
14# define EVIL_API __declspec(dllimport)
15# endif
16#else
17# if __GNUC__ >= 4
18# define EVIL_API __attribute__ ((visibility("default")))
19# else
20# define EVIL_API
21# endif
22#endif
23
24#endif
diff --git a/src/lib/evil/evil_dlfcn.h b/src/lib/evil/evil_dlfcn.h
index 22f48b72ca..a55d591443 100644
--- a/src/lib/evil/evil_dlfcn.h
+++ b/src/lib/evil/evil_dlfcn.h
@@ -2,6 +2,7 @@
2#define __EVIL_DLFCN_H__ 2#define __EVIL_DLFCN_H__
3 3
4 4
5#include "evil_api.h"
5#include <limits.h> 6#include <limits.h>
6 7
7 8
@@ -142,7 +143,8 @@ struct Dl_info
142 * 143 *
143 * @ingroup Evil_Dlfcn 144 * @ingroup Evil_Dlfcn
144 */ 145 */
145EAPI void *dlopen(const char* path, int mode); 146EVIL_API void *dlopen(const char* path, int mode);
147
146#ifndef HAVE_DLOPEN 148#ifndef HAVE_DLOPEN
147# define HAVE_DLOPEN 1 149# define HAVE_DLOPEN 1
148#endif 150#endif
@@ -168,7 +170,7 @@ EAPI void *dlopen(const char* path, int mode);
168 * 170 *
169 * @ingroup Evil_Dlfcn 171 * @ingroup Evil_Dlfcn
170 */ 172 */
171EAPI int dlclose(void* handle); 173EVIL_API int dlclose(void* handle);
172 174
173/** 175/**
174 * @brief Get the address of a symbol. 176 * @brief Get the address of a symbol.
@@ -192,7 +194,8 @@ EAPI int dlclose(void* handle);
192 * 194 *
193 * @ingroup Evil_Dlfcn 195 * @ingroup Evil_Dlfcn
194 */ 196 */
195EAPI void *dlsym(void* handle, const char* symbol); 197EVIL_API void *dlsym(void* handle, const char* symbol);
198
196#ifndef HAVE_DLSYM 199#ifndef HAVE_DLSYM
197#define HAVE_DLSYM 1 200#define HAVE_DLSYM 1
198#endif 201#endif
@@ -221,7 +224,8 @@ EAPI void *dlsym(void* handle, const char* symbol);
221 * 224 *
222 * @ingroup Evil_Dlfcn 225 * @ingroup Evil_Dlfcn
223 */ 226 */
224EAPI int dladdr (const void *addr, Dl_info *info); 227EVIL_API int dladdr(const void *addr, Dl_info *info);
228
225#ifndef HAVE_DLADDR 229#ifndef HAVE_DLADDR
226#define HAVE_DLADDR 1 230#define HAVE_DLADDR 1
227#endif 231#endif
@@ -248,7 +252,7 @@ EAPI int dladdr (const void *addr, Dl_info *info);
248 * 252 *
249 * @ingroup Evil_Dlfcn 253 * @ingroup Evil_Dlfcn
250 */ 254 */
251EAPI char *dlerror (void); 255EVIL_API char *dlerror(void);
252 256
253 257
254#endif /* __EVIL_DLFCN_H__ */ 258#endif /* __EVIL_DLFCN_H__ */
diff --git a/src/lib/evil/evil_eapi.h b/src/lib/evil/evil_eapi.h
deleted file mode 100644
index 2ee7f8466c..0000000000
--- a/src/lib/evil/evil_eapi.h
+++ /dev/null
@@ -1,18 +0,0 @@
1#ifndef EVIL_EAPI
2#define EVIL_EAPI
3
4#ifdef EAPI
5# undef EAPI
6#endif
7
8#ifdef EFL_BUILD
9# ifdef DLL_EXPORT
10# define EAPI __declspec(dllexport)
11# else
12# define EAPI
13# endif
14#else
15# define EAPI __declspec(dllimport)
16#endif
17
18#endif
diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c
index dd23b7b838..eabfeed046 100644
--- a/src/lib/evil/evil_fcntl.c
+++ b/src/lib/evil/evil_fcntl.c
@@ -2,6 +2,8 @@
2# include "config.h" 2# include "config.h"
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include <define_lean_and_mean.h>
6
5#include <stdio.h> 7#include <stdio.h>
6#include <sys/locking.h> 8#include <sys/locking.h>
7 9
@@ -10,6 +12,8 @@
10 12
11#include "evil_private.h" 13#include "evil_private.h"
12 14
15#include <undefine_lean_and_mean.h>
16
13/* SOCKET is defined as a uintptr_t, so passing a fd (int) is not a problem */ 17/* SOCKET is defined as a uintptr_t, so passing a fd (int) is not a problem */
14static int 18static int
15_is_socket(SOCKET s) 19_is_socket(SOCKET s)
diff --git a/src/lib/evil/evil_fcntl.h b/src/lib/evil/evil_fcntl.h
index 8f97c88559..434d2cef88 100644
--- a/src/lib/evil/evil_fcntl.h
+++ b/src/lib/evil/evil_fcntl.h
@@ -107,7 +107,7 @@ struct flock
107 * 107 *
108 * @ingroup Evil 108 * @ingroup Evil
109 */ 109 */
110EAPI int fcntl(int fd, int cmd, ...); 110EVIL_API int fcntl(int fd, int cmd, ...);
111 111
112 112
113#endif /* __EVIL_FCNTL_H__ */ 113#endif /* __EVIL_FCNTL_H__ */
diff --git a/src/lib/evil/evil_langinfo.h b/src/lib/evil/evil_langinfo.h
index b9f35029a4..26dc14d047 100644
--- a/src/lib/evil/evil_langinfo.h
+++ b/src/lib/evil/evil_langinfo.h
@@ -39,7 +39,7 @@ enum {
39# define CODESET _NL_CTYPE_CODESET 39# define CODESET _NL_CTYPE_CODESET
40# define RADIXCHAR _NL_NUMERIC_RADIXCHAR 40# define RADIXCHAR _NL_NUMERIC_RADIXCHAR
41 41
42EAPI char *nl_langinfo(nl_item index); 42EVIL_API char *nl_langinfo(nl_item index);
43 43
44 44
45#endif /*__EVIL_LANGINFO_H__ */ 45#endif /*__EVIL_LANGINFO_H__ */
diff --git a/src/lib/evil/evil_locale.c b/src/lib/evil/evil_locale.c
index 15610da6a6..fc14703e80 100644
--- a/src/lib/evil/evil_locale.c
+++ b/src/lib/evil/evil_locale.c
@@ -2,31 +2,13 @@
2# include "config.h" 2# include "config.h"
3#endif 3#endif
4 4
5#include "evil_private.h" /* LC_MESSAGES */
6
5#include <string.h> 7#include <string.h>
6#include <locale.h> 8#include <locale.h>
7#include <errno.h> 9#include <errno.h>
8 10
9#ifndef WIN32_LEAN_AND_MEAN 11#include <evil_windows.h>
10# define WIN32_LEAN_AND_MEAN
11#endif
12#include <windows.h>
13#undef WIN32_LEAN_AND_MEAN
14
15#ifdef EAPI
16# undef EAPI
17#endif
18
19#ifdef EFL_BUILD
20# ifdef DLL_EXPORT
21# define EAPI __declspec(dllexport)
22# else
23# define EAPI
24# endif
25#else
26# define EAPI __declspec(dllimport)
27#endif
28
29#include "evil_locale.h" /* LC_MESSAGES */
30 12
31/* 13/*
32 * LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME need at least a buffer 14 * LOCALE_SISO639LANGNAME and LOCALE_SISO3166CTRYNAME need at least a buffer
diff --git a/src/lib/evil/evil_locale.h b/src/lib/evil/evil_locale.h
index 6b12428428..87497bcfec 100644
--- a/src/lib/evil/evil_locale.h
+++ b/src/lib/evil/evil_locale.h
@@ -48,7 +48,7 @@
48 * 48 *
49 * @since 1.16 49 * @since 1.16
50 */ 50 */
51EAPI char *evil_setlocale(int category, const char *locale); 51EVIL_API char *evil_setlocale(int category, const char *locale);
52 52
53 53
54/** 54/**
diff --git a/src/lib/evil/evil_main.h b/src/lib/evil/evil_main.h
index 44b8356e4d..795daa19b0 100644
--- a/src/lib/evil/evil_main.h
+++ b/src/lib/evil/evil_main.h
@@ -100,7 +100,7 @@
100 * When Evil is not used anymore, call evil_shutdown() to shut down 100 * When Evil is not used anymore, call evil_shutdown() to shut down
101 * the Evil library. 101 * the Evil library.
102 */ 102 */
103EAPI int evil_init(void); 103EVIL_API int evil_init(void);
104 104
105/** 105/**
106 * @brief Shut down the Evil library. 106 * @brief Shut down the Evil library.
@@ -116,7 +116,7 @@ EAPI int evil_init(void);
116 * documentation anymore . You must call evil_init() again to use these 116 * documentation anymore . You must call evil_init() again to use these
117 * functions again. 117 * functions again.
118 */ 118 */
119EAPI int evil_shutdown(void); 119EVIL_API int evil_shutdown(void);
120 120
121 121
122/** 122/**
diff --git a/src/lib/evil/evil_mman.h b/src/lib/evil/evil_mman.h
index c9c57aa5e0..0e5452284f 100644
--- a/src/lib/evil/evil_mman.h
+++ b/src/lib/evil/evil_mman.h
@@ -107,7 +107,7 @@
107 * 107 *
108 * @ingroup Evil_Mman 108 * @ingroup Evil_Mman
109 */ 109 */
110EAPI void *mmap(void *addr, 110EVIL_API void *mmap(void *addr,
111 size_t len, 111 size_t len,
112 int prot, 112 int prot,
113 int flags, 113 int flags,
@@ -138,7 +138,7 @@ EAPI void *mmap(void *addr,
138 * 138 *
139 * @ingroup Evil_Mman 139 * @ingroup Evil_Mman
140 */ 140 */
141EAPI int munmap(void *addr, 141EVIL_API int munmap(void *addr,
142 size_t len); 142 size_t len);
143 143
144/** 144/**
@@ -159,7 +159,7 @@ EAPI int munmap(void *addr,
159 * 159 *
160 * @ingroup Evil_Mman 160 * @ingroup Evil_Mman
161 */ 161 */
162EAPI int mprotect(void *addr, size_t len, int prot); 162EVIL_API int mprotect(void *addr, size_t len, int prot);
163 163
164 164
165#endif /* __EVIL_SYS_MMAN_H__ */ 165#endif /* __EVIL_SYS_MMAN_H__ */
diff --git a/src/lib/evil/evil_private.h b/src/lib/evil/evil_private.h
index c9ba04a6b7..7a5b21f5df 100644
--- a/src/lib/evil/evil_private.h
+++ b/src/lib/evil/evil_private.h
@@ -21,16 +21,14 @@ extern "C" {
21#define EVIL_UNUSED 21#define EVIL_UNUSED
22#endif 22#endif
23 23
24#ifndef WIN32_LEAN_AND_MEAN 24#include <evil_windows.h>
25# define WIN32_LEAN_AND_MEAN
26#endif
27#include <windows.h>
28#undef WIN32_LEAN_AND_MEAN
29 25
26#include <stdint.h> /* for mode_t in */
30#include <sys/stat.h> /* for mkdir in evil_macro_wrapper */ 27#include <sys/stat.h> /* for mkdir in evil_macro_wrapper */
31 28
29#include <sys/types.h> /* for mode_t in */
32 30
33#include "evil_eapi.h" 31#include <evil_api.h>
34 32
35 33
36#ifndef PATH_MAX 34#ifndef PATH_MAX
@@ -54,9 +52,6 @@ extern "C" {
54 52
55#include "evil_macro_wrapper.h" 53#include "evil_macro_wrapper.h"
56 54
57#undef EAPI
58#define EAPI
59
60#ifdef __cplusplus 55#ifdef __cplusplus
61} 56}
62#endif 57#endif
diff --git a/src/lib/evil/evil_stdio.c b/src/lib/evil/evil_stdio.c
index 61afe7ce3b..d4879c8b4b 100644
--- a/src/lib/evil/evil_stdio.c
+++ b/src/lib/evil/evil_stdio.c
@@ -2,7 +2,6 @@
2# include "config.h" 2# include "config.h"
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include <sys/types.h>
6#include <direct.h> 5#include <direct.h>
7 6
8#include "evil_private.h" 7#include "evil_private.h"
diff --git a/src/lib/evil/evil_stdio.h b/src/lib/evil/evil_stdio.h
index 7032c4a2d0..cca7fc3ae1 100644
--- a/src/lib/evil/evil_stdio.h
+++ b/src/lib/evil/evil_stdio.h
@@ -1,6 +1,7 @@
1#ifndef __EVIL_STDIO_H__ 1#ifndef __EVIL_STDIO_H__
2#define __EVIL_STDIO_H__ 2#define __EVIL_STDIO_H__
3 3
4#include <sys/types.h>
4 5
5/** 6/**
6 * @file evil_stdio.h 7 * @file evil_stdio.h
@@ -41,7 +42,7 @@
41 * 42 *
42 * @since 1.8 43 * @since 1.8
43 */ 44 */
44EAPI int evil_rename(const char *src, const char *dst); 45EVIL_API int evil_rename(const char *src, const char *dst);
45 46
46#ifndef HAVE_CYGWIN 47#ifndef HAVE_CYGWIN
47typedef int mode_t; 48typedef int mode_t;
@@ -58,7 +59,7 @@ typedef int mode_t;
58 * 59 *
59 * @since 1.15 60 * @since 1.15
60 */ 61 */
61EAPI int evil_mkdir(const char *dirname, mode_t mode); 62EVIL_API int evil_mkdir(const char *dirname, mode_t mode);
62 63
63 64
64#endif /* __EVIL_STDIO_H__ */ 65#endif /* __EVIL_STDIO_H__ */
diff --git a/src/lib/evil/evil_stdlib.c b/src/lib/evil/evil_stdlib.c
index d6de5a4fcd..9b27d480bd 100644
--- a/src/lib/evil/evil_stdlib.c
+++ b/src/lib/evil/evil_stdlib.c
@@ -119,7 +119,7 @@ _mkstemp(char *suffix, int val)
119 return val; 119 return val;
120} 120}
121 121
122EAPI char * 122EVIL_API char *
123mkdtemp(char *__template) 123mkdtemp(char *__template)
124{ 124{
125 char *suffix; 125 char *suffix;
diff --git a/src/lib/evil/evil_stdlib.h b/src/lib/evil/evil_stdlib.h
index 1a9e5fc7a9..86e85301e3 100644
--- a/src/lib/evil/evil_stdlib.h
+++ b/src/lib/evil/evil_stdlib.h
@@ -1,7 +1,7 @@
1#ifndef __EVIL_STDLIB_H__ 1#ifndef __EVIL_STDLIB_H__
2#define __EVIL_STDLIB_H__ 2#define __EVIL_STDLIB_H__
3 3
4#include <evil_private.h> 4#include "evil_api.h"
5 5
6/** 6/**
7 * @file evil_stdlib.h 7 * @file evil_stdlib.h
@@ -41,7 +41,7 @@
41 * 41 *
42 * Supported OS: Windows XP. 42 * Supported OS: Windows XP.
43 */ 43 */
44EAPI int setenv(const char *name, 44EVIL_API int setenv(const char *name,
45 const char *value, 45 const char *value,
46 int overwrite); 46 int overwrite);
47 47
@@ -60,7 +60,7 @@ EAPI int setenv(const char *name,
60 * 60 *
61 * Supported OS: Windows XP. 61 * Supported OS: Windows XP.
62 */ 62 */
63EAPI int unsetenv(const char *name); 63EVIL_API int unsetenv(const char *name);
64 64
65 65
66/* 66/*
@@ -73,7 +73,7 @@ EAPI int unsetenv(const char *name);
73 * 73 *
74 * @since 1.8.0 74 * @since 1.8.0
75 */ 75 */
76EAPI char *mkdtemp(char *__template); 76EVIL_API char *mkdtemp(char *__template);
77 77
78/** 78/**
79 * @brief Create a unique temporary file name with a suffix. 79 * @brief Create a unique temporary file name with a suffix.
@@ -84,7 +84,7 @@ EAPI char *mkdtemp(char *__template);
84 * 84 *
85 * @since 1.10.0 85 * @since 1.10.0
86 */ 86 */
87EAPI int mkstemps(char *__template, int suffixlen); 87EVIL_API int mkstemps(char *__template, int suffixlen);
88 88
89/** 89/**
90 * @brief Return an absolute or full path name for a specified relative path name. 90 * @brief Return an absolute or full path name for a specified relative path name.
@@ -115,7 +115,7 @@ EAPI int mkstemps(char *__template, int suffixlen);
115 * 115 *
116 * Supported OS: Windows XP. 116 * Supported OS: Windows XP.
117 */ 117 */
118EAPI char *realpath(const char *file_name, char *resolved_name); 118EVIL_API char *realpath(const char *file_name, char *resolved_name);
119#ifndef HAVE_REALPATH 119#ifndef HAVE_REALPATH
120# define HAVE_REALPATH 1 120# define HAVE_REALPATH 1
121#endif 121#endif
diff --git a/src/lib/evil/evil_string.h b/src/lib/evil/evil_string.h
index 872834f238..7bf08cd4ba 100644
--- a/src/lib/evil/evil_string.h
+++ b/src/lib/evil/evil_string.h
@@ -35,7 +35,7 @@
35 * 35 *
36 * Supported OS: Windows XP. 36 * Supported OS: Windows XP.
37 */ 37 */
38EAPI char *strcasestr(const char *haystack, const char *needle); 38EVIL_API char *strcasestr(const char *haystack, const char *needle);
39 39
40/** 40/**
41 * @brief Implements the strsep function which is used to separate strings. 41 * @brief Implements the strsep function which is used to separate strings.
@@ -61,6 +61,6 @@ EAPI char *strcasestr(const char *haystack, const char *needle);
61 * @since 1.8 61 * @since 1.8
62 * 62 *
63 */ 63 */
64EAPI char *strsep(char **stringp, const char *delim); 64EVIL_API char *strsep(char **stringp, const char *delim);
65 65
66#endif /* __EVIL_STRING_H__ */ 66#endif /* __EVIL_STRING_H__ */
diff --git a/src/lib/evil/evil_time.h b/src/lib/evil/evil_time.h
index 42004144a2..878ef5dd98 100644
--- a/src/lib/evil/evil_time.h
+++ b/src/lib/evil/evil_time.h
@@ -34,7 +34,7 @@
34 * 34 *
35 * Supported OS: Windows XP. 35 * Supported OS: Windows XP.
36 */ 36 */
37EAPI char *strptime(const char *buf, const char *fmt, struct tm *tm); 37EVIL_API char *strptime(const char *buf, const char *fmt, struct tm *tm);
38 38
39 39
40/** 40/**
diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c
index 3eebf97e1e..2b596798ed 100644
--- a/src/lib/evil/evil_unistd.c
+++ b/src/lib/evil/evil_unistd.c
@@ -2,18 +2,18 @@
2# include "config.h" 2# include "config.h"
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include "evil_private.h"
6
7#include <define_lean_and_mean.h>
5#include <errno.h> 8#include <errno.h>
9#include <define_lean_and_mean.h>
6#include <direct.h> 10#include <direct.h>
7# include <sys/time.h> 11#include <define_lean_and_mean.h>
8 12#include <sys/time.h>
9#ifndef WIN32_LEAN_AND_MEAN
10# define WIN32_LEAN_AND_MEAN
11#endif
12#include <winsock2.h>
13#undef WIN32_LEAN_AND_MEAN
14
15#include "evil_private.h"
16 13
14#include <define_lean_and_mean.h>
15//#include <winsock2.h>
16#include <undefine_lean_and_mean.h>
17 17
18LONGLONG _evil_time_freq; 18LONGLONG _evil_time_freq;
19LONGLONG _evil_time_count; 19LONGLONG _evil_time_count;
diff --git a/src/lib/evil/evil_unistd.h b/src/lib/evil/evil_unistd.h
index d738a720b7..6f58ec9b7a 100644
--- a/src/lib/evil/evil_unistd.h
+++ b/src/lib/evil/evil_unistd.h
@@ -1,7 +1,7 @@
1#ifndef __EVIL_UNISTD_H__ 1#ifndef __EVIL_UNISTD_H__
2#define __EVIL_UNISTD_H__ 2#define __EVIL_UNISTD_H__
3 3
4#include "evil_eapi.h" 4#include "evil_api.h"
5 5
6/** 6/**
7 * @file evil_unistd.h 7 * @file evil_unistd.h
@@ -35,7 +35,7 @@
35 * 35 *
36 * Supported OS: Windows XP. 36 * Supported OS: Windows XP.
37 */ 37 */
38EAPI double evil_time_get(void); 38EVIL_API double evil_time_get(void);
39 39
40/* 40/*
41 * Sockets and pipe related functions 41 * Sockets and pipe related functions
@@ -54,7 +54,7 @@ EAPI double evil_time_get(void);
54 * 54 *
55 * Supported OS: Windows XP. 55 * Supported OS: Windows XP.
56 */ 56 */
57EAPI int evil_sockets_init(void); 57EVIL_API int evil_sockets_init(void);
58 58
59/** 59/**
60 * @brief Shutdown the Windows socket system. 60 * @brief Shutdown the Windows socket system.
@@ -65,7 +65,7 @@ EAPI int evil_sockets_init(void);
65 * 65 *
66 * Supported OS: Windows XP. 66 * Supported OS: Windows XP.
67 */ 67 */
68EAPI void evil_sockets_shutdown(void); 68EVIL_API void evil_sockets_shutdown(void);
69 69
70/** 70/**
71 * @brief Create a pair of sockets. 71 * @brief Create a pair of sockets.
@@ -81,7 +81,7 @@ EAPI void evil_sockets_shutdown(void);
81 * 81 *
82 * Supported OS: Windows XP. 82 * Supported OS: Windows XP.
83 */ 83 */
84EAPI int evil_pipe(int *fds); 84EVIL_API int evil_pipe(int *fds);
85 85
86 86
87/** 87/**
diff --git a/src/lib/evil/evil_util.h b/src/lib/evil/evil_util.h
index 55b42f6823..4d7db43b3f 100644
--- a/src/lib/evil/evil_util.h
+++ b/src/lib/evil/evil_util.h
@@ -19,7 +19,7 @@
19 * 19 *
20 * @ingroup Evil 20 * @ingroup Evil
21 */ 21 */
22EAPI wchar_t *evil_char_to_wchar(const char *text); 22EVIL_API wchar_t *evil_char_to_wchar(const char *text);
23 23
24/** 24/**
25 * @brief Convert a string from wchar_t * to char *. 25 * @brief Convert a string from wchar_t * to char *.
@@ -38,7 +38,7 @@ EAPI wchar_t *evil_char_to_wchar(const char *text);
38 * 38 *
39 * @ingroup Evil 39 * @ingroup Evil
40 */ 40 */
41EAPI char *evil_wchar_to_char(const wchar_t *text); 41EVIL_API char *evil_wchar_to_char(const wchar_t *text);
42 42
43/** 43/**
44 * @brief Convert a string from UTF-16 to UTF-8. 44 * @brief Convert a string from UTF-16 to UTF-8.
@@ -57,7 +57,7 @@ EAPI char *evil_wchar_to_char(const wchar_t *text);
57 * 57 *
58 * @ingroup Evil 58 * @ingroup Evil
59 */ 59 */
60EAPI char *evil_utf16_to_utf8(const wchar_t *text); 60EVIL_API char *evil_utf16_to_utf8(const wchar_t *text);
61 61
62/** 62/**
63 * @brief Convert a string from UTF-8 to UTF-16. 63 * @brief Convert a string from UTF-8 to UTF-16.
@@ -75,11 +75,11 @@ EAPI char *evil_utf16_to_utf8(const wchar_t *text);
75 * 75 *
76 * @ingroup Evil 76 * @ingroup Evil
77 */ 77 */
78EAPI wchar_t *evil_utf8_to_utf16(const char *text); 78EVIL_API wchar_t *evil_utf8_to_utf16(const char *text);
79 79
80EAPI const char *evil_format_message(long err); 80EVIL_API const char *evil_format_message(long err);
81 81
82EAPI const char *evil_last_error_get(void); 82EVIL_API const char *evil_last_error_get(void);
83 83
84/** 84/**
85 * @brief check if the given path is absolute. 85 * @brief check if the given path is absolute.
@@ -102,6 +102,6 @@ EAPI const char *evil_last_error_get(void);
102 * 102 *
103 * @ingroup Evil 103 * @ingroup Evil
104 */ 104 */
105EAPI int evil_path_is_absolute(const char *path); 105EVIL_API int evil_path_is_absolute(const char *path);
106 106
107#endif /* __EVIL_UTIL_H__ */ 107#endif /* __EVIL_UTIL_H__ */
diff --git a/src/lib/evil/evil_windows.h b/src/lib/evil/evil_windows.h
new file mode 100644
index 0000000000..38fb3d0fa2
--- /dev/null
+++ b/src/lib/evil/evil_windows.h
@@ -0,0 +1,11 @@
1#ifndef __EVIL_WINDOWS_H__
2#define __EVIL_WINDOWS_H__
3
4#ifndef WIN32_LEAN_AND_MEAN
5# define WIN32_LEAN_AND_MEAN
6#endif
7
8#include <winsock2.h>
9#include <windows.h>
10
11#endif
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
index 8a650a67d5..de56339843 100644
--- a/src/lib/evil/meson.build
+++ b/src/lib/evil/meson.build
@@ -28,6 +28,7 @@ if target_machine.system() == 'windows'
28 evil_pub_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep, evil_unposix] 28 evil_pub_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep, evil_unposix]
29 29
30 evil_lib = library('evil', evil_src, 30 evil_lib = library('evil', evil_src,
31 c_args : ['-DEVIL_BUILD', '-DEVIL_DLL'],
31 dependencies : evil_deps, 32 dependencies : evil_deps,
32 include_directories : [config_dir], 33 include_directories : [config_dir],
33 install: true, 34 install: true,
@@ -41,7 +42,6 @@ if target_machine.system() == 'windows'
41 ) 42 )
42else 43else
43 evil = declare_dependency() 44 evil = declare_dependency()
44 evil_unposix = declare_dependency()
45endif 45endif
46 46
47automatic_pkgfile = false 47automatic_pkgfile = false
diff --git a/src/lib/evil/unposix/limits.h b/src/lib/evil/unposix/limits.h
index 4017e451e3..c8a0b9c8c2 100644
--- a/src/lib/evil/unposix/limits.h
+++ b/src/lib/evil/unposix/limits.h
@@ -1,17 +1,10 @@
1#ifndef UNPOSIX_LIMITS_H 1#ifndef UNPOSIX_LIMITS_H
2#define UNPOSIX_LIMITS_H 2#define UNPOSIX_LIMITS_H
3 3
4 4#include <evil_windows.h>
5#ifdef _WIN32 5#include_next <limits.h>
6# ifndef WIN32_LEAN_AND_MEAN 6#ifndef PATH_MAX
7# define WIN32_LEAN_AND_MEAN 7# define PATH_MAX MAX_PATH
8# endif
9# include <windows.h>
10# undef WIN32_LEAN_AND_MEAN
11# include_next <limits.h>
12# ifndef PATH_MAX
13# define PATH_MAX MAX_PATH
14# endif
15#endif 8#endif
16 9
17#endif 10#endif
diff --git a/src/lib/evil/unposix/sys/stat.h b/src/lib/evil/unposix/sys/stat.h
index 3906b15dc7..926eab0d0f 100644
--- a/src/lib/evil/unposix/sys/stat.h
+++ b/src/lib/evil/unposix/sys/stat.h
@@ -1,12 +1,7 @@
1#ifndef UNPOSIX_SYS_STAT_H 1#ifndef UNPOSIX_SYS_STAT_H
2#define UNPOSIX_SYS_STAT_H 2#define UNPOSIX_SYS_STAT_H
3 3
4#ifdef _WIN32 4#include <evil_windows.h>
5# ifndef WIN32_LEAN_AND_MEAN
6# define WIN32_LEAN_AND_MEAN
7# endif
8# include <windows.h>
9#endif
10#include <../ucrt/sys/types.h> 5#include <../ucrt/sys/types.h>
11#include_next <sys/stat.h> 6#include_next <sys/stat.h>
12#include <corecrt.h> 7#include <corecrt.h>
diff --git a/src/lib/evil/unposix/sys/time.h b/src/lib/evil/unposix/sys/time.h
index 2cc857899a..5c5de33523 100644
--- a/src/lib/evil/unposix/sys/time.h
+++ b/src/lib/evil/unposix/sys/time.h
@@ -5,7 +5,7 @@
5# define WIN32_LEAN_AND_MEAN 5# define WIN32_LEAN_AND_MEAN
6#endif 6#endif
7 7
8#include <windows.h> 8#include <evil_windows.h>
9#include <winsock2.h> 9#include <winsock2.h>
10#include <minwinbase.h> 10#include <minwinbase.h>
11#include <sysinfoapi.h> 11#include <sysinfoapi.h>