diff --git a/arch/sim/src/sim/posix/sim_hostmisc.c b/arch/sim/src/sim/posix/sim_hostmisc.c index a1856b8d4751b..a8b3f2584e4ee 100644 --- a/arch/sim/src/sim/posix/sim_hostmisc.c +++ b/arch/sim/src/sim/posix/sim_hostmisc.c @@ -40,6 +40,12 @@ #include #endif +#if defined __has_include +# if __has_include() +# define SIM_GLIBC_PLATFORM 1 +# endif +#endif + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ @@ -90,10 +96,10 @@ void host_abort(int status) int host_backtrace(void** array, int size) { -#ifdef CONFIG_WINDOWS_CYGWIN - return 0; -#else +#ifdef SIM_GLIBC_PLATFORM return host_uninterruptible(backtrace, array, size); +#else + return 0; #endif }