Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef UTILS_CBASE_HPP__
- #define UTILS_CBASE_HPP__ 1
- #include <exception>
- #define CBASE_PROTECT( op ) \
- cbase_seterror( 0 ); \
- try { \
- op \
- } catch( std::exception const& e ) { \
- cbase_seterror( e.what() ); \
- } catch( ... ) { \
- cbase_seterror( "unknown exception" ); \
- } \
- return 0;
- extern "C" {
- char const* cbase_geterror() noexcept;
- char const* cbase_seterror( char const* error ) noexcept;
- bool cbase_log( char const* str ) noexcept;
- void cbase_yield() noexcept;
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement