summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent.torri@gmail.com>2018-06-29 09:56:15 -0400
committerMike Blumenkrantz <zmike@samsung.com>2018-06-29 09:56:15 -0400
commit5870a732c6dba19608c07bf8f78ab5311bdf9e0f (patch)
tree77f31811db36cd1bbc604187b45b5c7e53d6473b /src/lib/evil
parent23eee272ac075a7d50abb4e90bb421bedad55edc (diff)
Evil: fix usage of Evil in a program compiled with vc++ this should be enough to fix T5206
Summary: Fix EFL errors when compiling a program with vc++ Test Plan: compilation Reviewers: zmike, devilhorns, an.kroitor Reviewed By: zmike Subscribers: cedric, an.kroitor, zmike, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D6478
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/Evil.h11
-rw-r--r--src/lib/evil/evil_util.c28
-rw-r--r--src/lib/evil/evil_util.h12
3 files changed, 23 insertions, 28 deletions
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index c8f1f68f8b..e09e261ead 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -106,6 +106,17 @@ extern "C" {
106typedef unsigned long uid_t; 106typedef unsigned long uid_t;
107typedef unsigned long gid_t; 107typedef unsigned long gid_t;
108 108
109#ifdef _MSC_VER
110# ifdef _WIN64
111typedef __int64 pid_t;
112# else
113typedef int pid_t;
114# endif
115typedef SSIZE_T ssize_t;
116typedef unsigned short mode_t;
117# define strdup(str) _strdup(str)
118#endif
119
109 120
110#include "evil_macro.h" 121#include "evil_macro.h"
111#include "evil_dlfcn.h" 122#include "evil_dlfcn.h"
diff --git a/src/lib/evil/evil_util.c b/src/lib/evil/evil_util.c
index 36ee38e844..e47475371a 100644
--- a/src/lib/evil/evil_util.c
+++ b/src/lib/evil/evil_util.c
@@ -172,37 +172,13 @@ _evil_last_error_display(const char *fct)
172const char * 172const char *
173evil_tmpdir_get(void) 173evil_tmpdir_get(void)
174{ 174{
175 char *tmpdir; 175 return NULL;
176
177 tmpdir = getenv("TMP");
178 if (!tmpdir) tmpdir = getenv("TEMP");
179 if (!tmpdir) tmpdir = getenv("USERPROFILE");
180 if (!tmpdir) tmpdir = getenv("WINDIR");
181 if (!tmpdir) tmpdir="C:\\";
182
183 return tmpdir;
184} 176}
185 177
186const char * 178const char *
187evil_homedir_get(void) 179evil_homedir_get(void)
188{ 180{
189 char *homedir; 181 return NULL;
190 char *homedrive;
191 char *homepath;
192
193 homedir = getenv("HOME");
194 if (!homedir)
195 {
196 homedrive = getenv("HOMEDRIVE");
197 homepath = getenv("HOMEPATH");
198 if (homedrive && homepath)
199 asprintf(&homedir, "%s%s", homedrive, homepath);
200 }
201 if (!homedir) homedir = getenv("USERPROFILE");
202 if (!homedir) homedir = getenv("WINDIR");
203 if (!homedir) homedir="C:\\";
204
205 return homedir;
206} 182}
207 183
208int 184int
diff --git a/src/lib/evil/evil_util.h b/src/lib/evil/evil_util.h
index 6b3e50439d..e1fdf26387 100644
--- a/src/lib/evil/evil_util.h
+++ b/src/lib/evil/evil_util.h
@@ -81,10 +81,14 @@ EAPI const char *evil_last_error_get(void);
81 * 81 *
82 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 82 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
83 * Windows XP. 83 * Windows XP.
84
85 * @deprecated
86 * This function is deprecated and returns @c NULL.
87 * Use eina_environment_tmp_get() instead.
84 * 88 *
85 * @ingroup Evil 89 * @ingroup Evil
86 */ 90 */
87__attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void); 91EAPI const char *evil_tmpdir_get(void);
88 92
89/** 93/**
90 * @brief Return a dir to store personal files. 94 * @brief Return a dir to store personal files.
@@ -103,10 +107,14 @@ __attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void);
103 * 107 *
104 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000, 108 * Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
105 * Windows XP. 109 * Windows XP.
110
111 * @deprecated
112 * This function is deprecated and returns @c NULL.
113 * Use eina_environment_home_get() instead.
106 * 114 *
107 * @ingroup Evil 115 * @ingroup Evil
108 */ 116 */
109__attribute__ ((__deprecated__)) EAPI const char *evil_homedir_get(void); 117EAPI const char *evil_homedir_get(void);
110 118
111/** 119/**
112 * @brief check if the given path is absolute. 120 * @brief check if the given path is absolute.