summaryrefslogtreecommitdiff
path: root/lib/libsqlite3/tsrc/pthread_stub.c
blob: 995c9ca36e2ab5f5d91845e02cc0bbd7df891221 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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