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
This commit is contained in:
Vincent Torri 2018-06-29 09:56:15 -04:00 committed by Mike Blumenkrantz
parent 23eee272ac
commit 5870a732c6
3 changed files with 23 additions and 28 deletions

View File

@ -106,6 +106,17 @@ extern "C" {
typedef unsigned long uid_t;
typedef unsigned long gid_t;
#ifdef _MSC_VER
# ifdef _WIN64
typedef __int64 pid_t;
# else
typedef int pid_t;
# endif
typedef SSIZE_T ssize_t;
typedef unsigned short mode_t;
# define strdup(str) _strdup(str)
#endif
#include "evil_macro.h"
#include "evil_dlfcn.h"

View File

@ -172,37 +172,13 @@ _evil_last_error_display(const char *fct)
const char *
evil_tmpdir_get(void)
{
char *tmpdir;
tmpdir = getenv("TMP");
if (!tmpdir) tmpdir = getenv("TEMP");
if (!tmpdir) tmpdir = getenv("USERPROFILE");
if (!tmpdir) tmpdir = getenv("WINDIR");
if (!tmpdir) tmpdir="C:\\";
return tmpdir;
return NULL;
}
const char *
evil_homedir_get(void)
{
char *homedir;
char *homedrive;
char *homepath;
homedir = getenv("HOME");
if (!homedir)
{
homedrive = getenv("HOMEDRIVE");
homepath = getenv("HOMEPATH");
if (homedrive && homepath)
asprintf(&homedir, "%s%s", homedrive, homepath);
}
if (!homedir) homedir = getenv("USERPROFILE");
if (!homedir) homedir = getenv("WINDIR");
if (!homedir) homedir="C:\\";
return homedir;
return NULL;
}
int

View File

@ -81,10 +81,14 @@ EAPI const char *evil_last_error_get(void);
*
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
* Windows XP.
* @deprecated
* This function is deprecated and returns @c NULL.
* Use eina_environment_tmp_get() instead.
*
* @ingroup Evil
*/
__attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void);
EAPI const char *evil_tmpdir_get(void);
/**
* @brief Return a dir to store personal files.
@ -103,10 +107,14 @@ __attribute__ ((__deprecated__)) EAPI const char *evil_tmpdir_get(void);
*
* Supported OS: Windows 95, Windows 98, Windows Me, Windows NT, Windows 2000,
* Windows XP.
* @deprecated
* This function is deprecated and returns @c NULL.
* Use eina_environment_home_get() instead.
*
* @ingroup Evil
*/
__attribute__ ((__deprecated__)) EAPI const char *evil_homedir_get(void);
EAPI const char *evil_homedir_get(void);
/**
* @brief check if the given path is absolute.