Files
Kevin Newton 957a081892 [ruby/prism] Ship an official C++ interface
The C++ interface is intentionally minimal: it provides only a
couple of niceties in order to largely stay out of the way. It is
mostly used to provide:

* RAII for opaque resources
* Safe up and down casting for nodes
* string_view for various resources
* Iteration over resource lists

Note that if consumers want to use it, they must be on C++17 at
minimum.

https://github.com/ruby/prism/commit/57b8dbe0e9
2026-10-20 22:15:29 +00:00

18 lines
545 B
C++

/**
* @file compiler/exceptions.hpp
*/
#ifndef PRISM_COMPILER_EXCEPTIONS_HPP
#define PRISM_COMPILER_EXCEPTIONS_HPP
/**
* Defined when C++ exceptions are enabled, so that code which catches them can
* still compile in builds that disable them, such as with -fno-exceptions.
* __cpp_exceptions is the standard feature test macro, and older versions of
* GCC and MSVC define __EXCEPTIONS and _CPPUNWIND instead.
*/
#if defined(__cpp_exceptions) || defined(__EXCEPTIONS) || defined(_CPPUNWIND)
# define PRISM_HAS_EXCEPTIONS
#endif
#endif