mirror of
https://github.com/cookiengineer/audacity
synced 2025-08-02 08:59:28 +02:00
Replace usage of std::uncaught_exception
* Update minimum MacOS version to 10.12 Sierra * Replace `std::uncaught_exception` with `std::uncaught_exceptions` Signed-off-by: Sol Fisher Romanoff <sol@solfisher.com> Reference-to: https://github.com/tenacityteam/tenacity/pull/481
This commit is contained in:
parent
4e877b8aed
commit
c51b450d6c
@ -66,7 +66,7 @@ cmake_policy( SET CMP0075 NEW )
|
|||||||
|
|
||||||
# Definitions that must happen before the project() command
|
# Definitions that must happen before the project() command
|
||||||
if( APPLE )
|
if( APPLE )
|
||||||
set( MIN_MACOS_VERSION 10.9 )
|
set( MIN_MACOS_VERSION 10.12 )
|
||||||
set( TARGET_MACOS_VERSION 10.13 )
|
set( TARGET_MACOS_VERSION 10.13 )
|
||||||
# Generate schema files
|
# Generate schema files
|
||||||
set( CMAKE_XCODE_GENERATE_SCHEME ON )
|
set( CMAKE_XCODE_GENERATE_SCHEME ON )
|
||||||
|
@ -168,10 +168,10 @@ inline SimpleGuard< void > MakeSimpleGuard() { return {}; }
|
|||||||
|
|
||||||
/*!
|
/*!
|
||||||
Executes a given function (typically a lamba), in any thread.
|
Executes a given function (typically a lamba), in any thread.
|
||||||
|
|
||||||
If there is any exception, can invoke another given function as handler, which may rethrow that or
|
If there is any exception, can invoke another given function as handler, which may rethrow that or
|
||||||
another exception, but usually just returns the value for the GuardedCall.
|
another exception, but usually just returns the value for the GuardedCall.
|
||||||
|
|
||||||
If AudacityException is handled, then it queues up a delayed handler action for execution later in
|
If AudacityException is handled, then it queues up a delayed handler action for execution later in
|
||||||
the event loop at idle time, on the main thread; typically this informs the user of the error.
|
the event loop at idle time, on the main thread; typically this informs the user of the error.
|
||||||
|
|
||||||
@ -211,7 +211,7 @@ R GuardedCall(
|
|||||||
// At this point, e is the "current" exception, but not "uncaught"
|
// At this point, e is the "current" exception, but not "uncaught"
|
||||||
// unless it was rethrown by handler. handler might also throw some
|
// unless it was rethrown by handler. handler might also throw some
|
||||||
// other exception object.
|
// other exception object.
|
||||||
if (!std::uncaught_exception()) {
|
if (std::uncaught_exceptions() == 0) {
|
||||||
auto pException = std::current_exception(); // This points to e
|
auto pException = std::current_exception(); // This points to e
|
||||||
wxTheApp->CallAfter( [=] { // capture pException by value
|
wxTheApp->CallAfter( [=] { // capture pException by value
|
||||||
try { std::rethrow_exception(pException); }
|
try { std::rethrow_exception(pException); }
|
||||||
|
@ -74,7 +74,7 @@ public:
|
|||||||
~AUPImportPlugin();
|
~AUPImportPlugin();
|
||||||
|
|
||||||
wxString GetPluginStringID() override;
|
wxString GetPluginStringID() override;
|
||||||
|
|
||||||
TranslatableString GetPluginFormatDescription() override;
|
TranslatableString GetPluginFormatDescription() override;
|
||||||
|
|
||||||
ImportHandle Open(const FilePath &fileName,
|
ImportHandle Open(const FilePath &fileName,
|
||||||
@ -235,7 +235,7 @@ wxString AUPImportPlugin::GetPluginStringID()
|
|||||||
{
|
{
|
||||||
return wxT("legacyaup");
|
return wxT("legacyaup");
|
||||||
}
|
}
|
||||||
|
|
||||||
TranslatableString AUPImportPlugin::GetPluginFormatDescription()
|
TranslatableString AUPImportPlugin::GetPluginFormatDescription()
|
||||||
{
|
{
|
||||||
return DESC;
|
return DESC;
|
||||||
@ -478,7 +478,7 @@ bool AUPImportFileHandle::Open()
|
|||||||
char buf[256];
|
char buf[256];
|
||||||
|
|
||||||
int numRead = ff.Read(buf, sizeof(buf));
|
int numRead = ff.Read(buf, sizeof(buf));
|
||||||
|
|
||||||
ff.Close();
|
ff.Close();
|
||||||
|
|
||||||
buf[sizeof(buf) - 1] = '\0';
|
buf[sizeof(buf) - 1] = '\0';
|
||||||
@ -531,7 +531,7 @@ void AUPImportFileHandle::HandleXMLEndTag(const wxChar *tag)
|
|||||||
{
|
{
|
||||||
node.handler->HandleXMLEndTag(tag);
|
node.handler->HandleXMLEndTag(tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
mHandlers.pop_back();
|
mHandlers.pop_back();
|
||||||
|
|
||||||
if (mHandlers.size())
|
if (mHandlers.size())
|
||||||
@ -923,7 +923,7 @@ bool AUPImportFileHandle::HandleTags(XMLTagHandler *&handler)
|
|||||||
{
|
{
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Ignore empty tags
|
// Ignore empty tags
|
||||||
if (!*value)
|
if (!*value)
|
||||||
{
|
{
|
||||||
@ -1199,7 +1199,7 @@ bool AUPImportFileHandle::HandleSimpleBlockFile(XMLTagHandler *&handler)
|
|||||||
{
|
{
|
||||||
FilePath filename;
|
FilePath filename;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
while (*mAttrs)
|
while (*mAttrs)
|
||||||
{
|
{
|
||||||
const wxChar *attr = *mAttrs++;
|
const wxChar *attr = *mAttrs++;
|
||||||
@ -1251,7 +1251,7 @@ bool AUPImportFileHandle::HandleSilentBlockFile(XMLTagHandler *&handler)
|
|||||||
{
|
{
|
||||||
FilePath filename;
|
FilePath filename;
|
||||||
size_t len = 0;
|
size_t len = 0;
|
||||||
|
|
||||||
while (*mAttrs)
|
while (*mAttrs)
|
||||||
{
|
{
|
||||||
const wxChar *attr = *mAttrs++;
|
const wxChar *attr = *mAttrs++;
|
||||||
@ -1527,7 +1527,7 @@ bool AUPImportFileHandle::AddSamples(const FilePath &blockFilename,
|
|||||||
|
|
||||||
// If we are unwinding for an exception, don't do another
|
// If we are unwinding for an exception, don't do another
|
||||||
// potentially throwing operation
|
// potentially throwing operation
|
||||||
if (!std::uncaught_exception())
|
if (std::uncaught_exceptions() == 0)
|
||||||
// If this does throw, let that propagate, don't guard the call
|
// If this does throw, let that propagate, don't guard the call
|
||||||
AddSilence(len);
|
AddSilence(len);
|
||||||
}
|
}
|
||||||
@ -1572,7 +1572,7 @@ bool AUPImportFileHandle::AddSamples(const FilePath &blockFilename,
|
|||||||
samplePtr bufptr = buffer.ptr();
|
samplePtr bufptr = buffer.ptr();
|
||||||
|
|
||||||
size_t framesRead = 0;
|
size_t framesRead = 0;
|
||||||
|
|
||||||
// These cases preserve the logic formerly in BlockFile.cpp,
|
// These cases preserve the logic formerly in BlockFile.cpp,
|
||||||
// which was deleted at commit 98d1468.
|
// which was deleted at commit 98d1468.
|
||||||
if (channels == 1 && format == int16Sample && sf_subtype_is_integer(info.format))
|
if (channels == 1 && format == int16Sample && sf_subtype_is_integer(info.format))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user