1
+ /*
2
+ * Copyright 2024 The Emscripten Authors. All rights reserved.
3
+ * Emscripten is available under two separate licenses, the MIT license and the
4
+ * University of Illinois/NCSA Open Source License. Both these licenses can be
5
+ * found in the LICENSE file.
6
+ */
7
+
1
8
// So far just does some sanity checks for the available extensions.
2
9
//
3
10
// In the future, could also try to enable different extensions and test for
@@ -16,56 +23,56 @@ static int result = EXIT_SUCCESS;
16
23
17
24
static void end_test () {
18
25
#ifdef __EMSCRIPTEN__
19
- REPORT_RESULT (result );
26
+ REPORT_RESULT (result );
20
27
#endif
21
- exit (result );
28
+ exit (result );
22
29
}
23
30
24
31
#define NUM_ALC_EXTENSIONS 2
25
32
static const ALCchar * alc_extensions [NUM_ALC_EXTENSIONS ] = {
26
- "ALC_SOFT_pause_device" ,
27
- "ALC_SOFT_HRTF" ,
33
+ "ALC_SOFT_pause_device" ,
34
+ "ALC_SOFT_HRTF" ,
28
35
};
29
36
30
37
#define NUM_AL_EXTENSIONS 5
31
38
static const ALCchar * al_extensions [NUM_AL_EXTENSIONS ] = {
32
- "AL_EXT_float32" ,
33
- "AL_SOFT_loop_points" ,
34
- "AL_SOFT_source_length" ,
35
- "AL_EXT_source_distance_model" ,
36
- "AL_SOFT_source_spatialize" ,
39
+ "AL_EXT_float32" ,
40
+ "AL_SOFT_loop_points" ,
41
+ "AL_SOFT_source_length" ,
42
+ "AL_EXT_source_distance_model" ,
43
+ "AL_SOFT_source_spatialize" ,
37
44
};
38
45
39
46
static void check_alc_extension (const ALCchar * extension ) {
40
- ALCdevice * device = alcOpenDevice (NULL );
41
- if (!device ) {
42
- fprintf (stderr , "Failed to open default device." );
43
- result = EXIT_FAILURE ;
44
- return ;
45
- }
47
+ ALCdevice * device = alcOpenDevice (NULL );
48
+ if (!device ) {
49
+ fprintf (stderr , "Failed to open default device." );
50
+ result = EXIT_FAILURE ;
51
+ return ;
52
+ }
46
53
47
- if (alcIsExtensionPresent (device , extension ) != ALC_TRUE ) {
48
- fprintf (stderr , "Extension %s was not present." , extension );
49
- result = EXIT_FAILURE ;
50
- }
54
+ if (alcIsExtensionPresent (device , extension ) != ALC_TRUE ) {
55
+ fprintf (stderr , "Extension %s was not present." , extension );
56
+ result = EXIT_FAILURE ;
57
+ }
51
58
}
52
59
53
60
static void check_al_extension (const ALchar * extension ) {
54
- if (alIsExtensionPresent (extension ) != ALC_TRUE ) {
55
- fprintf (stderr , "Extension %s was not present." , extension );
56
- result = EXIT_FAILURE ;
57
- }
61
+ if (alIsExtensionPresent (extension ) != ALC_TRUE ) {
62
+ fprintf (stderr , "Extension %s was not present." , extension );
63
+ result = EXIT_FAILURE ;
64
+ }
58
65
}
59
66
60
67
int main () {
61
68
62
- for (int i = 0 ; i < NUM_ALC_EXTENSIONS ; i ++ ) {
63
- check_alc_extension (alc_extensions [i ]);
64
- }
69
+ for (int i = 0 ; i < NUM_ALC_EXTENSIONS ; i ++ ) {
70
+ check_alc_extension (alc_extensions [i ]);
71
+ }
65
72
66
- for (int i = 0 ; i < NUM_AL_EXTENSIONS ; i ++ ) {
67
- check_al_extension (al_extensions [i ]);
68
- }
73
+ for (int i = 0 ; i < NUM_AL_EXTENSIONS ; i ++ ) {
74
+ check_al_extension (al_extensions [i ]);
75
+ }
69
76
70
- end_test ();
77
+ end_test ();
71
78
}
0 commit comments