diff options
author | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-27 19:16:45 -0700 |
---|---|---|
committer | Ben Longbons <b.r.longbons@gmail.com> | 2014-06-27 19:33:42 -0700 |
commit | 7af4c5b5c561362cb1135ab504095ae667a9270a (patch) | |
tree | 49ffd3008d7634ba36f3951493a68e928407ce89 /src/compat/nullpo.hpp | |
parent | 8d7f1dadeeb1dc1609b72de5a4ee3a5247b0e9e6 (diff) | |
download | tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.gz tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.bz2 tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.tar.xz tmwa-7af4c5b5c561362cb1135ab504095ae667a9270a.zip |
This is more reliable
Diffstat (limited to 'src/compat/nullpo.hpp')
-rw-r--r-- | src/compat/nullpo.hpp | 23 |
1 files changed, 10 insertions, 13 deletions
diff --git a/src/compat/nullpo.hpp b/src/compat/nullpo.hpp index 6e12f78..5be674a 100644 --- a/src/compat/nullpo.hpp +++ b/src/compat/nullpo.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_NULLPO_HPP -#define TMWA_COMPAT_NULLPO_HPP +#pragma once // nullpo.hpp - Non-fatal pointer assertions. // // Copyright © ????-2004 Athena Dev Teams @@ -31,19 +30,19 @@ /// nullpo_retv(cond) - just return (function returns void) /// nullpo_retr(rv, cond) - return given value instead -# ifndef BUG_FREE -# define nullpo_retr(ret, t) \ +#ifndef BUG_FREE +# define nullpo_retr(ret, t) \ if (nullpo_chk(__FILE__, __LINE__, __PRETTY_FUNCTION__, t)) \ return ret; -# else // BUG_FREE -# define nullpo_retr(ret, t) /*t*/ -# endif // BUG_FREE +#else // BUG_FREE +# define nullpo_retr(ret, t) /*t*/ +#endif // BUG_FREE -# define nullpo_retn(t) nullpo_retr(nullptr, t) -# define nullpo_retz(t) nullpo_retr(0, t) -# define nullpo_retv(t) nullpo_retr(, t) +#define nullpo_retn(t) nullpo_retr(nullptr, t) +#define nullpo_retz(t) nullpo_retr(0, t) +#define nullpo_retv(t) nullpo_retr(, t) -# include "fwd.hpp" +#include "fwd.hpp" namespace tmwa @@ -63,5 +62,3 @@ bool nullpo_chk(const char *file, int line, const char *func, T *target) return nullpo_chk(file, line, func, static_cast<const void *>(target)); } } // namespace tmwa - -#endif // TMWA_COMPAT_NULLPO_HPP |