diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-11-06 21:01:41 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-11-06 21:03:01 -0400 |
commit | 4a0bb487b8027a317b5c7011d870ae719098e8f0 (patch) | |
tree | 535c0c7801eb5cc6ff7f4c121dd7afcaf2210cab /sim/sh/interp.c | |
parent | 73eef3fc38780753a30954d52b86beb1a281f783 (diff) | |
download | fsf-binutils-gdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.zip fsf-binutils-gdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.tar.gz fsf-binutils-gdb-4a0bb487b8027a317b5c7011d870ae719098e8f0.tar.bz2 |
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.
Diffstat (limited to 'sim/sh/interp.c')
-rw-r--r-- | sim/sh/interp.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/sim/sh/interp.c b/sim/sh/interp.c index ce4d6cd..c1b05dd 100644 --- a/sim/sh/interp.c +++ b/sim/sh/interp.c @@ -45,8 +45,10 @@ #endif #include <time.h> #include <sys/time.h> -#ifndef _WIN32 +#ifdef HAVE_UTIME_H #include <utime.h> +#endif +#ifndef _WIN32 #include <sys/wait.h> #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; } |