bfd/ 2008-08-09 Pedro Alves * archive.c (_bfd_archive_bsd_update_armap_timestamp): Cast stat st_mtime to long before comparison. gdb/ 2008-08-09 Pedro Alves * buildsym.c (start_subfile): Cast sentinel NULL to void*. * cp-name-parser.y: Include "config.h". * posix-hdep.c [__GO32__]: Include time.h. * xml-tdesc.c (fetch_xml_from_file): Cast sentinel NULL to void*. * gdb_select.h: Include sys/types.h if available. * go32-nat.c (fetch_register, store_register): Pass the regcache gdbarch to i386_fp_regnum_p and i386_fpc_regnum_p. (go32_xfer_memory): Change type of myaddr parameter to gdb_byte. (struct seg_descr, struct seg_descr): Don't pack byte sized members. readline/ 2008-08-09 Pedro Alves * signals.c (rl_set_sighandler): Guard access to SIGWINCH. * wcwidth.c [__GO32__]: Include wctype.h before wchar.h. --- bfd/archive.c | 2 +- gdb/buildsym.c | 2 +- gdb/cp-name-parser.y | 1 + gdb/gdb_select.h | 4 ++++ gdb/go32-nat.c | 18 ++++++++++-------- gdb/posix-hdep.c | 6 ++++++ gdb/xml-tdesc.c | 2 +- readline/signals.c | 4 ++++ readline/support/wcwidth.c | 5 +++++ 9 files changed, 33 insertions(+), 11 deletions(-) Index: src/gdb/buildsym.c =================================================================== --- src.orig/gdb/buildsym.c +++ src/gdb/buildsym.c @@ -547,7 +547,7 @@ start_subfile (char *name, char *dirname && !IS_ABSOLUTE_PATH (subfile->name) && subfile->dirname != NULL) subfile_name = concat (subfile->dirname, SLASH_STRING, - subfile->name, NULL); + subfile->name, (void*) NULL); else subfile_name = subfile->name; Index: src/gdb/cp-name-parser.y =================================================================== --- src.orig/gdb/cp-name-parser.y +++ src/gdb/cp-name-parser.y @@ -36,6 +36,7 @@ Boston, MA 02110-1301, USA. */ #include #include +#include "config.h" #include "safe-ctype.h" #include "libiberty.h" #include "demangle.h" Index: src/gdb/posix-hdep.c =================================================================== --- src.orig/gdb/posix-hdep.c +++ src/gdb/posix-hdep.c @@ -24,6 +24,12 @@ #include "gdb_select.h" +#ifdef __GO32__ +/* DJGPP defines the fd_set type in sys/types.h, but `select' goes + here. */ +# include +#endif + /* The strerror() function can return NULL for errno values that are out of range. Provide a "safe" version that always returns a printable string. */ Index: src/gdb/xml-tdesc.c =================================================================== --- src.orig/gdb/xml-tdesc.c +++ src/gdb/xml-tdesc.c @@ -443,7 +443,7 @@ fetch_xml_from_file (const char *filenam if (dirname && *dirname) { - char *fullname = concat (dirname, "/", filename, NULL); + char *fullname = concat (dirname, "/", filename, (void*) NULL); if (fullname == NULL) nomem (0); file = fopen (fullname, FOPEN_RT); Index: src/readline/signals.c =================================================================== --- src.orig/readline/signals.c +++ src/readline/signals.c @@ -251,7 +251,11 @@ rl_set_sighandler (sig, handler, ohandle struct sigaction act; act.sa_handler = handler; +#if defined (SIGWINCH) act.sa_flags = (sig == SIGWINCH) ? SA_RESTART : 0; +#else + act.sa_flags = 0; +#endif sigemptyset (&act.sa_mask); sigemptyset (&ohandler->sa_mask); sigaction (sig, &act, &old_handler); Index: src/readline/support/wcwidth.c =================================================================== --- src.orig/readline/support/wcwidth.c +++ src/readline/support/wcwidth.c @@ -6,6 +6,11 @@ * Markus Kuhn -- 2001-09-08 -- public domain */ +#ifdef __GO32__ +/* DJGPP needs to include this before including wchar.h. */ +# include +#endif + #include struct interval { Index: src/bfd/archive.c =================================================================== --- src.orig/bfd/archive.c +++ src/bfd/archive.c @@ -2311,7 +2311,7 @@ _bfd_archive_bsd_update_armap_timestamp /* Can't read mod time for some reason. */ return TRUE; } - if (archstat.st_mtime <= bfd_ardata (arch)->armap_timestamp) + if (((long) archstat.st_mtime) <= bfd_ardata (arch)->armap_timestamp) /* OK by the linker's rules. */ return TRUE; Index: src/gdb/gdb_select.h =================================================================== --- src.orig/gdb/gdb_select.h +++ src/gdb/gdb_select.h @@ -24,6 +24,10 @@ #include #endif +#ifdef HAVE_SYS_TYPES_H +#include +#endif + #ifdef USE_WIN32API #include #endif Index: src/gdb/go32-nat.c =================================================================== --- src.orig/gdb/go32-nat.c +++ src/gdb/go32-nat.c @@ -176,7 +176,7 @@ static void go32_fetch_registers (struct static void store_register (const struct regcache *, int regno); static void go32_store_registers (struct regcache *, int regno); static void go32_prepare_to_store (struct regcache *); -static int go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, +static int go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, struct mem_attrib *attrib, struct target_ops *target); @@ -465,10 +465,11 @@ go32_wait (ptid_t ptid, struct target_wa static void fetch_register (struct regcache *regcache, int regno) { - if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache))) + struct gdbarch *gdbarch = get_regcache_arch (regcache); + if (regno < gdbarch_fp0_regnum (gdbarch)) regcache_raw_supply (regcache, regno, (char *) &a_tss + regno_mapping[regno].tss_ofs); - else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno)) + else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch, regno)) i387_supply_fsave (regcache, regno, &npx); else internal_error (__FILE__, __LINE__, @@ -493,10 +494,11 @@ go32_fetch_registers (struct regcache *r static void store_register (const struct regcache *regcache, int regno) { - if (regno < gdbarch_fp0_regnum (get_regcache_arch (regcache))) + struct gdbarch *gdbarch = get_regcache_arch (regcache); + if (regno < gdbarch_fp0_regnum (gdbarch)) regcache_raw_collect (regcache, regno, (char *) &a_tss + regno_mapping[regno].tss_ofs); - else if (i386_fp_regnum_p (regno) || i386_fpc_regnum_p (regno)) + else if (i386_fp_regnum_p (gdbarch, regno) || i386_fpc_regnum_p (gdbarch, regno)) i387_collect_fsave (regcache, regno, &npx); else internal_error (__FILE__, __LINE__, @@ -524,7 +526,7 @@ go32_prepare_to_store (struct regcache * } static int -go32_xfer_memory (CORE_ADDR memaddr, char *myaddr, int len, int write, +go32_xfer_memory (CORE_ADDR memaddr, gdb_byte *myaddr, int len, int write, struct mem_attrib *attrib, struct target_ops *target) { if (write) @@ -1263,7 +1265,7 @@ go32_sysinfo (char *arg, int from_tty) struct seg_descr { unsigned short limit0 __attribute__((packed)); unsigned short base0 __attribute__((packed)); - unsigned char base1 __attribute__((packed)); + unsigned char base1; unsigned stype:5 __attribute__((packed)); unsigned dpl:2 __attribute__((packed)); unsigned present:1 __attribute__((packed)); @@ -1272,7 +1274,7 @@ struct seg_descr { unsigned dummy:1 __attribute__((packed)); unsigned bit32:1 __attribute__((packed)); unsigned page_granular:1 __attribute__((packed)); - unsigned char base2 __attribute__((packed)); + unsigned char base2; }; struct gate_descr {