#pragma once
#include <exception>
#include <typeinfo>
#if defined(__GLIBCXX__)
namespace folly {
namespace exception_tracer {
namespace detail {
void dummyCxaThrow(void*, std::type_info*, void (**)(void*)) noexcept;
void dummyCxaBeginCatch(void*) noexcept;
void dummyCxaRethrow() noexcept;
void dummyCxaEndCatch() noexcept;
void dummyRethrowException(std::exception_ptr) noexcept;
}
using CxaThrowType = decltype(&detail::dummyCxaThrow);
using CxaBeginCatchType = decltype(&detail::dummyCxaBeginCatch);
using CxaRethrowType = decltype(&detail::dummyCxaRethrow);
using CxaEndCatchType = decltype(&detail::dummyCxaEndCatch);
using RethrowExceptionType = decltype(&detail::dummyRethrowException);
void registerCxaThrowCallback(CxaThrowType callback);
void registerCxaBeginCatchCallback(CxaBeginCatchType callback);
void registerCxaRethrowCallback(CxaRethrowType callback);
void registerCxaEndCatchCallback(CxaEndCatchType callback);
void registerRethrowExceptionCallback(RethrowExceptionType callback);
}
}
#endif