10 /* Some helper functions to get the name from the format enums. */
11 const char *FormatName(ALenum type);
13 /* Easy device init/deinit functions. InitAL returns 0 on success. */
14 int InitAL(char ***argv, int *argc);
17 /* Cross-platform timeget and sleep functions. */
19 void al_nssleep(unsigned long nsec);
21 /* C doesn't allow casting between function and non-function pointer types, so
22 * with C99 we need to use a union to reinterpret the pointer type. Pre-C99
23 * still needs to use a normal cast and live with the warning (C++ is fine with
24 * a regular reinterpret_cast).
26 #if __STDC_VERSION__ >= 199901L
27 #define FUNCTION_CAST(T, ptr) (union{void *p; T f;}){ptr}.f
28 #elif defined(__cplusplus)
29 #define FUNCTION_CAST(T, ptr) reinterpret_cast<T>(ptr)
31 #define FUNCTION_CAST(T, ptr) (T)(ptr)
38 #endif /* ALHELPERS_H */