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/mmo/utils.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/mmo/utils.hpp')
-rw-r--r-- | src/mmo/utils.hpp | 29 |
1 files changed, 13 insertions, 16 deletions
diff --git a/src/mmo/utils.hpp b/src/mmo/utils.hpp index 95c89fc..fc3ea74 100644 --- a/src/mmo/utils.hpp +++ b/src/mmo/utils.hpp @@ -1,5 +1,4 @@ -#ifndef TMWA_MMO_UTILS_HPP -#define TMWA_MMO_UTILS_HPP +#pragma once // utils.hpp - Useful stuff that hasn't been categorized. // // Copyright © ????-2004 Athena Dev Teams @@ -21,21 +20,21 @@ // You should have received a copy of the GNU General Public License // along with this program. If not, see <http://www.gnu.org/licenses/>. -# include "fwd.hpp" +#include "fwd.hpp" -# include <cstring> -# include <ctime> +#include <cstring> +#include <ctime> -# include <type_traits> +#include <type_traits> -# include "../ints/little.hpp" +#include "../ints/little.hpp" -# include "../strings/fwd.hpp" -# include "../strings/vstring.hpp" +#include "../strings/fwd.hpp" +#include "../strings/vstring.hpp" -# include "../generic/operators.hpp" +#include "../generic/operators.hpp" -# include "../io/fwd.hpp" +#include "../io/fwd.hpp" namespace tmwa @@ -149,16 +148,16 @@ void stamp_time(timestamp_milliseconds_buffer&); void log_with_timestamp(io::WriteFile& out, XString line); // TODO VString? -# define TIMESTAMP_DUMMY "YYYY-MM-DD HH:MM:SS" +#define TIMESTAMP_DUMMY "YYYY-MM-DD HH:MM:SS" static_assert(sizeof(TIMESTAMP_DUMMY) == sizeof(timestamp_seconds_buffer), "timestamp size"); -# define WITH_TIMESTAMP(str) str TIMESTAMP_DUMMY +#define WITH_TIMESTAMP(str) str TIMESTAMP_DUMMY // str: prefix: YYYY-MM-DD HH:MM:SS // sizeof: 01234567890123456789012345678 // str + sizeof: ^ // -1: ^ // there's probably a better way to do this now -# define REPLACE_TIMESTAMP(str, t) \ +#define REPLACE_TIMESTAMP(str, t) \ stamp_time( \ reinterpret_cast<timestamp_seconds_buffer *>( \ str + sizeof(str) \ @@ -166,5 +165,3 @@ static_assert(sizeof(TIMESTAMP_DUMMY) == sizeof(timestamp_seconds_buffer), &t \ ) } // namespace tmwa - -#endif // TMWA_MMO_UTILS_HPP |