summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 18:36:45 -0300
committerFelipe Magno de Almeida <felipe@expertise.dev>2020-05-04 22:11:44 -0300
commit019828797c7c715b606ed3bc6fdbfc1a58438ddd (patch)
tree6c03af9ab9b0f1d913dde9d501865c5c73b3366d
parent4d714f44e1c4580870bc250e3102a0a56cde83d1 (diff)
More things to squash
-rw-r--r--configure.bat2
-rw-r--r--src/lib/eina/eina_lock.c116
-rw-r--r--src/lib/eina/eina_types.h2
-rw-r--r--src/lib/evil/evil_mman.c4
-rw-r--r--src/lib/evil/evil_windows.h1
-rw-r--r--src/lib/evil/meson.build6
-rw-r--r--src/lib/evil/unposix/string.h9
7 files changed, 42 insertions, 98 deletions
diff --git a/configure.bat b/configure.bat
index b94bcfbba5..1c3d266b89 100644
--- a/configure.bat
+++ b/configure.bat
@@ -52,7 +52,7 @@ exit /B 0
52 52
53 :: --------------------------------- 53 :: ---------------------------------
54 :: Windows terminal specific options 54 :: Windows terminal specific options
55 set CFLAGS=-fansi-escape-codes -fcolor-diagnostics %CFLAGS% 55 set CFLAGS=-fansi-escape-codes -Wno-implicit-fallthrough %CFLAGS%
56 56
57 57
58 if defined VERBOSE ( 58 if defined VERBOSE (
diff --git a/src/lib/eina/eina_lock.c b/src/lib/eina/eina_lock.c
index 554ca293f1..7f20d7cb18 100644
--- a/src/lib/eina/eina_lock.c
+++ b/src/lib/eina/eina_lock.c
@@ -86,7 +86,7 @@ eina_lock_debug(const Eina_Lock *mutex)
86} 86}
87 87
88EINA_API Eina_Bool 88EINA_API Eina_Bool
89_eina_lock_new(Eina_Lock *mutex, Eina_Bool recursive) 89eina_lock_new(Eina_Lock *mutex)
90{ 90{
91 Eina_Bool ret = _eina_lock_new(mutex, EINA_FALSE); 91 Eina_Bool ret = _eina_lock_new(mutex, EINA_FALSE);
92#ifdef EINA_HAVE_DEBUG_THREADS 92#ifdef EINA_HAVE_DEBUG_THREADS
@@ -98,7 +98,7 @@ _eina_lock_new(Eina_Lock *mutex, Eina_Bool recursive)
98 return ret; 98 return ret;
99} 99}
100 100
101EAPI Eina_Bool 101EINA_API Eina_Bool
102eina_lock_recursive_new(Eina_Lock *mutex) 102eina_lock_recursive_new(Eina_Lock *mutex)
103{ 103{
104 Eina_Bool ret = _eina_lock_new(mutex, EINA_TRUE); 104 Eina_Bool ret = _eina_lock_new(mutex, EINA_TRUE);
@@ -112,244 +112,192 @@ eina_lock_recursive_new(Eina_Lock *mutex)
112} 112}
113 113
114EINA_API void 114EINA_API void
115_eina_lock_free(Eina_Lock *mutex) 115eina_lock_free(Eina_Lock *mutex)
116{ 116{
117 _eina_lock_free(mutex); 117 _eina_lock_free(mutex);
118} 118}
119 119
120EAPI Eina_Lock_Result 120EINA_API Eina_Lock_Result
121eina_lock_take_try(Eina_Lock *mutex) 121eina_lock_take_try(Eina_Lock *mutex)
122{ 122{
123 return _eina_lock_take_try(mutex); 123 return _eina_lock_take_try(mutex);
124} 124}
125 125
126EAPI Eina_Lock_Result 126EINA_API Eina_Lock_Result
127eina_lock_take(Eina_Lock *mutex) 127eina_lock_take(Eina_Lock *mutex)
128{ 128{
129 return _eina_lock_take(mutex); 129 return _eina_lock_take(mutex);
130} 130}
131 131
132EAPI Eina_Lock_Result 132EINA_API Eina_Lock_Result
133eina_lock_release(Eina_Lock *mutex) 133eina_lock_release(Eina_Lock *mutex)
134{ 134{
135 return _eina_lock_release(mutex); 135 return _eina_lock_release(mutex);
136} 136}
137 137
138EINA_API Eina_Bool 138EINA_API Eina_Bool
139_eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex) 139eina_condition_new(Eina_Condition *cond, Eina_Lock *mutex)
140{ 140{
141 return _eina_condition_new(cond, mutex); 141 return _eina_condition_new(cond, mutex);
142} 142}
143 143
144EAPI void 144EINA_API void
145eina_condition_free(Eina_Condition *cond) 145eina_condition_free(Eina_Condition *cond)
146{ 146{
147 _eina_condition_free(cond); 147 _eina_condition_free(cond);
148} 148}
149 149
150EAPI Eina_Bool 150EINA_API Eina_Bool
151eina_condition_wait(Eina_Condition *cond) 151eina_condition_wait(Eina_Condition *cond)
152{ 152{
153 return _eina_condition_wait(cond); 153 return _eina_condition_wait(cond);
154} 154}
155 155
156EAPI Eina_Bool 156EINA_API Eina_Bool
157eina_condition_timedwait(Eina_Condition *cond, double t) 157eina_condition_timedwait(Eina_Condition *cond, double t)
158{ 158{
159 return _eina_condition_timedwait(cond, t); 159 return _eina_condition_timedwait(cond, t);
160} 160}
161 161
162EAPI Eina_Bool 162EINA_API Eina_Bool
163eina_condition_broadcast(Eina_Condition *cond) 163eina_condition_broadcast(Eina_Condition *cond)
164{ 164{
165 return _eina_condition_broadcast(cond); 165 return _eina_condition_broadcast(cond);
166} 166}
167 167
168EAPI Eina_Bool 168EINA_API Eina_Bool
169eina_condition_signal(Eina_Condition *cond) 169eina_condition_signal(Eina_Condition *cond)
170{ 170{
171 return _eina_condition_signal(cond); 171 return _eina_condition_signal(cond);
172} 172}
173 173
174EAPI Eina_Bool 174EINA_API Eina_Bool
175eina_rwlock_new(Eina_RWLock *mutex) 175eina_rwlock_new(Eina_RWLock *mutex)
176{ 176{
177 return _eina_rwlock_new(mutex); 177 return _eina_rwlock_new(mutex);
178} 178}
179 179
180EAPI void 180EINA_API void
181eina_rwlock_free(Eina_RWLock *mutex) 181eina_rwlock_free(Eina_RWLock *mutex)
182{ 182{
183 _eina_rwlock_free(mutex); 183 _eina_rwlock_free(mutex);
184} 184}
185 185
186EAPI Eina_Lock_Result 186EINA_API Eina_Lock_Result
187eina_rwlock_take_read(Eina_RWLock *mutex) 187eina_rwlock_take_read(Eina_RWLock *mutex)
188{ 188{
189 return _eina_rwlock_take_read(mutex); 189 return _eina_rwlock_take_read(mutex);
190} 190}
191 191
192EAPI Eina_Lock_Result 192EINA_API Eina_Lock_Result
193eina_rwlock_take_write(Eina_RWLock *mutex) 193eina_rwlock_take_write(Eina_RWLock *mutex)
194{ 194{
195 return _eina_rwlock_take_write(mutex); 195 return _eina_rwlock_take_write(mutex);
196} 196}
197 197
198EAPI Eina_Lock_Result 198EINA_API Eina_Lock_Result
199eina_rwlock_release(Eina_RWLock *mutex) 199eina_rwlock_release(Eina_RWLock *mutex)
200{ 200{
201 return _eina_rwlock_release(mutex); 201 return _eina_rwlock_release(mutex);
202} 202}
203 203
204EAPI Eina_Bool 204EINA_API Eina_Bool
205eina_tls_cb_new(Eina_TLS *key, Eina_TLS_Delete_Cb delete_cb) 205eina_tls_cb_new(Eina_TLS *key, Eina_TLS_Delete_Cb delete_cb)
206{ 206{
207 return _eina_tls_cb_new(key, delete_cb); 207 return _eina_tls_cb_new(key, delete_cb);
208} 208}
209 209
210EAPI Eina_Bool 210EINA_API Eina_Bool
211eina_tls_new(Eina_TLS *key) 211eina_tls_new(Eina_TLS *key)
212{ 212{
213 return _eina_tls_cb_new(key, NULL); 213 return _eina_tls_cb_new(key, NULL);
214} 214}
215 215
216EAPI void 216EINA_API void
217eina_tls_free(Eina_TLS key) 217eina_tls_free(Eina_TLS key)
218{ 218{
219 _eina_tls_free(key); 219 _eina_tls_free(key);
220} 220}
221 221
222EAPI void * 222EINA_API void *
223eina_tls_get(Eina_TLS key) 223eina_tls_get(Eina_TLS key)
224{ 224{
225 return _eina_tls_get(key); 225 return _eina_tls_get(key);
226} 226}
227 227
228EAPI Eina_Bool 228EINA_API Eina_Bool
229eina_tls_set(Eina_TLS key, const void *data) 229eina_tls_set(Eina_TLS key, const void *data)
230{ 230{
231 return _eina_tls_set(key, data); 231 return _eina_tls_set(key, data);
232} 232}
233 233
234EAPI Eina_Bool 234EINA_API Eina_Bool
235eina_barrier_new(Eina_Barrier *barrier, int needed) 235eina_barrier_new(Eina_Barrier *barrier, int needed)
236{ 236{
237 return _eina_barrier_new(barrier, needed); 237 return _eina_barrier_new(barrier, needed);
238} 238}
239 239
240EINA_API Eina_Bool
241_eina_barrier_new(Eina_Barrier *barrier, int needed)
242{
243#ifdef EINA_HAVE_PTHREAD_BARRIER
244 int ok = pthread_barrier_init(&(barrier->barrier), NULL, needed);
245 if (ok == 0) return EINA_TRUE;
246 else if ((ok == EAGAIN) || (ok == ENOMEM)) return EINA_FALSE;
247 else EINA_LOCK_ABORT_DEBUG(ok, barrier_init, barrier);
248 return EINA_FALSE;
249#else
250 barrier->needed = needed;
251 barrier->called = 0;
252 if (eina_lock_new(&(barrier->cond_lock)))
253 {
254 if (eina_condition_new(&(barrier->cond), &(barrier->cond_lock)))
255 return EINA_TRUE;
256 }
257 return EINA_FALSE;
258#endif
259}
260
261EINA_API void 240EINA_API void
262eina_barrier_free(Eina_Barrier *barrier) 241eina_barrier_free(Eina_Barrier *barrier)
263{ 242{
264 _eina_barrier_free(barrier); 243 _eina_barrier_free(barrier);
265} 244}
266 245
267EAPI Eina_Bool 246EINA_API Eina_Bool
268eina_barrier_wait(Eina_Barrier *barrier) 247eina_barrier_wait(Eina_Barrier *barrier)
269{ 248{
270 return _eina_barrier_wait(barrier); 249 return _eina_barrier_wait(barrier);
271} 250}
272 251
273EAPI Eina_Bool 252EINA_API Eina_Bool
274eina_spinlock_new(Eina_Spinlock *spinlock) 253eina_spinlock_new(Eina_Spinlock *spinlock)
275{ 254{
276 return _eina_spinlock_new(spinlock); 255 return _eina_spinlock_new(spinlock);
277} 256}
278 257
279EAPI void 258EINA_API void
280eina_spinlock_free(Eina_Spinlock *spinlock) 259eina_spinlock_free(Eina_Spinlock *spinlock)
281{ 260{
282 _eina_spinlock_free(spinlock); 261 _eina_spinlock_free(spinlock);
283} 262}
284 263
285EAPI Eina_Lock_Result 264EINA_API Eina_Lock_Result
286eina_spinlock_take_try(Eina_Spinlock *spinlock) 265eina_spinlock_take_try(Eina_Spinlock *spinlock)
287{ 266{
288 return _eina_spinlock_take_try(spinlock); 267 return _eina_spinlock_take_try(spinlock);
289} 268}
290 269
291EAPI Eina_Lock_Result 270EINA_API Eina_Lock_Result
292eina_spinlock_take(Eina_Spinlock *spinlock) 271eina_spinlock_take(Eina_Spinlock *spinlock)
293{ 272{
294 return _eina_spinlock_take(spinlock); 273 return _eina_spinlock_take(spinlock);
295} 274}
296 275
297EAPI Eina_Lock_Result 276EINA_API Eina_Lock_Result
298eina_spinlock_release(Eina_Spinlock *spinlock) 277eina_spinlock_release(Eina_Spinlock *spinlock)
299{ 278{
300 return _eina_spinlock_release(spinlock); 279 return _eina_spinlock_release(spinlock);
301} 280}
302 281
303EINA_API Eina_Bool 282EINA_API Eina_Bool
304_eina_spinlock_new(Eina_Spinlock *spinlock)
305{
306#if defined(EINA_HAVE_POSIX_SPINLOCK)
307 int ok = pthread_spin_init(spinlock, PTHREAD_PROCESS_PRIVATE);
308 if (ok == 0) return EINA_TRUE;
309 else if ((ok == EAGAIN) || (ok == ENOMEM)) return EINA_FALSE;
310 else EINA_LOCK_ABORT_DEBUG(ok, spin_init, spinlock);
311 return EINA_FALSE;
312#elif defined(EINA_HAVE_OSX_SPINLOCK)
313 *spinlock = 0;
314 return EINA_TRUE;
315#else
316 return eina_lock_new(spinlock);
317#endif
318}
319
320EINA_API void
321_eina_spinlock_free(Eina_Spinlock *spinlock)
322{
323#if defined(EINA_HAVE_POSIX_SPINLOCK)
324 int ok = pthread_spin_destroy(spinlock);
325 if (ok != 0) EINA_LOCK_ABORT_DEBUG(ok, spin_destroy, spinlock);
326#elif defined(EINA_HAVE_OSX_SPINLOCK)
327 /* Not applicable */
328 (void) spinlock;
329#else
330 eina_lock_free(spinlock);
331#endif
332}
333
334EINA_API Eina_Bool
335eina_semaphore_new(Eina_Semaphore *sem, int count_init) 283eina_semaphore_new(Eina_Semaphore *sem, int count_init)
336{ 284{
337 return _eina_semaphore_new(sem, count_init); 285 return _eina_semaphore_new(sem, count_init);
338} 286}
339 287
340EAPI Eina_Bool 288EINA_API Eina_Bool
341eina_semaphore_free(Eina_Semaphore *sem) 289eina_semaphore_free(Eina_Semaphore *sem)
342{ 290{
343 return _eina_semaphore_free(sem); 291 return _eina_semaphore_free(sem);
344} 292}
345 293
346EAPI Eina_Bool 294EINA_API Eina_Bool
347eina_semaphore_lock(Eina_Semaphore *sem) 295eina_semaphore_lock(Eina_Semaphore *sem)
348{ 296{
349 return _eina_semaphore_lock(sem); 297 return _eina_semaphore_lock(sem);
350} 298}
351 299
352EAPI Eina_Bool 300EINA_API Eina_Bool
353eina_semaphore_release(Eina_Semaphore *sem, int count_release EINA_UNUSED) 301eina_semaphore_release(Eina_Semaphore *sem, int count_release EINA_UNUSED)
354{ 302{
355 return _eina_semaphore_release(sem, count_release); 303 return _eina_semaphore_release(sem, count_release);
diff --git a/src/lib/eina/eina_types.h b/src/lib/eina/eina_types.h
index d7d5da1646..48c7201278 100644
--- a/src/lib/eina/eina_types.h
+++ b/src/lib/eina/eina_types.h
@@ -289,7 +289,7 @@
289# define EINA_UNLIKELY(exp) exp 289# define EINA_UNLIKELY(exp) exp
290# define EINA_LIKELY(exp) exp 290# define EINA_LIKELY(exp) exp
291# define EINA_SENTINEL 291# define EINA_SENTINEL
292# define EINA_FALLTHROUGH 292# define EINA_FALLTHROUGH __attribute__ ((fallthrough));
293# define EINA_PREFETCH(arg) ((void) (arg)) 293# define EINA_PREFETCH(arg) ((void) (arg))
294# define EINA_PREFETCH_WRITE(arg) ((void) (arg)) 294# define EINA_PREFETCH_WRITE(arg) ((void) (arg))
295# define EINA_PREFETCH_NOCACHE(arg) ((void) (arg)) 295# define EINA_PREFETCH_NOCACHE(arg) ((void) (arg))
diff --git a/src/lib/evil/evil_mman.c b/src/lib/evil/evil_mman.c
index 42f8021e59..f8d1ca58c3 100644
--- a/src/lib/evil/evil_mman.c
+++ b/src/lib/evil/evil_mman.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#if 0
6
5#include <stdlib.h> 7#include <stdlib.h>
6#include <stdio.h> 8#include <stdio.h>
7#include <sys/types.h> 9#include <sys/types.h>
@@ -153,3 +155,5 @@ mprotect(void *addr, size_t len, int prot)
153 DWORD old; 155 DWORD old;
154 return VirtualProtect(addr, len, _evil_mmap_protection_get(prot), &old) ? 0 : -1; 156 return VirtualProtect(addr, len, _evil_mmap_protection_get(prot), &old) ? 0 : -1;
155} 157}
158
159#endif
diff --git a/src/lib/evil/evil_windows.h b/src/lib/evil/evil_windows.h
index 008adbc60c..27e39c4c69 100644
--- a/src/lib/evil/evil_windows.h
+++ b/src/lib/evil/evil_windows.h
@@ -12,4 +12,5 @@
12#include <windows.h> 12#include <windows.h>
13#include <winsock2.h> 13#include <winsock2.h>
14 14
15
15#endif 16#endif
diff --git a/src/lib/evil/meson.build b/src/lib/evil/meson.build
index 7be46ef235..46dbe2a0a0 100644
--- a/src/lib/evil/meson.build
+++ b/src/lib/evil/meson.build
@@ -24,13 +24,13 @@ if target_machine.system() == 'windows'
24 secur32 = cc.find_library('secur32') 24 secur32 = cc.find_library('secur32')
25 uuid = cc.find_library('uuid') 25 uuid = cc.find_library('uuid')
26 26
27 evil_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep] 27 evil_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep, getopt_dep]
28 evil_pub_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep] 28 evil_pub_deps = [psapi, ole32, ws2_32, secur32, uuid, pcre_dep, getopt_dep]
29 29
30 evil_lib = library('evil', evil_src, 30 evil_lib = library('evil', evil_src,
31 c_args : ['-DEVIL_BUILD', '-DEVIL_DLL'], 31 c_args : ['-DEVIL_BUILD', '-DEVIL_DLL'],
32 dependencies : evil_deps, 32 dependencies : evil_deps,
33 include_directories : [config_dir], 33 include_directories : [config_dir, 'unposix'],
34 install: true, 34 install: true,
35 version: meson.project_version(), 35 version: meson.project_version(),
36 ) 36 )
diff --git a/src/lib/evil/unposix/string.h b/src/lib/evil/unposix/string.h
deleted file mode 100644
index 884b846701..0000000000
--- a/src/lib/evil/unposix/string.h
+++ /dev/null
@@ -1,9 +0,0 @@
1#ifndef UNPOSIX_STRING_H
2#define UNPOSIX_STRING_H
3
4#include_next <string.h>
5
6#include <strings.h>
7
8#endif
9