old-cross-binutils/include/gdb
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
..
callback.h callback.h:struct host_callback_struct compilation error on Windows hosts. 2014-12-03 13:43:08 +04:00
ChangeLog callback.h:struct host_callback_struct compilation error on Windows hosts. 2014-12-03 13:43:08 +04:00
fileio.h Update copyright years 2014-03-05 22:16:15 +10:30
gdb-index.h Update copyright years 2014-03-05 22:16:15 +10:30
remote-sim.h sim: constify arg to sim_do_command 2014-03-10 22:57:29 -04:00
section-scripts.h * section-scripts.h: New file. 2014-02-09 15:56:36 -08:00
signals.def Update copyright years 2014-03-05 22:16:15 +10:30
signals.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-arm.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-bfin.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sim-cr16.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-d10v.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-frv.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-h8300.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sim-lm32.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sim-m32c.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00
sim-ppc.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-rl78.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-rx.h Update copyright years 2014-03-05 22:16:15 +10:30
sim-sh.h Update Copyright year range in all files maintained by GDB. 2014-01-01 07:54:24 +04:00