aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorRogier <rogier777@gmail.com>2016-12-13 23:16:26 +0100
committerparamat <mat.gregory@virginmedia.com>2016-12-24 00:32:50 +0000
commit4d4b8bb8a46b6472d86fa848954dbc26b4fadb50 (patch)
tree1f6bff842b0ee81027de44d7c27e16a8e4518bbc /src/util
parent2f59a0c840e9101c87e2d59fabf34116b3328121 (diff)
downloadminetest-4d4b8bb8a46b6472d86fa848954dbc26b4fadb50.tar.gz
minetest-4d4b8bb8a46b6472d86fa848954dbc26b4fadb50.tar.bz2
minetest-4d4b8bb8a46b6472d86fa848954dbc26b4fadb50.zip
Move PP() and PP2() macros to basic_macros.h
Instead of redefining them everywhere.
Diffstat (limited to 'src/util')
-rw-r--r--src/util/basic_macros.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/util/basic_macros.h b/src/util/basic_macros.h
index c100b4f25..bd4b890eb 100644
--- a/src/util/basic_macros.h
+++ b/src/util/basic_macros.h
@@ -50,4 +50,13 @@ with this program; if not, write to the Free Software Foundation, Inc.,
#define STATIC_ASSERT(expr, msg) \
UNUSED_ATTRIBUTE typedef char msg[!!(expr) * 2 - 1]
+// Macros to facilitate writing position vectors to a stream
+// Usage:
+// v3s16 pos(1,2,3);
+// mystream << "message " << PP(pos) << std::endl;
+
+#define PP(x) "("<<(x).X<<","<<(x).Y<<","<<(x).Z<<")"
+
+#define PP2(x) "("<<(x).X<<","<<(x).Y<<")"
+
#endif