Skip to content

Commit

Permalink
fix(Exception): static assert to make sure that _HAS_EXCEPTIONS is set (
Browse files Browse the repository at this point in the history
  • Loading branch information
matejk committed Oct 4, 2024
1 parent aab4058 commit 5a0b865
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions Foundation/include/Poco/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@


#include "Poco/Foundation.h"
#include <stdexcept>

#include <exception>

namespace Poco {

Expand Down Expand Up @@ -100,9 +99,15 @@ class Foundation_API Exception: public std::exception
private:
std::string _msg;
Exception* _pNested;
int _code;
int _code;
};

#if defined(_HAS_EXCEPTIONS)
// Size of Poco::Exception depends on the exception settings (like _HAS_EXCEPTIONS)
// that might influence size of std::exception from which Poco::Exception is derived from.
// It is expected that Poco libraries and application using Poco have the same settings.
static_assert(_HAS_EXCEPTIONS != 0);
#endif

//
// inlines
Expand Down

0 comments on commit 5a0b865

Please sign in to comment.