4
0
mirror of https://github.com/QuasarApp/qca.git synced 2025-05-11 10:19:33 +00:00

build: fix C++11 throwing distructors

For >=C++11, explicitly mark throwing destructors `noexcept(false)`

Thanks: Peter-Levine <plevine457@gmail.com>
This commit is contained in:
Alon Bar-Lev 2017-03-21 12:23:17 +02:00
parent be55b9c98d
commit 5f18ebc705
5 changed files with 11 additions and 5 deletions

@ -1070,7 +1070,7 @@ PREDEFINED = DOXYGEN_SHOULD_SKIP_THIS \
# The macro definition that is found in the sources will be used.
# Use the PREDEFINED tag if you want to use a different macro definition.
EXPAND_AS_DEFINED = QCA_EXPORT
EXPAND_AS_DEFINED = QCA_EXPORT QCA_NOEXCEPT
# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
# doxygen's preprocessor will remove all function-like macros that are alone

@ -107,7 +107,7 @@ void* MemoryMapping_Allocator::alloc_block(u32bit n)
umask(old_umask);
}
~TemporaryFile()
~TemporaryFile() QCA_NOEXCEPT(false)
{
delete[] filepath;
if(fd != -1 && close(fd) == -1)

@ -40,6 +40,12 @@ namespace QCA { // WRAPNS_LINE
#include <string>
namespace QCA { // WRAPNS_LINE
#if __cplusplus >= 201103L
#define QCA_NOEXCEPT(x) noexcept(x)
#else
#define QCA_NOEXCEPT(x)
#endif
namespace Botan {
/*************************************************
@ -58,7 +64,7 @@ class Allocator
virtual void init() {}
virtual void destroy() {}
virtual ~Allocator() {}
virtual ~Allocator() QCA_NOEXCEPT(false) {}
};
/*************************************************

@ -63,7 +63,7 @@ class Pooling_Allocator : public Allocator
void destroy();
Pooling_Allocator(u32bit, bool);
~Pooling_Allocator();
~Pooling_Allocator() QCA_NOEXCEPT(false);
private:
void get_more_core(u32bit);
byte* allocate_blocks(u32bit);

@ -171,7 +171,7 @@ Pooling_Allocator::Pooling_Allocator(u32bit p_size, bool) :
/*************************************************
* Pooling_Allocator Destructor *
*************************************************/
Pooling_Allocator::~Pooling_Allocator()
Pooling_Allocator::~Pooling_Allocator() QCA_NOEXCEPT(false)
{
delete mutex;
if(blocks.size())