From 4a0bb487b8027a317b5c7011d870ae719098e8f0 Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Sat, 6 Nov 2021 21:01:41 -0400 Subject: [PATCH] sim: sh: break utime logic out of _WIN32 check Some _WIN32 targets provide utime (like mingw), so move the header include out from _WIN32 and under the specific HAVE_UTIME_H check. --- sim/sh/interp.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sim/sh/interp.c b/sim/sh/interp.c index ce4d6cd7603..c1b05ddf620 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -45,8 +45,10 @@ #endif #include #include -#ifndef _WIN32 +#ifdef HAVE_UTIME_H #include +#endif +#ifndef _WIN32 #include #endif @@ -1024,7 +1026,12 @@ trap (SIM_DESC sd, int i, int *regs, unsigned char *insn_ptr, int len = strswaplen (regs[5]); strnswap (regs[5], len); +#ifdef HAVE_UTIME_H regs[0] = utime (ptr (regs[5]), (void *) ptr (regs[6])); +#else + errno = ENOSYS; + regs[0] = -1; +#endif strnswap (regs[5], len); break; } -- 2.30.2