From 619ff345a3fb795d8b867d2e3ba6c1cb494bcb5d Mon Sep 17 00:00:00 2001 From: Paolo Marrone Date: Tue, 9 Jul 2024 12:20:57 +0200 Subject: [PATCH] generate error when platform is not supported --- templates/common/fatica.h | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/templates/common/fatica.h b/templates/common/fatica.h index e0914e5..1e69165 100644 --- a/templates/common/fatica.h +++ b/templates/common/fatica.h @@ -10,7 +10,7 @@ unsigned long long fatica_time_process(void); #if defined(_WIN32) || defined(__CYGWIN__) -#include +# include static ULONGLONG filetime_to_ull(const FILETIME* ft) { return (((ULONGLONG)ft->dwHighDateTime) << 32) + ft->dwLowDateTime; @@ -28,13 +28,13 @@ unsigned long long fatica_time_process(void) { #elif defined(__linux__) -#if __STDC_VERSION__ >= 199901L -# define _XOPEN_SOURCE 600 -#else -# define _XOPEN_SOURCE 500 -#endif -#include -#include +# if __STDC_VERSION__ >= 199901L +# define _XOPEN_SOURCE 600 +# else +# define _XOPEN_SOURCE 500 +# endif +# include +# include unsigned long long fatica_time_process(void) { struct timespec ts; @@ -45,9 +45,9 @@ unsigned long long fatica_time_process(void) { #elif defined(__APPLE__) -#include -#include -#include +# include +# include +# include unsigned long long fatica_time_process(void) { thread_t thread = mach_thread_self(); @@ -59,5 +59,7 @@ unsigned long long fatica_time_process(void) { + (info.user_time.microseconds + info.system_time.microseconds) / 1000; } +#else +# error "System not supported" #endif #endif // FATICA_H