From 1872a727b4bf58a6148c1b8f48f4fa56cb948446 Mon Sep 17 00:00:00 2001 From: Vince Date: Mon, 20 Apr 2026 08:26:02 -0700 Subject: [PATCH] Fix conditional inclusion of stdckdint.h Because `__has_include` is on a `#elif` line, it is still being evaluated by the pre-processor regardless of `#if defined`, even if not executed. It must exist on its own gated level inside of the `#if` block rather than at the same level as the `#if` block to function correctly. This fixes a compilation error on a platform which doesn't have `__has_include` available. --- ext/bigdecimal/missing/dtoa.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/ext/bigdecimal/missing/dtoa.c b/ext/bigdecimal/missing/dtoa.c index ba8cd46e..89a370a1 100644 --- a/ext/bigdecimal/missing/dtoa.c +++ b/ext/bigdecimal/missing/dtoa.c @@ -210,10 +210,14 @@ #include #endif -#if defined(HAVE_STDCKDINT_H) || !defined(__has_include) -#elif __has_include() +#if !defined(HAVE_STDCKDINT_H) +#if defined(__has_include) +#if __has_include() # define HAVE_STDCKDINT_H 1 #endif +#endif +#endif + #ifdef HAVE_STDCKDINT_H # include #endif