From 7af4c5b5c561362cb1135ab504095ae667a9270a Mon Sep 17 00:00:00 2001 From: Ben Longbons Date: Fri, 27 Jun 2014 19:16:45 -0700 Subject: This is more reliable --- src/compat/attr.hpp | 17 +++++++---------- src/compat/cast.hpp | 11 ++++------- src/compat/fun.hpp | 9 +++------ src/compat/fwd.hpp | 7 ++----- src/compat/iter.hpp | 9 +++------ src/compat/memory.hpp | 11 ++++------- src/compat/nullpo.hpp | 23 ++++++++++------------- src/compat/rawmem.hpp | 13 +++++-------- src/compat/time_t.hpp | 9 +++------ 9 files changed, 41 insertions(+), 68 deletions(-) (limited to 'src/compat') diff --git a/src/compat/attr.hpp b/src/compat/attr.hpp index 73fcfc4..238a5d5 100644 --- a/src/compat/attr.hpp +++ b/src/compat/attr.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_ATTR_HPP -#define TMWA_COMPAT_ATTR_HPP +#pragma once // attr.hpp - Attributes. // // Copyright © 2013 Ben Longbons @@ -19,16 +18,14 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" namespace tmwa { -# ifdef __clang__ -# define FALLTHROUGH [[clang::fallthrough]] -# else -# define FALLTHROUGH /* fallthrough */ -# endif +#ifdef __clang__ +# define FALLTHROUGH [[clang::fallthrough]] +#else +# define FALLTHROUGH /* fallthrough */ +#endif } // namespace tmwa - -#endif // TMWA_COMPAT_ATTR_HPP diff --git a/src/compat/cast.hpp b/src/compat/cast.hpp index 38a8997..35dbc62 100644 --- a/src/compat/cast.hpp +++ b/src/compat/cast.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_CAST_HPP -#define TMWA_COMPAT_CAST_HPP +#pragma once // cast.hpp - Change the type of a variable. // // Copyright © 2011-2014 Ben Longbons @@ -19,10 +18,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" -# include -# include +#include +#include namespace tmwa @@ -71,5 +70,3 @@ typename std::remove_pointer::type *sign_cast(U *u) return reinterpret_cast(u); } } // namespace tmwa - -#endif // TMWA_COMPAT_CAST_HPP diff --git a/src/compat/fun.hpp b/src/compat/fun.hpp index 53a0ed6..8073fe7 100644 --- a/src/compat/fun.hpp +++ b/src/compat/fun.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_FUN_HPP -#define TMWA_COMPAT_FUN_HPP +#pragma once // fun.hpp - Functional placeholders. // // Copyright © 2013 Ben Longbons @@ -19,14 +18,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" -# include +#include namespace tmwa { namespace ph = std::placeholders; } // namespace tmwa - -#endif // TMWA_COMPAT_FUN_HPP diff --git a/src/compat/fwd.hpp b/src/compat/fwd.hpp index 729b963..45f3c24 100644 --- a/src/compat/fwd.hpp +++ b/src/compat/fwd.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_FWD_HPP -#define TMWA_COMPAT_FWD_HPP +#pragma once // compat/fwd.hpp - list of type names for compat libs // // Copyright © 2014 Ben Longbons @@ -19,12 +18,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "../sanity.hpp" +#include "../sanity.hpp" namespace tmwa { // meh, add more when I feel like it } // namespace tmwa - -#endif // TMWA_COMPAT_FWD_HPP diff --git a/src/compat/iter.hpp b/src/compat/iter.hpp index 7ed24da..ff146a0 100644 --- a/src/compat/iter.hpp +++ b/src/compat/iter.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_ITER_HPP -#define TMWA_COMPAT_ITER_HPP +#pragma once // iter.hpp - tools for dealing with iterators // // Copyright © 2012-2014 Ben Longbons @@ -19,9 +18,9 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" -# include +#include namespace tmwa @@ -152,5 +151,3 @@ IteratorPair> filter_iterator(C *c, F f=is_truthy) return {FilterIterator(c, f), FilterIterator(c, f)}; } } // namespace tmwa - -#endif // TMWA_COMPAT_ITER_HPP diff --git a/src/compat/memory.hpp b/src/compat/memory.hpp index 702951c..566cc8b 100644 --- a/src/compat/memory.hpp +++ b/src/compat/memory.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_MEMORY_HPP -#define TMWA_COMPAT_MEMORY_HPP +#pragma once // memory.hpp - I forget ... // // Copyright © 2013-2014 Ben Longbons @@ -19,10 +18,10 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" -# include -# include +#include +#include namespace tmwa @@ -45,5 +44,3 @@ typename std::enable_if::value, std::unique_ptr(new E[sz]()); } } // namespace tmwa - -#endif // TMWA_COMPAT_MEMORY_HPP 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(target)); } } // namespace tmwa - -#endif // TMWA_COMPAT_NULLPO_HPP diff --git a/src/compat/rawmem.hpp b/src/compat/rawmem.hpp index dd038be..c271a56 100644 --- a/src/compat/rawmem.hpp +++ b/src/compat/rawmem.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_RAWMEM_HPP -#define TMWA_COMPAT_RAWMEM_HPP +#pragma once // rawmem.hpp - Ignore poisoning and really frob this memory unsafely. // // Copyright © 2013-2014 Ben Longbons @@ -19,11 +18,11 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include -# include -# include +#include +#include +#include -# include "fwd.hpp" +#include "fwd.hpp" namespace tmwa @@ -51,5 +50,3 @@ void really_memset0(uint8_t *dest, size_t n) memset(dest, '\0', n); } } // namespace tmwa - -#endif // TMWA_COMPAT_RAWMEM_HPP diff --git a/src/compat/time_t.hpp b/src/compat/time_t.hpp index 60005d0..9e7cf25 100644 --- a/src/compat/time_t.hpp +++ b/src/compat/time_t.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_COMPAT_TIMET_HPP -#define TMWA_COMPAT_TIMET_HPP +#pragma once // time_t.hpp - time_t with a reliable representation // // Copyright © 2013-2014 Ben Longbons @@ -19,14 +18,12 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see . -# include "fwd.hpp" +#include "fwd.hpp" // TODO fix this ordering violation by promoting TimeT here -# include "../mmo/utils.hpp" +#include "../mmo/utils.hpp" namespace tmwa { } // namespace tmwa - -#endif // TMWA_COMPAT_TIMET_HPP -- cgit v1.2.3-60-g2f50