From 3c350fc7190b5c310446c801439c48d74d621042 Mon Sep 17 00:00:00 2001 From: Evgenii Zheltonozhskii Date: Mon, 18 Dec 2017 15:40:21 +0200 Subject: [PATCH] Replace typeof() gcc extension with decltype() --- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp | 8 ++++---- Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.h | 2 +- .../ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp | 8 ++++---- .../ThirdParty/libtgvoip/os/linux/PulseAudioLoader.cpp | 4 ++-- Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp b/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp index 177474d30..027ba155d 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp +++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputALSA.cpp @@ -17,7 +17,7 @@ using namespace tgvoip::audio; #define BUFFER_SIZE 960 #define CHECK_ERROR(res, msg) if(res<0){LOGE(msg ": %s", _snd_strerror(res));} #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); failed=true; return;} -#define LOAD_FUNCTION(lib, name, ref) {ref=(typeof(ref))dlsym(lib, name); CHECK_DL_ERROR(ref, "Error getting entry point for " name);} +#define LOAD_FUNCTION(lib, name, ref) {ref=(decltype(ref))dlsym(lib, name); CHECK_DL_ERROR(ref, "Error getting entry point for " name);} AudioInputALSA::AudioInputALSA(std::string devID){ isRecording=false; @@ -122,9 +122,9 @@ void AudioInputALSA::EnumerateDevices(std::vector& devs){ if(!lib) return; - _snd_device_name_hint=(typeof(_snd_device_name_hint))dlsym(lib, "snd_device_name_hint"); - _snd_device_name_get_hint=(typeof(_snd_device_name_get_hint))dlsym(lib, "snd_device_name_get_hint"); - _snd_device_name_free_hint=(typeof(_snd_device_name_free_hint))dlsym(lib, "snd_device_name_free_hint"); + _snd_device_name_hint=(decltype(_snd_device_name_hint))dlsym(lib, "snd_device_name_hint"); + _snd_device_name_get_hint=(decltype(_snd_device_name_get_hint))dlsym(lib, "snd_device_name_get_hint"); + _snd_device_name_free_hint=(decltype(_snd_device_name_free_hint))dlsym(lib, "snd_device_name_free_hint"); if(!_snd_device_name_hint || !_snd_device_name_get_hint || !_snd_device_name_free_hint){ dlclose(lib); diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.h b/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.h index 3dd55ce5e..9f05c4a34 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.h +++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioInputPulse.h @@ -11,7 +11,7 @@ #include "../../threading.h" #include -#define DECLARE_DL_FUNCTION(name) typeof(name)* _import_##name +#define DECLARE_DL_FUNCTION(name) decltype(name)* _import_##name namespace tgvoip{ namespace audio{ diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp b/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp index 593edca4f..bad556179 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp +++ b/Telegram/ThirdParty/libtgvoip/os/linux/AudioOutputALSA.cpp @@ -14,7 +14,7 @@ #define BUFFER_SIZE 960 #define CHECK_ERROR(res, msg) if(res<0){LOGE(msg ": %s", _snd_strerror(res));} #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); failed=true; return;} -#define LOAD_FUNCTION(lib, name, ref) {ref=(typeof(ref))dlsym(lib, name); CHECK_DL_ERROR(ref, "Error getting entry point for " name);} +#define LOAD_FUNCTION(lib, name, ref) {ref=(decltype(ref))dlsym(lib, name); CHECK_DL_ERROR(ref, "Error getting entry point for " name);} using namespace tgvoip::audio; @@ -125,9 +125,9 @@ void AudioOutputALSA::EnumerateDevices(std::vector& devs){ if(!lib) return; - _snd_device_name_hint=(typeof(_snd_device_name_hint))dlsym(lib, "snd_device_name_hint"); - _snd_device_name_get_hint=(typeof(_snd_device_name_get_hint))dlsym(lib, "snd_device_name_get_hint"); - _snd_device_name_free_hint=(typeof(_snd_device_name_free_hint))dlsym(lib, "snd_device_name_free_hint"); + _snd_device_name_hint=(decltype(_snd_device_name_hint))dlsym(lib, "snd_device_name_hint"); + _snd_device_name_get_hint=(decltype(_snd_device_name_get_hint))dlsym(lib, "snd_device_name_get_hint"); + _snd_device_name_free_hint=(decltype(_snd_device_name_free_hint))dlsym(lib, "snd_device_name_free_hint"); if(!_snd_device_name_hint || !_snd_device_name_get_hint || !_snd_device_name_free_hint){ dlclose(lib); diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.cpp b/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.cpp index d1008e967..738f6f0dc 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.cpp +++ b/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.cpp @@ -8,9 +8,9 @@ #include #include "../../logging.h" -#define DECLARE_DL_FUNCTION(name) typeof(name)* PulseAudioLoader::_import_##name=NULL +#define DECLARE_DL_FUNCTION(name) decltype(name)* PulseAudioLoader::_import_##name=NULL #define CHECK_DL_ERROR(res, msg) if(!res){LOGE(msg ": %s", dlerror()); dlclose(lib); return false;} -#define LOAD_DL_FUNCTION(name) {_import_##name=(typeof(_import_##name))dlsym(lib, #name); CHECK_DL_ERROR(_import_##name, "Error getting entry point for " #name);} +#define LOAD_DL_FUNCTION(name) {_import_##name=(decltype(_import_##name))dlsym(lib, #name); CHECK_DL_ERROR(_import_##name, "Error getting entry point for " #name);} using namespace tgvoip; diff --git a/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h b/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h index aa34f092c..977899649 100644 --- a/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h +++ b/Telegram/ThirdParty/libtgvoip/os/linux/PulseAudioLoader.h @@ -9,7 +9,7 @@ #include -#define DECLARE_DL_FUNCTION(name) static typeof(name)* _import_##name +#define DECLARE_DL_FUNCTION(name) static decltype(name)* _import_##name namespace tgvoip{ class PulseAudioLoader{