Description: Support non-x86 builds
Author: Kurt Kremitzki <kkremitzki@debian.org>
Last-Updated: 2020-11-19

--- a/libsrc/core/utils.hpp
+++ b/libsrc/core/utils.hpp
@@ -19,7 +19,9 @@
 #ifdef NETGEN_ARCH_AMD64
 #ifdef WIN32
 #include <intrin.h>   // for __rdtsc()  CPU time step counter
-#else
+#define NGCORE_HAVE_RDTSC
+#elif defined __SSE__
+#define NGCORE_HAVE_RDTSC
 #include <x86intrin.h>   // for __rdtsc()  CPU time step counter
 #endif // WIN32
 #endif // NETGEN_ARCH_AMD64
@@ -63,7 +65,7 @@
 
   inline TTimePoint GetTimeCounter() noexcept
   {
-#if defined(NETGEN_ARCH_AMD64)
+#if defined(NETGEN_ARCH_AMD64) || defined(NGCORE_HAVE_RDTSC)
     return __rdtsc();
 #elif defined(NETGEN_ARCH_ARM64)
     unsigned long long tics;
@@ -71,6 +73,8 @@
     return tics;
 #elif defined(__EMSCRIPTEN__) || (defined(_MSC_VER) && defined(_M_ARM64))
     return std::chrono::high_resolution_clock::now().time_since_epoch().count();
+#elifndef NGCORE_HAVE_RDTSC
+    return TTimePoint(std::chrono::steady_clock::now().time_since_epoch().count());
 #else
 #warning "Unsupported CPU architecture"
     return 0;
