diff options
author | 2012-04-14 13:18:17 +0000 | |
---|---|---|
committer | 2012-04-14 13:18:17 +0000 | |
commit | 25fb62ebb72c664e5f64544ff3834af3c279bb9f (patch) | |
tree | 447f24d0f39780b4b3ebc30cbb0dad4bd8cc482a /lib/libsqlite3/tsrc/pthread_stub.c | |
parent | sqlite 3.7.11 library, vendor sources (diff) | |
download | wireguard-openbsd-25fb62ebb72c664e5f64544ff3834af3c279bb9f.tar.xz wireguard-openbsd-25fb62ebb72c664e5f64544ff3834af3c279bb9f.zip |
extra src for us.
regen parse.c/parse.h with "lemon", no need to recompile every time.
pthread_stub.c might(?) be needed for clean non-pthreads operation
(to be checked, the nomutex stuff looks interesting)
Diffstat (limited to 'lib/libsqlite3/tsrc/pthread_stub.c')
-rw-r--r-- | lib/libsqlite3/tsrc/pthread_stub.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/lib/libsqlite3/tsrc/pthread_stub.c b/lib/libsqlite3/tsrc/pthread_stub.c new file mode 100644 index 00000000000..995c9ca36e2 --- /dev/null +++ b/lib/libsqlite3/tsrc/pthread_stub.c @@ -0,0 +1,28 @@ +/* stubs for pthreads function, quick and dirty */ +#if SQLITE_THREADSAFE && !defined(SQLITE_TEST) + +#include <pthread.h> + +#define WEAKALIAS(f,g ) extern f __attribute__((__weak__, __alias__(#g))) + +static pthread_t _sqlite_self_stub() +{ + return 0; +} + +static int _sqlite_zero_stub() +{ + return 0; +} + +WEAKALIAS(pthread_t pthread_self(void), _sqlite_self_stub); +WEAKALIAS(int pthread_mutex_init(pthread_mutex_t *a, const pthread_mutexattr_t *b), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutex_destroy(pthread_mutex_t *a), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutex_lock(pthread_mutex_t *a), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutex_trylock(pthread_mutex_t *a), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutex_unlock(pthread_mutex_t *a), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutexattr_init(pthread_mutexattr_t *a), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutexattr_settype(pthread_mutexattr_t *a, int b), _sqlite_zero_stub); +WEAKALIAS(int pthread_mutexattr_destroy(pthread_mutexattr_t *a), _sqlite_zero_stub); + +#endif |