summaryrefslogtreecommitdiffstats
path: root/src/core/common.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2020-04-15 14:05:24 +0200
committeraap <aap@papnet.eu>2020-04-15 14:05:40 +0200
commit90be379bede299aa53bca5027ecc19c356e50f86 (patch)
tree40a5d2e19da49d0007faf39e4762d96d02c6cba2 /src/core/common.h
parentMerge pull request #435 from GTAmodding/appveyor (diff)
downloadre3-90be379bede299aa53bca5027ecc19c356e50f86.tar
re3-90be379bede299aa53bca5027ecc19c356e50f86.tar.gz
re3-90be379bede299aa53bca5027ecc19c356e50f86.tar.bz2
re3-90be379bede299aa53bca5027ecc19c356e50f86.tar.lz
re3-90be379bede299aa53bca5027ecc19c356e50f86.tar.xz
re3-90be379bede299aa53bca5027ecc19c356e50f86.tar.zst
re3-90be379bede299aa53bca5027ecc19c356e50f86.zip
Diffstat (limited to '')
-rw-r--r--src/core/common.h14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/core/common.h b/src/core/common.h
index 7688b182..454b848a 100644
--- a/src/core/common.h
+++ b/src/core/common.h
@@ -23,6 +23,15 @@
#include <rwcore.h>
#include <rpworld.h>
+// gotta put this somewhere
+#ifdef LIBRW
+#define STREAMPOS(str) ((str)->tell())
+#define STREAMFILE(str) (((rw::StreamFile*)(str))->file)
+#else
+#define STREAMPOS(str) ((str)->Type.memory.position)
+#define STREAMFILE(str) ((str)->Type.file.fpFile)
+#endif
+
#define rwVENDORID_ROCKSTAR 0x0253F2
// Get rid of bullshit windows definitions, we're not running on an 8086
@@ -39,9 +48,6 @@
#ifndef min
#define min(a,b) ((a) < (b) ? (a) : (b))
#endif
-#ifndef ARRAYSIZE
-#define ARRAYSIZE(a) (sizeof(a) / sizeof(*(a)))
-#endif
typedef uint8_t uint8;
typedef int8_t int8;
@@ -55,7 +61,9 @@ typedef int64_t int64;
// hardcode ucs-2
typedef uint16_t wchar;
+#ifndef nil
#define nil nullptr
+#endif
#include "config.h"