32 #ifndef VSMC_INTERNAL_ASSERT_HPP 33 #define VSMC_INTERNAL_ASSERT_HPP 42 #define VSMC_STATIC_ASSERT(cond, msg) static_assert(cond, msg) 44 #if VSMC_NO_RUNTIME_ASSERT 45 #define VSMC_RUNTIME_ASSERT(cond, msg) 46 #else // VSMC_NO_RUNTIME_ASSERT 47 #if VSMC_RUNTIME_ASSERT_AS_EXCEPTION 48 #define VSMC_RUNTIME_ASSERT(cond, msg) \ 51 throw vsmc::RuntimeAssert(msg); \ 54 #else // VSMC_RUNTIME_ASSERT_AS_EXCEPTION 55 #define VSMC_RUNTIME_ASSERT(cond, msg) \ 58 std::fprintf(stderr, "vSMC runtime assertion failded:%s:%d:%s\n", \ 59 __FILE__, __LINE__, msg); \ 63 #endif // VSMC_RUNTIME_ASSERT_AS_EXCEPTION 64 #endif // VSMC_NO_RUNTIME_ASSERT 66 #if VSMC_NO_RUNTIME_WARNING 67 #define VSMC_RUNTIME_WARNING(cond, msg) 68 #else // VSMC_NO_RUNTIME_WARNING 69 #if VSMC_RUNTIME_WARNING_AS_EXCEPTION 70 #define VSMC_RUNTIME_WARNING(cond, msg) \ 73 throw vsmc::RuntimeWarning(msg); \ 76 #else // VSMC_RUNTIME_WARNING_AS_EXCEPTION 77 #define VSMC_RUNTIME_WARNING(cond, msg) \ 80 std::fprintf(stderr, \ 81 "vSMC runtime warning; File: %s; Line: %d\n%s\n", __FILE__, \ 83 std::fflush(stderr); \ 86 #endif // VSMC_RUNTIME_WARNING_AS_EXCEPTION 87 #endif // VSMC_NO_RUNTIME_WARNING 131 #endif // VSMC_INTERNAL_ASSERT_HPP
RuntimeAssert(const std::string &msg)
RuntimeWarning(const char *msg)
RuntimeAssert(const char *msg)
RuntimeWarning(const std::string &msg)