mirror of https://github.com/procxx/kepka.git
Replace typeof() gcc extension with decltype()
This commit is contained in:
parent
25b5d2d61f
commit
3c350fc719
Telegram/ThirdParty/libtgvoip/os/linux
|
@ -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<AudioInputDevice>& 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);
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include "../../threading.h"
|
||||
#include <pulse/pulseaudio.h>
|
||||
|
||||
#define DECLARE_DL_FUNCTION(name) typeof(name)* _import_##name
|
||||
#define DECLARE_DL_FUNCTION(name) decltype(name)* _import_##name
|
||||
|
||||
namespace tgvoip{
|
||||
namespace audio{
|
||||
|
|
|
@ -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<AudioOutputDevice>& 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);
|
||||
|
|
|
@ -8,9 +8,9 @@
|
|||
#include <dlfcn.h>
|
||||
#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;
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include <pulse/pulseaudio.h>
|
||||
|
||||
#define DECLARE_DL_FUNCTION(name) static typeof(name)* _import_##name
|
||||
#define DECLARE_DL_FUNCTION(name) static decltype(name)* _import_##name
|
||||
|
||||
namespace tgvoip{
|
||||
class PulseAudioLoader{
|
||||
|
|
Loading…
Reference in New Issue