binutils-gdb/sim/common
Joel Brobecker 2d7bb7580a callback.h:struct host_callback_struct compilation error on Windows hosts.
On Windows, a recent gnulib update imported the lstat module, and
this caused a remote-sim.c build failure in struct host_callback_struct:

    In file included from /[...]/gdb/remote-sim.c:34:0:
    /[...]/gdb/../include/gdb/callback.h:93:9: error: duplicate member '_stati64'
       int (*lstat) (host_callback *, const char *, struct stat *);
             ^
What happens it that gnulib's stat.h makes the following defines:

     /* Large File Support on native Windows.  */
     #if 1
     # define stat _stati64
     #endif

and then:

    #if 1
    # if ! 0
    /* mingw does not support symlinks, therefore it does not have lstat.  But
       without links, stat does just fine.  */
    #  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
    #   define lstat stat
    #  endif

So, the following fields in struct host_callback_struct...

      int (*stat) (host_callback *, const char *, struct stat *);
      int (*fstat) (host_callback *, int, struct stat *);
      int (*lstat) (host_callback *, const char *, struct stat *);

... get translated to...

      int (*_stati64) (host_callback *, const char *, struct _stati64 *);
      int (*_fstati64) (host_callback *, int, struct _stati64 *);
      int (*_stati64) (host_callback *, const char *, struct _stati64 *);

... which causes two fields to have the same name.

This patch fixes the issue by renaming the stat-related fields
by adding a "to_" prefix, similar to what is done in GDB's
target_ops vector.

include/gdb/ChangeLog:

	* callback.h (struct host_callback_struct) <to_stat>: Renamed
	from "stat".
	<to_fstat>: Renamed from "fstat".
	<to_lstat>: Renamed from "lstat".

sim/common/ChangeLog:

	* sim-io.c (sim_io_stat, sim_io_fstat): Adjust calls to "stat"
	and "fstat" callbacks by calls to "to_stat" and "to_fstat" (resp)
	callbacks following renaming in callback.h.
	* syscall.c (cb_syscall): Likewise.  Adjust calls to "lstat"
	callback by call to "to_lstat" callback

sim/cris/ChangeLog:

	* traps.c (cris_break_13_handler): Adjust call to "fstat" callback
	by call to "to_fstat" following renaming in callback.h.

sim/h8300/ChangeLog:

	* compile.c (sim_resume):  Adjust calls to "stat" and "fstat"
	callbacks by calls to "to_stat" and "to_fstat" (resp) callbacks
	following renaming in callback.h.
2014-12-03 13:43:08 +04:00
..
acinclude.m4
aclocal.m4
callback.c
cgen-accfp.c
cgen-cpu.h
cgen-defs.h
cgen-engine.h
cgen-fpu.c
cgen-fpu.h
cgen-mem.h
cgen-ops.h
cgen-par.c
cgen-par.h
cgen-run.c
cgen-scache.c
cgen-scache.h
cgen-sim.h
cgen-trace.c
cgen-trace.h
cgen-types.h
cgen-utils.c
cgen.sh
ChangeLog callback.h:struct host_callback_struct compilation error on Windows hosts. 2014-12-03 13:43:08 +04:00
config.in
configure
configure.ac
create-version.sh
dv-cfi.c
dv-cfi.h
dv-core.c
dv-glue.c
dv-pal.c
dv-sockser.c
dv-sockser.h
gdbinit.in
genmloop.sh
gennltvals.sh
gentmap.c
gentvals.sh
hw-alloc.c
hw-alloc.h
hw-base.c
hw-base.h
hw-device.c
hw-device.h
hw-events.c
hw-events.h
hw-handles.c
hw-handles.h
hw-instances.c
hw-instances.h
hw-main.h
hw-ports.c
hw-ports.h
hw-properties.c
hw-properties.h
hw-tree.c
hw-tree.h
Make-common.in
Makefile.in
nltvals.def
nrun.c
run-sim.h
run.1
run.c
sim-abort.c
sim-alu.h
sim-arange.c
sim-arange.h
sim-assert.h
sim-base.h
sim-basics.h
sim-bits.c
sim-bits.h
sim-command.c
sim-config.c
sim-config.h
sim-core.c
sim-core.h
sim-cpu.c
sim-cpu.h
sim-endian.c
sim-endian.h
sim-engine.c
sim-engine.h
sim-events.c
sim-events.h
sim-fpu.c
sim-fpu.h
sim-hload.c
sim-hrw.c
sim-hw.c
sim-hw.h
sim-info.c
sim-inline.c
sim-inline.h
sim-io.c callback.h:struct host_callback_struct compilation error on Windows hosts. 2014-12-03 13:43:08 +04:00
sim-io.h
sim-load.c
sim-memopt.c
sim-memopt.h
sim-model.c
sim-model.h
sim-module.c
sim-module.h
sim-n-bits.h
sim-n-core.h
sim-n-endian.h
sim-options.c
sim-options.h
sim-profile.c
sim-profile.h
sim-reason.c
sim-reg.c
sim-resume.c
sim-run.c
sim-signal.c
sim-signal.h
sim-stop.c
sim-trace.c
sim-trace.h Shadow SIM's debug_printf function 2014-08-28 11:59:09 +01:00
sim-types.h
sim-utils.c
sim-utils.h
sim-watch.c
sim-watch.h
syscall.c callback.h:struct host_callback_struct compilation error on Windows hosts. 2014-12-03 13:43:08 +04:00
tconfig.in
version.h