From 20cb29c2f8c5c87bc590896854a20b1473ceb358 Mon Sep 17 00:00:00 2001 From: "info@mode42.com" Date: Sat, 8 Aug 2026 03:54:55 +0000 Subject: #2 --- include/hybbx/posix_time.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 include/hybbx/posix_time.h (limited to 'include/hybbx/posix_time.h') diff --git a/include/hybbx/posix_time.h b/include/hybbx/posix_time.h new file mode 100644 index 0000000..6790120 --- /dev/null +++ b/include/hybbx/posix_time.h @@ -0,0 +1,21 @@ +#ifndef HYBBX_POSIX_TIME_H +#define HYBBX_POSIX_TIME_H + +/* + * clock_gettime(CLOCK_MONOTONIC) and usleep() on glibc/Linux (GCC 15+ C99). + * Include before / in .c files, or rely on CMake + * _DEFAULT_SOURCE on Linux builds. + */ +#if defined(__linux__) || defined(__GLIBC__) +#ifndef _DEFAULT_SOURCE +#define _DEFAULT_SOURCE 1 +#endif +#endif + +#include + +#if !defined(_WIN32) +#include +#endif + +#endif /* HYBBX_POSIX_TIME_H */ -- cgit v1.3.1