summaryrefslogtreecommitdiffstats
path: root/source/Globals.h
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-13 22:47:03 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-02-13 22:47:03 +0100
commit4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c (patch)
treefebea3ecd89c0d4aa83924e430bf11366d754733 /source/Globals.h
parentNew makefile with automatic *.cpp sourcefile import, automatic header file dependencies and switchable debug / release configuration. gnumake-specific :( (diff)
downloadcuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.gz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.bz2
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.lz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.xz
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.tar.zst
cuberite-4f17362aeb80e5339c58a5d3b0fbaeb88d9e701c.zip
Diffstat (limited to 'source/Globals.h')
-rw-r--r--source/Globals.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/source/Globals.h b/source/Globals.h
index 36d174548..2718b8509 100644
--- a/source/Globals.h
+++ b/source/Globals.h
@@ -29,6 +29,8 @@
#include <sys/time.h>
#include <sys/socket.h>
#include <netinet/in.h>
+ #include <arpa/inet.h>
+ #include <netdb.h>
#include <time.h>
#include <dirent.h>
#include <errno.h>
@@ -40,6 +42,7 @@
#include <semaphore.h>
#include <errno.h>
#include <fcntl.h>
+ #include <tr1/memory>
#endif
@@ -49,6 +52,7 @@
// CRT stuff:
#include <assert.h>
#include <stdio.h>
+#include <math.h>
@@ -95,11 +99,28 @@
#ifdef _MSC_VER
#define OBSOLETE __declspec(deprecated)
+ #define ABSTRACT abstract
#else
// TODO: how do other compilers mark functions as obsolete, so that their usage results in a compile-time warning?
#define OBSOLETE
+ // TODO: Can other compilers explicitly mark classes as abstract (no instances can be created)?
+ #define ABSTRACT
#endif
+/// Faster than (int)floorf((float)x / (float)div)
+#define FAST_FLOOR_DIV( x, div ) ( (x) < 0 ? (((int)x / div) - 1) : ((int)x / div) )
+
+
+
+
+
+/// A generic interface used in ForEach() functions
+template <typename Type> class cListCallback
+{
+public:
+ /// Called for each item in the internal list; return true to stop the loop, or false to continue enumerating
+ virtual bool Item(Type * a_Type) = 0;
+} ;