diff options
author | pippijn <pippijn@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-17 13:38:46 +0000 |
---|---|---|
committer | pippijn <pippijn@e03df62e-2008-0410-955e-edbf42e46eb7> | 2007-07-17 13:38:46 +0000 |
commit | c3c50e894376297209d11d7ce490fd782ba206a4 (patch) | |
tree | 9be715ebde47755110a18bc512e2ef9f37ff7f06 | |
parent | eb8fbc12e2848baf01296eedad75f0d4fb870f79 (diff) |
#ifdeffed out gnu extension
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7463 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r-- | src/modules/json.h | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/src/modules/json.h b/src/modules/json.h index c9fc5c4ff..385b7c559 100644 --- a/src/modules/json.h +++ b/src/modules/json.h @@ -22,9 +22,17 @@ static void unreachable_internal (char const *file, int line, char const *functi static void throw_unless_internal (char const *file, int line, char const *function, char const *condition); static void throw_msg_unless_internal (char const *file, int line, char const *function, char const *message); -#define throw_unreachable unreachable_internal (__FILE__, __LINE__, __PRETTY_FUNCTION__) -#define throw_unless(condition) if (!expect_false (condition)) throw_unless_internal (__FILE__, __LINE__, __PRETTY_FUNCTION__, #condition) -#define throw_msg_unless(condition, message) if (!expect_false (condition)) throw_msg_unless_internal (__FILE__, __LINE__, __PRETTY_FUNCTION__, message) +#ifdef __GNUC__ +# define CURFUNC __PRETTY_FUNCTION__ +#elif defined(__BORLANDC__) +# define CURFUNC __FUNC__ +#else +# define CURFUNC __FUNCTION__ +#endif + +#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 { |