comparison Isolated/SimpleThread.h @ 56:208a9ed20087

Added explicit symbol visibility markers to audio support files in ALmixer for public headers so they can be built as a dynamic library if needed.
author Eric Wing <ewing@anscamobile.com>
date Tue, 29 May 2012 19:43:23 -0700
parents 71b465ff0622
children 36644b1b940b
comparison
equal deleted inserted replaced
55:8b4f80233969 56:208a9ed20087
3 3
4 #ifdef __cplusplus 4 #ifdef __cplusplus
5 extern "C" { 5 extern "C" {
6 #endif 6 #endif
7 7
8 #if defined(_WIN32)
9 #if defined(SIMPLE_THREAD_BUILD_LIBRARY)
10 #define SIMPLE_THREAD_DECLSPEC __declspec(dllexport)
11 #else
12 #define SIMPLE_THREAD_DECLSPEC __declspec(dllimport)
13 #endif
14 #else
15 #if defined(SIMPLE_THREAD_BUILD_LIBRARY)
16 #if defined (__GNUC__) && __GNUC__ >= 4
17 #define SIMPLE_THREAD_DECLSPEC __attribute__((visibility("default")))
18 #else
19 #define SIMPLE_THREAD_DECLSPEC
20 #endif
21 #else
22 #define SIMPLE_THREAD_DECLSPEC
23 #endif
24 #endif
25
26 #if defined(_WIN32)
27 #define SIMPLE_THREAD_CALL __cdecl
28 #else
29 #define SIMPLE_THREAD_CALL
30 #endif
31
8 #include <stddef.h> 32 #include <stddef.h>
9 33
10 typedef struct SimpleThread SimpleThread; 34 typedef struct SimpleThread SimpleThread;
11 35
12 36
13 SimpleThread* SimpleThread_CreateThread(int (*user_function)(void*), void* user_data); 37 extern SIMPLE_THREAD_DECLSPEC SimpleThread* SIMPLE_THREAD_CALL SimpleThread_CreateThread(int (*user_function)(void*), void* user_data);
14 38
15 size_t SimpleThread_GetCurrentThreadID(void); 39 extern SIMPLE_THREAD_DECLSPEC size_t SIMPLE_THREAD_CALL SimpleThread_GetCurrentThreadID(void);
16 size_t SimpleThread_GetThreadID(SimpleThread* simple_thread); 40 extern SIMPLE_THREAD_DECLSPEC size_t SIMPLE_THREAD_CALL SimpleThread_GetThreadID(SimpleThread* simple_thread);
17 41
18 void SimpleThread_WaitThread(SimpleThread* simple_thread, int* thread_status); 42 extern SIMPLE_THREAD_DECLSPEC void SIMPLE_THREAD_CALL SimpleThread_WaitThread(SimpleThread* simple_thread, int* thread_status);
19 43
20 44
21 int SimpleThread_GetThreadPriority(SimpleThread* simple_thread); 45 extern SIMPLE_THREAD_DECLSPEC int SIMPLE_THREAD_CALL SimpleThread_GetThreadPriority(SimpleThread* simple_thread);
22 void SimpleThread_SetThreadPriority(SimpleThread* simple_thread, int priority_level); 46 extern SIMPLE_THREAD_DECLSPEC void SIMPLE_THREAD_CALL SimpleThread_SetThreadPriority(SimpleThread* simple_thread, int priority_level);
23 47
24 /* Ends C function definitions when using C++ */ 48 /* Ends C function definitions when using C++ */
25 #ifdef __cplusplus 49 #ifdef __cplusplus
26 } 50 }
27 #endif 51 #endif