summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
authorHowaner <franzi.moos@googlemail.com>2015-01-25 00:34:19 +0100
committerHowaner <franzi.moos@googlemail.com>2015-01-25 00:34:19 +0100
commit1eedccc56a1a80b42adbea8dbbe968d42c7fe712 (patch)
treea5fe3fb72a3c3918b2c4ba413c686f718f5d403c /src/Globals.h
parentC++11 and function rename. (diff)
parentGamosocm support (diff)
downloadcuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.gz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.bz2
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.lz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.xz
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.tar.zst
cuberite-1eedccc56a1a80b42adbea8dbbe968d42c7fe712.zip
Diffstat (limited to '')
-rw-r--r--src/Globals.h30
1 files changed, 24 insertions, 6 deletions
diff --git a/src/Globals.h b/src/Globals.h
index 61f500db9..654ede95f 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -268,33 +268,47 @@ template class SizeChecker<UInt16, 2>;
#include "OSSupport/StackTrace.h"
#else
// Logging functions
-void inline LOGERROR(const char* a_Format, ...) FORMATSTRING(1, 2);
+void inline LOGERROR(const char * a_Format, ...) FORMATSTRING(1, 2);
-void inline LOGERROR(const char* a_Format, ...)
+void inline LOGERROR(const char * a_Format, ...)
{
va_list argList;
va_start(argList, a_Format);
vprintf(a_Format, argList);
+ putchar('\n');
va_end(argList);
}
-void inline LOGWARNING(const char* a_Format, ...) FORMATSTRING(1, 2);
+void inline LOGWARNING(const char * a_Format, ...) FORMATSTRING(1, 2);
-void inline LOGWARNING(const char* a_Format, ...)
+void inline LOGWARNING(const char * a_Format, ...)
{
va_list argList;
va_start(argList, a_Format);
vprintf(a_Format, argList);
+ putchar('\n');
va_end(argList);
}
-void inline LOGD(const char* a_Format, ...) FORMATSTRING(1, 2);
+void inline LOGD(const char * a_Format, ...) FORMATSTRING(1, 2);
-void inline LOGD(const char* a_Format, ...)
+void inline LOGD(const char * a_Format, ...)
{
va_list argList;
va_start(argList, a_Format);
vprintf(a_Format, argList);
+ putchar('\n');
+ va_end(argList);
+}
+
+void inline LOG(const char * a_Format, ...) FORMATSTRING(1, 2);
+
+void inline LOG(const char * a_Format, ...)
+{
+ va_list argList;
+ va_start(argList, a_Format);
+ vprintf(a_Format, argList);
+ putchar('\n');
va_end(argList);
}
@@ -419,6 +433,9 @@ std::unique_ptr<T> make_unique(Args&&... args)
return std::unique_ptr<T>(new T(args...));
}
+// a tick is 50 ms
+using cTickTime = std::chrono::duration<int, std::ratio_multiply<std::chrono::milliseconds::period, std::ratio<50>>>;
+using cTickTimeLong = std::chrono::duration<Int64, cTickTime::period>;
#ifndef TOLUA_TEMPLATE_BIND
#define TOLUA_TEMPLATE_BIND(x)
@@ -436,3 +453,4 @@ std::unique_ptr<T> make_unique(Args&&... args)
+