2024-06-18 18:45:05 +02:00
# pragma once
# include <iostream>
# include <format>
# include <signal.h>
2024-06-27 21:48:01 +02:00
namespace Aquamarine {
bool envEnabled ( const std : : string & env ) ;
} ;
2024-06-18 18:45:05 +02:00
# define RASSERT(expr, reason, ...) \
if ( ! ( expr ) ) { \
std : : cout < < std : : format ( " \n ========================================================================================== \n ASSERTION FAILED! \n \n {} \n \n at: line {} in {} " , \
std : : format ( reason , # # __VA_ARGS__ ) , __LINE__ , \
( [ ] ( ) constexpr - > std : : string { return std : : string ( __FILE__ ) . substr ( std : : string ( __FILE__ ) . find_last_of ( ' / ' ) + 1 ) ; } ) ( ) ) ; \
std : : cout < < " [Aquamarine] Assertion failed! " ; \
raise ( SIGABRT ) ; \
}
# define ASSERT(expr) RASSERT(expr, "?")