summaryrefslogtreecommitdiff
path: root/src/cpu.cpp
diff options
context:
space:
mode:
authorPatric Stout <truebrain@openttd.org>2020-12-25 20:06:37 +0100
committerPatric Stout <github@truebrain.nl>2020-12-25 20:56:25 +0100
commit6aef1164a4c34d17b60acfb99e61117f35749c98 (patch)
tree93e1194a6bfcce992599f5e9526b4a8c55cd2686 /src/cpu.cpp
parente0b953b80404b37cc5b85a2b88ce0c548ebbc2c8 (diff)
downloadopenttd-6aef1164a4c34d17b60acfb99e61117f35749c98.tar.xz
Fix: [Emscripten] using TIC/TOC on this platform is silly
Stop throwing a warning about this, as it is not likely we will ever implement it.
Diffstat (limited to 'src/cpu.cpp')
-rw-r--r--src/cpu.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/cpu.cpp b/src/cpu.cpp
index 87aa84132..bafa0f735 100644
--- a/src/cpu.cpp
+++ b/src/cpu.cpp
@@ -66,6 +66,12 @@ uint64 ottd_rdtsc()
# define RDTSC_AVAILABLE
#endif
+#if defined(__EMSCRIPTEN__) && !defined(RDTSC_AVAILABLE)
+/* On emscripten doing TIC/TOC would be ill-advised */
+uint64 ottd_rdtsc() {return 0;}
+# define RDTSC_AVAILABLE
+#endif
+
/* In all other cases we have no support for rdtsc. No major issue,
* you just won't be able to profile your code with TIC()/TOC() */
#if !defined(RDTSC_AVAILABLE)