mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
45 lines
1.4 KiB
C++
45 lines
1.4 KiB
C++
/***************************************************************************
|
|
* Copyright (c) Johan Mabille, Sylvain Corlay and Wolf Vollprecht *
|
|
* Copyright (c) QuantStack *
|
|
* *
|
|
* Distributed under the terms of the BSD 3-Clause License. *
|
|
* *
|
|
* The full license is in the file LICENSE, distributed with this software. *
|
|
****************************************************************************/
|
|
|
|
#ifndef XTL_CONFIG_HPP
|
|
#define XTL_CONFIG_HPP
|
|
|
|
#define XTL_VERSION_MAJOR 0
|
|
#define XTL_VERSION_MINOR 7
|
|
#define XTL_VERSION_PATCH 7
|
|
|
|
#ifndef __has_feature
|
|
#define __has_feature(x) 0
|
|
#endif
|
|
|
|
// Attempt to discover whether we're being compiled with exception support
|
|
#if (defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)) && !defined(XTL_NO_EXCEPTIONS)
|
|
// Exceptions are enabled.
|
|
#else
|
|
#if !defined(XTL_NO_EXCEPTIONS)
|
|
// Exceptions are disabled.
|
|
#define XTL_NO_EXCEPTIONS
|
|
#endif
|
|
#endif
|
|
|
|
#if defined(XTL_NO_EXCEPTIONS)
|
|
|
|
#include <iostream>
|
|
|
|
#define XTL_THROW(_, msg) \
|
|
{ \
|
|
std::cerr << msg << std::endl; \
|
|
std::abort(); \
|
|
}
|
|
#else
|
|
#define XTL_THROW(exception, msg) throw exception(msg)
|
|
#endif
|
|
|
|
#endif
|