diff --git a/MMDevice/DeviceBase.h b/MMDevice/DeviceBase.h index 883b7e34b..84cef7177 100644 --- a/MMDevice/DeviceBase.h +++ b/MMDevice/DeviceBase.h @@ -1562,7 +1562,7 @@ class CCameraBase : public CDeviceBase virtual long GetNumberOfImages() {return thd_->GetNumberOfImages();} // called from the thread function before exit - virtual void OnThreadExiting() throw() + virtual void OnThreadExiting() { try { @@ -1668,7 +1668,7 @@ class CCameraBase : public CDeviceBase void UpdateActualDuration() {actualDuration_ = camera_->GetCurrentMMTime() - startTime_;} private: - virtual int svc(void) throw() + virtual int svc() { int ret=DEVICE_ERR; try diff --git a/MMDevice/ImageMetadata.h b/MMDevice/ImageMetadata.h index 98f5c8a64..212d7b084 100644 --- a/MMDevice/ImageMetadata.h +++ b/MMDevice/ImageMetadata.h @@ -22,17 +22,6 @@ #pragma once -#ifdef _MSC_VER -#pragma warning(push) -#pragma warning(disable: 4290) // 'C++ exception specification ignored' -#endif - -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic push -// 'dynamic exception specifications are deprecated in C++11 [-Wdeprecated]' -#pragma GCC diagnostic ignored "-Wdeprecated" -#endif - #include "MMDeviceConstants.h" #include @@ -42,6 +31,12 @@ #include #include +#ifdef SWIG +#define MMDEVICE_LEGACY_THROW(ex) throw (ex) +#else +#define MMDEVICE_LEGACY_THROW(ex) +#endif + /////////////////////////////////////////////////////////////////////////////// // MetadataError // ------------- @@ -326,14 +321,14 @@ class Metadata return false; } - MetadataSingleTag GetSingleTag(const char* key) const throw (MetadataKeyError) + MetadataSingleTag GetSingleTag(const char* key) const MMDEVICE_LEGACY_THROW(MetadataKeyError) { MetadataTag* tag = FindTag(key); const MetadataSingleTag* stag = tag->ToSingleTag(); return *stag; } - MetadataArrayTag GetArrayTag(const char* key) const throw (MetadataKeyError) + MetadataArrayTag GetArrayTag(const char* key) const MMDEVICE_LEGACY_THROW(MetadataKeyError) { MetadataTag* tag = FindTag(key); const MetadataArrayTag* atag = tag->ToArrayTag(); @@ -499,11 +494,3 @@ class Metadata typedef std::map::iterator TagIter; typedef std::map::const_iterator TagConstIter; }; - -#if defined(__GNUC__) && !defined(__clang__) -#pragma GCC diagnostic pop -#endif - -#ifdef _MSC_VER -#pragma warning(pop) -#endif