From 451b6e393ddc896761e8362fd2b57827ee84cbc5 Mon Sep 17 00:00:00 2001 From: Michael Jerris Date: Wed, 26 Aug 2015 09:28:54 -0400 Subject: [PATCH] FS-8047: [build] fix build errors in mod_rtmp, mod_oreka, and mod_sangoma_codec due to using __FUNCTION__ on newer compilers --- src/mod/applications/mod_oreka/mod_oreka.c | 4 ++-- src/mod/applications/mod_redis/credis.c | 3 +++ src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c | 4 ++-- src/mod/endpoints/mod_rtmp/handshake.h | 4 ++++ 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/src/mod/applications/mod_oreka/mod_oreka.c b/src/mod/applications/mod_oreka/mod_oreka.c index ec7335970c..a21f227b2a 100644 --- a/src/mod/applications/mod_oreka/mod_oreka.c +++ b/src/mod/applications/mod_oreka/mod_oreka.c @@ -454,7 +454,7 @@ static switch_bool_t oreka_audio_callback(switch_media_bug_t *bug, void *user_da for (i = 0; i < linear_len / sizeof(int16_t); i++) { pcmu_data[i] = linear_to_ulaw(linear_samples[i]); } - pcmu_frame.source = __FUNCTION__; + pcmu_frame.source = __SWITCH_FUNC__; pcmu_frame.data = pcmu_data; pcmu_frame.datalen = i; pcmu_frame.payload = 0; @@ -515,7 +515,7 @@ static switch_bool_t oreka_audio_callback(switch_media_bug_t *bug, void *user_da for (i = 0; i < linear_len / sizeof(int16_t); i++) { pcmu_data[i] = linear_to_ulaw(linear_samples[i]); } - pcmu_frame.source = __FUNCTION__; + pcmu_frame.source = __SWITCH_FUNC__; pcmu_frame.data = pcmu_data; pcmu_frame.datalen = i; pcmu_frame.payload = 0; diff --git a/src/mod/applications/mod_redis/credis.c b/src/mod/applications/mod_redis/credis.c index dbb402a7fb..2ab33698ee 100644 --- a/src/mod/applications/mod_redis/credis.c +++ b/src/mod/applications/mod_redis/credis.c @@ -69,6 +69,9 @@ #define CR_VERSION_STRING_SIZE_STR STRINGIFY(CREDIS_VERSION_STRING_SIZE) #ifdef PRINTDEBUG +#if !defined(_MSC_VER) && !defined(__FUNCTION__) +#define __FUNCTION__ (const char *)__func__ +#endif /* add -DPRINTDEBUG to CPPFLAGS in Makefile for debug outputs */ #define DEBUG(...) \ do { \ diff --git a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c index 231bb05189..018a90ba15 100644 --- a/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c +++ b/src/mod/codecs/mod_sangoma_codec/mod_sangoma_codec.c @@ -510,7 +510,7 @@ static switch_status_t switch_sangoma_encode(switch_codec_t *codec, switch_codec /* do the writing */ memset(&linear_frame, 0, sizeof(linear_frame)); - linear_frame.source = __FUNCTION__; + linear_frame.source = __SWITCH_FUNC__; linear_frame.data = decoded_byteswapped_data; linear_frame.datalen = decoded_data_len; linear_frame.payload = linear_payload; @@ -720,7 +720,7 @@ static switch_status_t switch_sangoma_decode(switch_codec_t *codec, /* codec ses /* do the writing */ memset(&encoded_frame, 0, sizeof(encoded_frame)); - encoded_frame.source = __FUNCTION__; + encoded_frame.source = __SWITCH_FUNC__; encoded_frame.data = encoded_data; encoded_frame.datalen = encoded_data_len; encoded_frame.payload = codec->implementation->ianacode; diff --git a/src/mod/endpoints/mod_rtmp/handshake.h b/src/mod/endpoints/mod_rtmp/handshake.h index 8a6e0ec640..5d513ecd28 100644 --- a/src/mod/endpoints/mod_rtmp/handshake.h +++ b/src/mod/endpoints/mod_rtmp/handshake.h @@ -30,6 +30,10 @@ #include #include +#if !defined(_MSC_VER) && !defined(__FUNCTION__) +#define __FUNCTION__ (const char *)__func__ +#endif + #if OPENSSL_VERSION_NUMBER < 0x0090800 || !defined(SHA256_DIGEST_LENGTH) #error Your OpenSSL is too old, need 0.9.8 or newer with SHA256 #endif