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

Exception (VS): static assert to make sure that _HAS_EXCEPTIONS is set #4725

Merged
merged 1 commit into from
Oct 4, 2024
Merged
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
8 changes: 7 additions & 1 deletion Foundation/include/Poco/Exception.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,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
Loading