summaryrefslogtreecommitdiff
path: root/src/lib/evil
diff options
context:
space:
mode:
authorVincent Torri <vincent dot torri at gmail dot com>2015-11-11 15:04:37 +0100
committerCedric BAIL <cedric@osg.samsung.com>2015-11-11 14:36:17 -0800
commit9070e067bcf864cfc16fe5ba9e3c0bc42f5d2579 (patch)
treee8bfd63bead109fa61abdf043d701cc3a02e2834 /src/lib/evil
parent26ed6638aeb3089a7eb784b9bf50f1830f7b5e02 (diff)
evil: remove useless vc++ code
vc++ is not supported anymore Signed-off-by: Cedric BAIL <cedric@osg.samsung.com>
Diffstat (limited to 'src/lib/evil')
-rw-r--r--src/lib/evil/Evil.h44
-rw-r--r--src/lib/evil/dlfcn.c4
-rw-r--r--src/lib/evil/evil_fcntl.c5
-rw-r--r--src/lib/evil/evil_mman.c7
-rw-r--r--src/lib/evil/evil_string.c9
-rw-r--r--src/lib/evil/evil_string.h22
-rw-r--r--src/lib/evil/evil_unistd.c42
-rw-r--r--src/lib/evil/evil_unistd.h74
8 files changed, 7 insertions, 200 deletions
diff --git a/src/lib/evil/Evil.h b/src/lib/evil/Evil.h
index ff32525413..780b8b0e1e 100644
--- a/src/lib/evil/Evil.h
+++ b/src/lib/evil/Evil.h
@@ -107,35 +107,6 @@ extern "C" {
107#include <math.h> 107#include <math.h>
108 108
109 109
110#ifdef _MSC_VER
111
112# include <io.h>
113
114# define F_OK 0 /* Check for file existence */
115# define X_OK 1 /* MS access() doesn't check for execute permission. */
116# define W_OK 2 /* Check for write permission */
117# define R_OK 4 /* Check for read permission */
118
119typedef DWORD pid_t;
120typedef unsigned short mode_t;
121
122typedef unsigned short uint16_t;
123typedef unsigned int uint32_t;
124typedef signed int int32_t;
125typedef __int64 int64_t;
126typedef unsigned __int64 uint64_t;
127typedef SSIZE_T ssize_t;
128
129# define strdup(s) _strdup(s)
130# define unlink(filename) _unlink(filename)
131# define fileno(f) _fileno(f)
132# define fdopen(fd,m) _fdopen((fd),(m))
133# define access(p,m) _access((p),(m))
134# define hypot(x,y) _hypot((x),(y))
135# define tzset _tzset
136
137#endif /* _MSC_VER */
138
139typedef unsigned long uid_t; 110typedef unsigned long uid_t;
140typedef unsigned long gid_t; 111typedef unsigned long gid_t;
141 112
@@ -153,10 +124,6 @@ typedef unsigned long gid_t;
153#include "evil_util.h" 124#include "evil_util.h"
154#include "evil_macro_pop.h" 125#include "evil_macro_pop.h"
155 126
156
157#if (defined(_WIN32) && !defined(_UWIN) && !defined(__CYGWIN__))
158# if defined(_MSC_VER) || defined(__MINGW32__)
159
160#ifndef S_ISDIR 127#ifndef S_ISDIR
161# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR) 128# define S_ISDIR(m) (((m) & _S_IFMT) == _S_IFDIR)
162#endif 129#endif
@@ -165,7 +132,7 @@ typedef unsigned long gid_t;
165# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG) 132# define S_ISREG(m) (((m) & _S_IFMT) == _S_IFREG)
166#endif 133#endif
167 134
168# define S_ISLNK(m) 0 135#define S_ISLNK(m) 0
169 136
170#define S_IRUSR _S_IRUSR 137#define S_IRUSR _S_IRUSR
171#ifndef S_IRGRP 138#ifndef S_IRGRP
@@ -199,9 +166,9 @@ typedef unsigned long gid_t;
199# define S_IRWXO _S_IRWXU 166# define S_IRWXO _S_IRWXU
200#endif 167#endif
201 168
202# define _S_IXUSR _S_IEXEC 169#define _S_IXUSR _S_IEXEC
203# define _S_IWUSR _S_IWRITE 170#define _S_IWUSR _S_IWRITE
204# define _S_IRUSR _S_IREAD 171#define _S_IRUSR _S_IREAD
205 172
206 /* 173 /*
207# define close(fd) _close(fd) 174# define close(fd) _close(fd)
@@ -211,9 +178,6 @@ typedef unsigned long gid_t;
211# define lstat(f,s) _stat((f),(s)) 178# define lstat(f,s) _stat((f),(s))
212 */ 179 */
213 180
214# endif
215#endif
216
217#define sigsetjmp(Env, Save) setjmp(Env) 181#define sigsetjmp(Env, Save) setjmp(Env)
218 182
219#undef EAPI 183#undef EAPI
diff --git a/src/lib/evil/dlfcn.c b/src/lib/evil/dlfcn.c
index ae8687ebf5..4f3760b272 100644
--- a/src/lib/evil/dlfcn.c
+++ b/src/lib/evil/dlfcn.c
@@ -4,10 +4,6 @@
4 4
5#include <stdlib.h> 5#include <stdlib.h>
6 6
7#ifdef _MSC_VER
8# include <limits.h>
9#endif /* _MSC_VER */
10
11#ifndef WIN32_LEAN_AND_MEAN 7#ifndef WIN32_LEAN_AND_MEAN
12# define WIN32_LEAN_AND_MEAN 8# define WIN32_LEAN_AND_MEAN
13#endif 9#endif
diff --git a/src/lib/evil/evil_fcntl.c b/src/lib/evil/evil_fcntl.c
index 169d1926e2..118ed175a4 100644
--- a/src/lib/evil/evil_fcntl.c
+++ b/src/lib/evil/evil_fcntl.c
@@ -3,11 +3,6 @@
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include <stdio.h> 5#include <stdio.h>
6
7#ifdef _MSC_VER
8# include <io.h> /* for _get_osfhandle _lseek and _locking */
9#endif
10
11#include <sys/locking.h> 6#include <sys/locking.h>
12 7
13#include <winsock2.h> /* for ioctlsocket */ 8#include <winsock2.h> /* for ioctlsocket */
diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c
index 8d6dcdb2cc..fca3c72519 100644
--- a/src/lib/evil/evil_mman.c
+++ b/src/lib/evil/evil_mman.c
@@ -5,10 +5,7 @@
5#include <stdlib.h> 5#include <stdlib.h>
6#include <stdio.h> 6#include <stdio.h>
7#include <sys/types.h> 7#include <sys/types.h>
8 8#include <unistd.h>
9#ifndef _MSC_VER
10# include <unistd.h>
11#endif
12 9
13#ifndef WIN32_LEAN_AND_MEAN 10#ifndef WIN32_LEAN_AND_MEAN
14# define WIN32_LEAN_AND_MEAN 11# define WIN32_LEAN_AND_MEAN
@@ -16,7 +13,7 @@
16#include <windows.h> 13#include <windows.h>
17#undef WIN32_LEAN_AND_MEAN 14#undef WIN32_LEAN_AND_MEAN
18 15
19# include <io.h> 16#include <io.h>
20 17
21#include "evil_macro.h" 18#include "evil_macro.h"
22#include "sys/mman.h" 19#include "sys/mman.h"
diff --git a/src/lib/evil/evil_string.c b/src/lib/evil/evil_string.c
index 151f8e5a01..12411be3f6 100644
--- a/src/lib/evil/evil_string.c
+++ b/src/lib/evil/evil_string.c
@@ -54,15 +54,6 @@ strrstr (const char *str, const char *substr)
54 return ret; 54 return ret;
55} 55}
56 56
57#ifdef _MSC_VER
58
59int strcasecmp(const char *s1, const char *s2)
60{
61 return lstrcmpi(s1, s2);
62}
63
64#endif /* _MSC_VER */
65
66char *strcasestr(const char *haystack, const char *needle) 57char *strcasestr(const char *haystack, const char *needle)
67{ 58{
68 size_t length_needle; 59 size_t length_needle;
diff --git a/src/lib/evil/evil_string.h b/src/lib/evil/evil_string.h
index 6de66e9c50..e1bf65b73b 100644
--- a/src/lib/evil/evil_string.h
+++ b/src/lib/evil/evil_string.h
@@ -73,28 +73,6 @@ EAPI int ffs(int i);
73 */ 73 */
74EAPI char *strrstr (const char *str, const char *substr); 74EAPI char *strrstr (const char *str, const char *substr);
75 75
76#ifdef _MSC_VER
77
78/**
79 * @brief Compare two string, ignoring case.
80 *
81 * @param s1 The first string to compare.
82 * @param s2 The first string to compare.
83 * @return
84 *
85 * This function compares the two strings @p s1 and @p s2, ignoring
86 * the case of the characters. It returns an integer less than, equal
87 * to, or greater than zero if s1 is found, respectively, to be less
88 * than, to match, or be greater than s2.
89 *
90 * Conformity: Non applicable.
91 *
92 * Supported OS: Windows XP (vc++ only)
93 */
94EAPI int strcasecmp(const char *s1, const char *s2);
95
96#endif /* _MSC_VER */
97
98/** 76/**
99 * @brief Locate a substring into a string, ignoring case. 77 * @brief Locate a substring into a string, ignoring case.
100 * 78 *
diff --git a/src/lib/evil/evil_unistd.c b/src/lib/evil/evil_unistd.c
index 71f6e2c10e..c75f63fa85 100644
--- a/src/lib/evil/evil_unistd.c
+++ b/src/lib/evil/evil_unistd.c
@@ -3,6 +3,7 @@
3#endif /* HAVE_CONFIG_H */ 3#endif /* HAVE_CONFIG_H */
4 4
5#include <errno.h> 5#include <errno.h>
6# include <sys/time.h>
6 7
7#ifndef WIN32_LEAN_AND_MEAN 8#ifndef WIN32_LEAN_AND_MEAN
8# define WIN32_LEAN_AND_MEAN 9# define WIN32_LEAN_AND_MEAN
@@ -10,12 +11,6 @@
10#include <winsock2.h> 11#include <winsock2.h>
11#undef WIN32_LEAN_AND_MEAN 12#undef WIN32_LEAN_AND_MEAN
12 13
13# include <sys/time.h>
14
15#ifdef _MSC_VER
16# include <direct.h> /* for _getcwd */
17#endif
18
19#include "Evil.h" 14#include "Evil.h"
20#include "evil_private.h" 15#include "evil_private.h"
21 16
@@ -64,41 +59,6 @@ evil_time_get(void)
64 return (double)_evil_time_second + (double)(count.QuadPart - _evil_time_count)/ (double)_evil_time_freq; 59 return (double)_evil_time_second + (double)(count.QuadPart - _evil_time_count)/ (double)_evil_time_freq;
65} 60}
66 61
67#ifdef _MSC_VER
68int
69evil_gettimeofday(struct timeval *tp, void *tzp EVIL_UNUSED)
70{
71 LARGE_INTEGER count;
72 LONGLONG diff;
73
74 QueryPerformanceCounter(&count);
75 diff = count.QuadPart - _evil_time_count;
76 tp->tv_sec = _evil_time_second + (long)(diff / _evil_time_freq);
77 tp->tv_usec = (long)(((diff % _evil_time_freq) * 1000000ll) / _evil_time_freq);
78
79 return 1;
80}
81
82int
83evil_usleep(unsigned long usec)
84{
85 Sleep(usec / 1000);
86 return 0;
87}
88
89
90/*
91 * Process identifer related functions
92 *
93 */
94
95pid_t
96getpid(void)
97{
98 return (pid_t)GetCurrentProcessId();
99}
100#endif
101
102/* 62/*
103 * File related functions 63 * File related functions
104 * 64 *
diff --git a/src/lib/evil/evil_unistd.h b/src/lib/evil/evil_unistd.h
index f6584161b8..013fbf8b5a 100644
--- a/src/lib/evil/evil_unistd.h
+++ b/src/lib/evil/evil_unistd.h
@@ -36,80 +36,6 @@
36 */ 36 */
37EAPI double evil_time_get(void); 37EAPI double evil_time_get(void);
38 38
39#ifdef _MSC_VER
40
41/**
42 * @brief Retrieve the time since the Evil library has been
43 * initialized.
44 *
45 * @param tp Structure to fill.
46 * @param tzp Unused.
47 * @return Always 1.
48 *
49 * The function fills @p tp with the time spent since the Evil library
50 * has been initialized. It uses a high-resolution timer and then can
51 * have a precision up to the nano-second. The precision is processor
52 * dependant. This function can be used to benchmark parts of code in
53 * with high precision. This function always returns 1.
54 *
55 * Conformity: Not appliclable.
56 *
57 * Supported OS: Windows XP.
58 */
59EAPI int evil_gettimeofday(struct timeval * tp, void * tzp);
60
61/**
62 * @def gettimeofday(tp,tzp)
63 *
64 * Wrapper around evil_gettimeofday().
65 */
66#define gettimeofday(tp,tzp) evil_gettimeofday((tp),(tzp))
67
68/**
69 * @brief Suspend the execution of the calling process for microsecond
70 * intervals.
71 *
72 * @param usec The interval in microseconds.
73 * @return Always 0 (success).
74 *
75 * This function suspends the execution of the calling process for (at
76 * least) @p usec microseconds.
77 *
78 * Conformity: Not appliclable.
79 *
80 * Supported OS: Windows XP.
81 */
82EAPI int evil_usleep(unsigned long usec);
83
84/**
85 * @def usleep(usec)
86 *
87 * Wrapper around evil_usleep().
88 */
89#define usleep(usec) evil_usleep(usec);
90
91/*
92 * Process identifer related functions
93 *
94 */
95
96/**
97 * @brief Return the process identifier of the calling process.
98 *
99 * @return The process ID.
100 *
101 * Return the process identifier of the calling process. Until
102 * the process terminates, the process identifier uniquely
103 * identifies the process throughout the system.
104 *
105 * Conformity: Not appliclable.
106 *
107 * Supported OS: Windows XP.
108 */
109EAPI pid_t getpid(void);
110
111#endif
112
113 39
114/* 40/*
115 * Symbolic links and directory related functions 41 * Symbolic links and directory related functions