summaryrefslogtreecommitdiff
path: root/source/core/common.h
diff options
context:
space:
mode:
authorTim Foley <tfoley@nvidia.com>2017-06-09 11:34:21 -0700
committerTim Foley <tfoley@nvidia.com>2017-06-09 13:44:59 -0700
commitfcf83dbf9effab3bd98bad2b83b2468b7eb05cfd (patch)
tree41047c94883b86ec085a81597391ce3ef557cd43 /source/core/common.h
parent52e8d4b9a27ab0060f874c3a63ab531847be35c0 (diff)
Initial import of code.
Diffstat (limited to 'source/core/common.h')
-rw-r--r--source/core/common.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/source/core/common.h b/source/core/common.h
new file mode 100644
index 000000000..517b018a7
--- /dev/null
+++ b/source/core/common.h
@@ -0,0 +1,48 @@
+#ifndef CORE_LIB_COMMON_H
+#define CORE_LIB_COMMON_H
+
+#include <cstdint>
+
+#ifdef __GNUC__
+#define CORE_LIB_ALIGN_16(x) x __attribute__((aligned(16)))
+#else
+#define CORE_LIB_ALIGN_16(x) __declspec(align(16)) x
+#endif
+
+#define VARIADIC_TEMPLATE
+
+namespace CoreLib
+{
+ typedef int64_t Int64;
+ typedef unsigned short Word;
+#ifdef _M_X64
+ typedef int64_t PtrInt;
+#else
+ typedef int PtrInt;
+#endif
+ namespace Basic
+ {
+ class Object
+ {
+ public:
+ virtual ~Object()
+ {}
+ };
+
+ template <typename T>
+ inline T&& _Move(T & obj)
+ {
+ return static_cast<T&&>(obj);
+ }
+
+ template <typename T>
+ inline void Swap(T & v0, T & v1)
+ {
+ T tmp = _Move(v0);
+ v0 = _Move(v1);
+ v1 = _Move(tmp);
+ }
+ }
+}
+
+#endif