ObjFW  Check-in [c26426e80f]

Overview
Comment:Add missing extern "C"
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c26426e80fe9e648a82c6fd8740b40a66453ce6cb240526f88f7897238d14fa6
User & Date: js on 2019-08-01 21:05:49
Other Links: manifest | tags
Context
2019-08-01
21:17
Add mutexes for AmigaOS check-in: 2f01be3808 user: js tags: trunk
21:05
Add missing extern "C" check-in: c26426e80f user: js tags: trunk
20:49
.travis.yml: Update environments check-in: 1b5cca4b91 user: js tags: trunk
Changes

Modified src/OFUDPSocket.h from [55c0fec4d8] to [7aa018221e].

319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
/*!
 * @brief Closes the socket so that it can neither receive nor send any more
 *	  datagrams.
 */
- (void)close;
@end

#ifdef __cplusplus
extern "C" {
#endif
#ifdef __cplusplus
}
#endif

OF_ASSUME_NONNULL_END







<
<
<
<
<
<
<

319
320
321
322
323
324
325







326
/*!
 * @brief Closes the socket so that it can neither receive nor send any more
 *	  datagrams.
 */
- (void)close;
@end








OF_ASSUME_NONNULL_END

Modified src/condition.h from [d4d414aa35] to [586159d8cd].

36
37
38
39
40
41
42



43
44
45
46
47
48
49



# include <windows.h>
typedef struct {
	HANDLE event;
	int count;
} of_condition_t;
#endif




extern bool of_condition_new(of_condition_t *condition);
extern bool of_condition_signal(of_condition_t *condition);
extern bool of_condition_broadcast(of_condition_t *condition);
extern bool of_condition_wait(of_condition_t *condition, of_mutex_t *mutex);
extern bool of_condition_timed_wait(of_condition_t *condition,
    of_mutex_t *mutex, of_time_interval_t timeout);
extern bool of_condition_free(of_condition_t *condition);










>
>
>







>
>
>
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# include <windows.h>
typedef struct {
	HANDLE event;
	int count;
} of_condition_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_condition_new(of_condition_t *condition);
extern bool of_condition_signal(of_condition_t *condition);
extern bool of_condition_broadcast(of_condition_t *condition);
extern bool of_condition_wait(of_condition_t *condition, of_mutex_t *mutex);
extern bool of_condition_timed_wait(of_condition_t *condition,
    of_mutex_t *mutex, of_time_interval_t timeout);
extern bool of_condition_free(of_condition_t *condition);
#ifdef __cplusplus
}
#endif

Modified src/mutex.h from [44aab7ac4a] to [1c81973578].

53
54
55
56
57
58
59



60
61
62
63
64
65
66
67
68
69



70
71
72
73
74
75
76
#else
typedef struct {
	of_mutex_t mutex;
	of_tlskey_t count;
} of_rmutex_t;
#endif




extern bool of_mutex_new(of_mutex_t *mutex);
extern bool of_mutex_lock(of_mutex_t *mutex);
extern bool of_mutex_trylock(of_mutex_t *mutex);
extern bool of_mutex_unlock(of_mutex_t *mutex);
extern bool of_mutex_free(of_mutex_t *mutex);
extern bool of_rmutex_new(of_rmutex_t *rmutex);
extern bool of_rmutex_lock(of_rmutex_t *rmutex);
extern bool of_rmutex_trylock(of_rmutex_t *rmutex);
extern bool of_rmutex_unlock(of_rmutex_t *rmutex);
extern bool of_rmutex_free(of_rmutex_t *rmutex);




/* Spinlocks are inlined for performance. */

static OF_INLINE void
of_thread_yield(void)
{
#if defined(OF_HAVE_SCHED_YIELD)







>
>
>










>
>
>







53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#else
typedef struct {
	of_mutex_t mutex;
	of_tlskey_t count;
} of_rmutex_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_mutex_new(of_mutex_t *mutex);
extern bool of_mutex_lock(of_mutex_t *mutex);
extern bool of_mutex_trylock(of_mutex_t *mutex);
extern bool of_mutex_unlock(of_mutex_t *mutex);
extern bool of_mutex_free(of_mutex_t *mutex);
extern bool of_rmutex_new(of_rmutex_t *rmutex);
extern bool of_rmutex_lock(of_rmutex_t *rmutex);
extern bool of_rmutex_trylock(of_rmutex_t *rmutex);
extern bool of_rmutex_unlock(of_rmutex_t *rmutex);
extern bool of_rmutex_free(of_rmutex_t *rmutex);
#ifdef __cplusplus
}
#endif

