summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpippijn <pippijn@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-18 09:58:24 +0000
committerpippijn <pippijn@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-18 09:58:24 +0000
commitfed58f5c25915d60d40c0f407914ff7381902f9d (patch)
tree3e99d1bec79d12fd574bd95e175fd148b6326768
parentf6d5937b013077dae0fe29bc85d791e9c74aaeeb (diff)
there were two.. yes, you're right Special
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7472 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_rpc_json.cpp39
1 files changed, 4 insertions, 35 deletions
diff --git a/src/modules/m_rpc_json.cpp b/src/modules/m_rpc_json.cpp
index 4bcb3ba08..0502c7cbd 100644
--- a/src/modules/m_rpc_json.cpp
+++ b/src/modules/m_rpc_json.cpp
@@ -105,41 +105,6 @@ class ModuleRpcJson : public Module
}
};
-static void
-unreachable_internal (char const *file, int line, char const *function)
-{
- char buf[1024];
- snprintf (buf, 1024, "%s (%d) [%s] critical: Unreachable line reached.",
- file, line, function);
-
- throw std::runtime_error (buf);
-}
-
-static void
-throw_unless_internal (char const *file, int line, char const *function, char const *condition)
-{
- char buf[1024];
- snprintf (buf, 1024, "%s (%d) [%s] critical: Assertion `%s' failed.",
- file, line, function, condition);
-
- throw std::runtime_error (buf);
-}
-
-static void
-throw_msg_unless_internal (char const *file, int line, char const *function, char const *message)
-{
- char buf[1024];
- snprintf (buf, 1024, "%s (%d) [%s] critical: %s.",
- file, line, function, message);
-
- throw std::runtime_error (buf);
-}
-
-#define throw_unreachable unreachable_internal (__FILE__, __LINE__, CURFUNC)
-#define throw_unless(condition) if (!expect_false (condition)) throw_unless_internal (__FILE__, __LINE__, CURFUNC, #condition)
-#define throw_msg_unless(condition, message) if (!expect_false (condition)) throw_msg_unless_internal (__FILE__, __LINE__, CURFUNC, message)
-
-
namespace json
{
ValueIteratorBase::ValueIteratorBase ()
@@ -891,6 +856,10 @@ namespace json
throw std::runtime_error (buf);
}
+
+#define throw_unreachable unreachable_internal (__FILE__, __LINE__, CURFUNC)
+#define throw_unless(condition) if (!expect_false (condition)) throw_unless_internal (__FILE__, __LINE__, CURFUNC, #condition)
+#define throw_msg_unless(condition, message) if (!expect_false (condition)) throw_msg_unless_internal (__FILE__, __LINE__, CURFUNC, message)
const Value Value::null;
const int Value::minInt = int (~ (unsigned (-1)/2));