From e7a2c0af762e19c336447e2034ee7ed81f111009 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Fri, 22 Apr 2022 11:24:39 -0700 Subject: Define FUNCTION_CAST in a common header --- examples/alreverb.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'examples/alreverb.c') diff --git a/examples/alreverb.c b/examples/alreverb.c index 0d62e210..11a3ac6b 100644 --- a/examples/alreverb.c +++ b/examples/alreverb.c @@ -67,17 +67,6 @@ static LPALGETAUXILIARYEFFECTSLOTIV alGetAuxiliaryEffectSlotiv; static LPALGETAUXILIARYEFFECTSLOTF alGetAuxiliaryEffectSlotf; static LPALGETAUXILIARYEFFECTSLOTFV alGetAuxiliaryEffectSlotfv; -/* C doesn't allow casting between function and non-function pointer types, so - * with C99 we need to use a union to reinterpret the pointer type. Pre-C99 - * still needs to use a normal cast and live with the warning (C++ is fine with - * a regular reinterpret_cast). - */ -#if __STDC_VERSION__ >= 199901L -#define FUNCTION_CAST(T, ptr) (union{void *p; T f;}){ptr}.f -#else -#define FUNCTION_CAST(T, ptr) (T)(ptr) -#endif - /* LoadEffect loads the given reverb properties into a new OpenAL effect * object, and returns the new effect ID. */ -- cgit v1.2.3