/* Spinlocks are inlined for performance. */

static OF_INLINE void
of_thread_yield(void)
{
#if defined(OF_HAVE_SCHED_YIELD)

Modified src/once.h from [b8f741bcba] to [5ea0cd3af5].

27
28
29
30
31
32
33



34



typedef volatile int of_once_t;
# define OF_ONCE_INIT 0
#elif !defined(OF_HAVE_THREADS)
typedef int of_once_t;
# define OF_ONCE_INIT 0
#endif




extern void of_once(of_once_t *control, void (*func)(void));










>
>
>

>
>
>
27
28
29
30
31
32
33
34
35
36
37
38
39
40
typedef volatile int of_once_t;
# define OF_ONCE_INIT 0
#elif !defined(OF_HAVE_THREADS)
typedef int of_once_t;
# define OF_ONCE_INIT 0
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern void of_once(of_once_t *control, void (*func)(void));
#ifdef __cplusplus
}
#endif

Modified src/thread.h from [34fb8d0893] to [a6bfb58593].

43
44
45
46
47
48
49



50
51
52
53
54
55



# define of_thread_is_current(t) pthread_equal(t, pthread_self())
# define of_thread_current pthread_self
#elif defined(OF_WINDOWS)
# define of_thread_is_current(t) (t == GetCurrentThread())
# define of_thread_current GetCurrentThread
#endif




extern bool of_thread_attr_init(of_thread_attr_t *attr);
extern bool of_thread_new(of_thread_t *thread, void (*function)(id), id object,
    const of_thread_attr_t *attr);
extern void of_thread_set_name(const char *name);
extern bool of_thread_join(of_thread_t thread);
extern bool of_thread_detach(of_thread_t thread);










>
>
>






>
>
>
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# define of_thread_is_current(t) pthread_equal(t, pthread_self())
# define of_thread_current pthread_self
#elif defined(OF_WINDOWS)
# define of_thread_is_current(t) (t == GetCurrentThread())
# define of_thread_current GetCurrentThread
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_thread_attr_init(of_thread_attr_t *attr);
extern bool of_thread_new(of_thread_t *thread, void (*function)(id), id object,
    const of_thread_attr_t *attr);
extern void of_thread_set_name(const char *name);
extern bool of_thread_join(of_thread_t thread);
extern bool of_thread_detach(of_thread_t thread);
#ifdef __cplusplus
}
#endif

Modified src/tlskey.h from [b6004072bd] to [35d619259b].

29
30
31
32
33
34
35




36
37



38
39
40
41
42
43
44
#if defined(OF_HAVE_PTHREADS)
# include <pthread.h>
typedef pthread_key_t of_tlskey_t;
#elif defined(OF_WINDOWS)
# include <windows.h>
typedef DWORD of_tlskey_t;
#endif




extern bool of_tlskey_new(of_tlskey_t *key);
extern bool of_tlskey_free(of_tlskey_t key);




/* TLS keys are inlined for performance. */

#if defined(OF_HAVE_PTHREADS)
static OF_INLINE void *
of_tlskey_get(of_tlskey_t key)
{







>
>
>
>


>
>
>







29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#if defined(OF_HAVE_PTHREADS)
# include <pthread.h>
typedef pthread_key_t of_tlskey_t;
#elif defined(OF_WINDOWS)
# include <windows.h>
typedef DWORD of_tlskey_t;
#endif

#ifdef __cplusplus
extern "C" {
#endif
extern bool of_tlskey_new(of_tlskey_t *key);
extern bool of_tlskey_free(of_tlskey_t key);
#ifdef __cplusplus
}
#endif

/* TLS keys are inlined for performance. */

#if defined(OF_HAVE_PTHREADS)
static OF_INLINE void *
of_tlskey_get(of_tlskey_t key)
{