From: Mike Frysinger Date: Sun, 7 Nov 2021 01:01:41 +0000 (-0400) Subject: sim: sh: break utime logic out of _WIN32 check X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4a0bb487b8027a317b5c7011d870ae719098e8f0;p=binutils-gdb.git 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. --- 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; }