fix(Foundation): detection of CXXABI is based on presence of the header file, simplify conditions.

This commit is contained in:
Matej Kenda 2025-02-03 20:53:45 +01:00
parent 269b3b4087
commit ca969f9ec3
2 changed files with 11 additions and 12 deletions

View File

@ -247,12 +247,16 @@
#if defined(__clang__) #if defined(__clang__)
#define POCO_COMPILER_CLANG #define POCO_COMPILER_CLANG
#define POCO_HAVE_CXXABI_H #if __has_include(<cxxabi.h>)
#define POCO_HAVE_CXXABI_H
#endif
#elif defined(_MSC_VER) #elif defined(_MSC_VER)
#define POCO_COMPILER_MSVC #define POCO_COMPILER_MSVC
#elif defined (__GNUC__) #elif defined (__GNUC__)
#define POCO_COMPILER_GCC #define POCO_COMPILER_GCC
#define POCO_HAVE_CXXABI_H #if __has_include(<cxxabi.h>)
#define POCO_HAVE_CXXABI_H
#endif
#if defined (__MINGW32__) || defined (__MINGW64__) #if defined (__MINGW32__) || defined (__MINGW64__)
#define POCO_COMPILER_MINGW #define POCO_COMPILER_MINGW
#endif #endif

View File

@ -21,17 +21,12 @@
#include "Poco/Foundation.h" #include "Poco/Foundation.h"
#include <cstdint> #include <cstdint>
#include <type_traits> #include <type_traits>
#if defined(__clang__) || (defined (__GNUC__) && (__GNUC__ >= 3))
# if (__cplusplus >= 201703L)
# if __has_include(<cxxabi.h>)
# include <typeinfo>
# include <cxxabi.h>
# include <cstdlib>
# define POCO_HAVE_CXXABI_H
# endif // __has_include(<cxxabi.h>)
# endif // __cplusplus >= 201703L
#endif // defined(__clang__) || (defined (__GNUC__) && (__GNUC__ >= 3))
#if defined(POCO_HAVE_CXXABI_H)
#include <typeinfo>
#include <cxxabi.h>
#include <cstdlib>
#endif
namespace Poco { namespace Poco {