From 189d0adbdcbc480fe3c9c79abf4b3f1df584e0c1 Mon Sep 17 00:00:00 2001 From: shym Date: Thu, 4 Jul 2024 18:01:17 +0200 Subject: [PATCH 01/14] Fix two small issues with preprocessor directives (#13281) * Add missing `defined` in preprocessor test When `HAS_CLOCK_GETTIME_NSEC_NP` is not defined, `#elif HAS_CLOCK_GETTIME_NSEC_NP` triggers a warning * Include `caml/config.h` before `HAS_GETTIMEOFDAY` is tested Also remove a duplicate `errno.h` --- runtime/unix.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/runtime/unix.c b/runtime/unix.c index b5fd4de17b..c0677e09ac 100644 --- a/runtime/unix.c +++ b/runtime/unix.c @@ -27,13 +27,12 @@ #include #include #include +#include "caml/config.h" #ifdef HAS_GETTIMEOFDAY #include #endif #include #include -#include -#include "caml/config.h" #if defined(SUPPORT_DYNAMIC_LINKING) && !defined(BUILDING_LIBCAMLRUNS) #define WITH_DYNAMIC_LINKING #ifdef __CYGWIN__ @@ -47,7 +46,7 @@ #endif #ifdef HAS_POSIX_MONOTONIC_CLOCK #include -#elif HAS_CLOCK_GETTIME_NSEC_NP +#elif defined(HAS_CLOCK_GETTIME_NSEC_NP) #include #endif #ifdef HAS_DIRENT -- 2.45.2