diff --git a/src/nvim/log.h b/src/nvim/log.h index a6a4c78707..d92b4629ed 100644 --- a/src/nvim/log.h +++ b/src/nvim/log.h @@ -5,6 +5,7 @@ #include #include "auto/config.h" +#include "nvim/macros.h" #define DEBUG_LOG_LEVEL 0 #define INFO_LOG_LEVEL 1 @@ -68,7 +69,7 @@ # define LOG_CALLSTACK_TO_FILE(fp) log_callstack_to_file(fp, __func__, __LINE__) #endif -#if defined(__has_include) && __has_include("sanitizer/asan_interface.h") +#if NVIM_HAS_INCLUDE("sanitizer/asan_interface.h") # include "sanitizer/asan_interface.h" #endif diff --git a/src/nvim/macros.h b/src/nvim/macros.h index 0bbaa87aba..07dcb4a8e8 100644 --- a/src/nvim/macros.h +++ b/src/nvim/macros.h @@ -152,6 +152,12 @@ #define STR_(x) #x #define STR(x) STR_(x) +#ifndef __has_include +# define NVIM_HAS_INCLUDE(x) 0 +#else +# define NVIM_HAS_INCLUDE __has_include +#endif + #ifndef __has_attribute # define NVIM_HAS_ATTRIBUTE(x) 0 #elif defined(__clang__) && __clang__ == 1 \