]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/util-pre.qh
Declare `stoi` and `itos` when QCC_SUPPORT_INT
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / util-pre.qh
index 3f4c3e57f4f8f2095eafb3fa41f31415572d1d20..f246200378ff5adcccb374212c0972797f4c9661 100644 (file)
@@ -1,6 +1,44 @@
+#ifndef UTIL_PRE_H
+#define UTIL_PRE_H
+
 #ifndef NOCOMPAT
-//# define WORKAROUND_XON010
-//# define COMPAT_XON050_ENGINE
-# define COMPAT_NO_MOD_IS_XONOTIC
-# define COMPAT_XON060_DONTCRASH_CHECKPVS
+    #define COMPAT_NO_MOD_IS_XONOTIC
+#endif
+
+#ifndef QCC_SUPPORT_ACCUMULATE
+    #ifdef GMQCC
+        #define QCC_SUPPORT_ACCUMULATE
+    #endif
+#endif
+
+#ifndef QCC_SUPPORT_NIL
+    #ifdef GMQCC
+        #define QCC_SUPPORT_NIL
+    #endif
+#endif
+
+#ifndef QCC_SUPPORT_INT
+    #define int float
+
+    #define stoi(s) stof(s)
+    #define stob(s) stof(s)
+    #define itos(i) ftos(i)
+#else
+    #define stoi(s) ((int) stof(s))
+    #define stob(s) ((bool) stof(s))
+    #define itos(i) ftos(i)
+#endif
+
+#ifndef QCC_SUPPORT_BOOL
+    #define bool float
+
+    // Boolean Constants
+    const int true     = 1;
+    const int false = 0;
+#endif
+
+// Transitional aliases
+[[deprecated("use true")]] [[alias("true")]] const bool TRUE;
+[[deprecated("use false")]] [[alias("false")]] const bool FALSE;
+
 #endif