32 #ifndef VSMC_INTERNAL_ASSERT_HPP 33 #define VSMC_INTERNAL_ASSERT_HPP 42 #if VSMC_NO_RUNTIME_ASSERT 43 #define VSMC_RUNTIME_ASSERT(cond, msg) 44 #else // VSMC_NO_RUNTIME_ASSERT 45 #if VSMC_RUNTIME_ASSERT_AS_EXCEPTION 46 #define VSMC_RUNTIME_ASSERT(cond, msg) \ 49 throw vsmc::RuntimeAssert(msg); \ 52 #else // VSMC_RUNTIME_ASSERT_AS_EXCEPTION 53 #define VSMC_RUNTIME_ASSERT(cond, msg) \ 56 std::fprintf(stderr, "vSMC runtime assertion failded:%s:%d:%s\n", \ 57 __FILE__, __LINE__, msg); \ 61 #endif // VSMC_RUNTIME_ASSERT_AS_EXCEPTION 62 #endif // VSMC_NO_RUNTIME_ASSERT 64 #if VSMC_NO_RUNTIME_WARNING 65 #define VSMC_RUNTIME_WARNING(cond, msg) 66 #else // VSMC_NO_RUNTIME_WARNING 67 #if VSMC_RUNTIME_WARNING_AS_EXCEPTION 68 #define VSMC_RUNTIME_WARNING(cond, msg) \ 71 throw vsmc::RuntimeWarning(msg); \ 74 #else // VSMC_RUNTIME_WARNING_AS_EXCEPTION 75 #define VSMC_RUNTIME_WARNING(cond, msg) \ 78 std::fprintf(stderr, \ 79 "vSMC runtime warning; File: %s; Line: %d\n%s\n", __FILE__, \ 81 std::fflush(stderr); \ 84 #endif // VSMC_RUNTIME_WARNING_AS_EXCEPTION 85 #endif // VSMC_NO_RUNTIME_WARNING 110 #endif // VSMC_INTERNAL_ASSERT_HPP
RuntimeAssert(const std::string &msg)
RuntimeWarning(const char *msg)
RuntimeAssert(const char *msg)
RuntimeWarning(const std::string &msg)