Browse Source

Further fix std::exception noexcept-related compile error

tags/5.0.0
Stephen Sinclair 8 years ago
parent
commit
ee94a98f96
1 changed files with 12 additions and 4 deletions
  1. +12
    -4
      RtAudio.h

+ 12
- 4
RtAudio.h View File

@@ -52,8 +52,16 @@
#include <exception>
#include <iostream>

#ifndef _GLIBCXX_USE_NOEXCEPT
#define _GLIBCXX_USE_NOEXCEPT
#ifndef _NOEXCEPT
#ifdef _GLIBCXX_NOEXCEPT
#define _NOEXCEPT _GLIBCXX_NOEXCEPT
#else
#ifdef _GLIBCXX_USE_NOEXCEPT
#define _NOEXCEPT _GLIBCXX_USE_NOEXCEPT
#else
#define _NOEXCEPT
#endif
#endif
#endif

/*! \typedef typedef unsigned long RtAudioFormat;
@@ -221,7 +229,7 @@ class RtAudioError : public std::exception
RtAudioError( const std::string& message, Type type = RtAudioError::UNSPECIFIED ) : message_(message), type_(type) {}
//! The destructor.
virtual ~RtAudioError( void ) _GLIBCXX_USE_NOEXCEPT {}
virtual ~RtAudioError( void ) _NOEXCEPT {}

//! Prints thrown error message to stderr.
virtual void printMessage( void ) const { std::cerr << '\n' << message_ << "\n\n"; }
@@ -233,7 +241,7 @@ class RtAudioError : public std::exception
virtual const std::string& getMessage(void) const { return message_; }

//! Returns the thrown error message as a c-style string.
virtual const char* what( void ) const _GLIBCXX_USE_NOEXCEPT { return message_.c_str(); }
virtual const char* what( void ) const _NOEXCEPT { return message_.c_str(); }

protected:
std::string message_;


Loading…
Cancel
Save