Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MMDevice: Allow compilation with C++17 #489

Merged
merged 1 commit into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions MMDevice/DeviceBase.h
Original file line number Diff line number Diff line change
Expand Up @@ -1562,7 +1562,7 @@ class CCameraBase : public CDeviceBase<MM::Camera, U>
virtual long GetNumberOfImages() {return thd_->GetNumberOfImages();}

// called from the thread function before exit
virtual void OnThreadExiting() throw()
virtual void OnThreadExiting()
{
try
{
Expand Down Expand Up @@ -1668,7 +1668,7 @@ class CCameraBase : public CDeviceBase<MM::Camera, U>
void UpdateActualDuration() {actualDuration_ = camera_->GetCurrentMMTime() - startTime_;}

private:
virtual int svc(void) throw()
virtual int svc()
{
int ret=DEVICE_ERR;
try
Expand Down
29 changes: 8 additions & 21 deletions MMDevice/ImageMetadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <string>
Expand All @@ -42,6 +31,12 @@
#include <stdio.h>
#include <stdlib.h>

#ifdef SWIG
#define MMDEVICE_LEGACY_THROW(ex) throw (ex)
#else
#define MMDEVICE_LEGACY_THROW(ex)
#endif

///////////////////////////////////////////////////////////////////////////////
// MetadataError
// -------------
Expand Down Expand Up @@ -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();
Expand Down Expand Up @@ -499,11 +494,3 @@ class Metadata
typedef std::map<std::string, MetadataTag*>::iterator TagIter;
typedef std::map<std::string, MetadataTag*>::const_iterator TagConstIter;
};

#if defined(__GNUC__) && !defined(__clang__)
#pragma GCC diagnostic pop
#endif

#ifdef _MSC_VER
#pragma warning(pop)
#endif