Mercurial > almixer_isolated
annotate Isolated/SimpleMutex.h @ 79:358b0bd5df43 tip
Added support for Apportable's alcSuspend()/alcResume() in BeginInterruption()/EndInterruption. You must define ALMIXER_USE_APPORTABLE_OPENAL_EXTENSIONS to compile in this support.
author | Eric Wing <ewing@coronalabs.com> |
---|---|
date | Tue, 30 Oct 2012 16:01:30 -0700 |
parents | 398d1cb12448 |
children |
rev | line source |
---|---|
38 | 1 /* Copyright: Eric Wing 2003 */ |
2 | |
3 #ifndef SIMPLE_MUTEX_H | |
4 #define SIMPLE_MUTEX_H | |
5 | |
6 #ifdef __cplusplus | |
7 extern "C" { | |
8 #endif | |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
9 |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
10 #if defined(_WIN32) |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
11 #if defined(SIMPLE_MUTEX_BUILD_LIBRARY) |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
12 #define SIMPLE_MUTEX_DECLSPEC __declspec(dllexport) |
72
398d1cb12448
Bug fix for unbalanced #if/#endif blocks. I think I broke it when removing the dllimport for Windows.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
71
diff
changeset
|
13 #else |
398d1cb12448
Bug fix for unbalanced #if/#endif blocks. I think I broke it when removing the dllimport for Windows.
Eric Wing <ewing . public |-at-| gmail . com>
parents:
71
diff
changeset
|
14 #define SIMPLE_MUTEX_DECLSPEC |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
15 #endif |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
16 #else |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
17 #if defined(SIMPLE_MUTEX_BUILD_LIBRARY) |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
18 #if defined (__GNUC__) && __GNUC__ >= 4 |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
19 #define SIMPLE_MUTEX_DECLSPEC __attribute__((visibility("default"))) |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
20 #else |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
21 #define SIMPLE_MUTEX_DECLSPEC |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
22 #endif |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
23 #else |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
24 #define SIMPLE_MUTEX_DECLSPEC |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
25 #endif |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
26 #endif |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
27 |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
28 #if defined(_WIN32) |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
29 #define SIMPLE_MUTEX_CALL __cdecl |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
30 #else |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
31 #define SIMPLE_MUTEX_CALL |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
32 #endif |
38 | 33 |
34 typedef struct SimpleMutex SimpleMutex; | |
35 | |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
36 extern SIMPLE_MUTEX_DECLSPEC SimpleMutex* SIMPLE_MUTEX_CALL SimpleMutex_CreateMutex(void); |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
37 extern SIMPLE_MUTEX_DECLSPEC void SIMPLE_MUTEX_CALL SimpleMutex_DestroyMutex(SimpleMutex* simple_mutex); |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
38 extern SIMPLE_MUTEX_DECLSPEC int SIMPLE_MUTEX_CALL SimpleMutex_LockMutex(SimpleMutex* simple_mutex); |
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.
Eric Wing <ewing@anscamobile.com>
parents:
38
diff
changeset
|
39 extern SIMPLE_MUTEX_DECLSPEC void SIMPLE_MUTEX_CALL SimpleMutex_UnlockMutex(SimpleMutex* simple_mutex); |
38 | 40 |
41 | |
42 /* Ends C function definitions when using C++ */ | |
43 #ifdef __cplusplus | |
44 } | |
45 #endif | |
46 | |
47 #endif | |
48 |