From 0100959f06b76367e0237a53936405309b129196 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sat, 30 Apr 2011 13:31:17 +0300 Subject: Adapt the MSDOS build to latest changes. msdos/inttypes.h: New file. msdos/sed2v2.inp (HAVE_DECL_STRTOULL, HAVE_DECL_STRTOUMAX) (HAVE_STRTOULL, HAVE_STRTOULL): Define to 1. src/sedlibmk.inp (BUILT_SOURCES): Edit out inttypes.h. src/sed1v2.inp (CPPFLAGS): Edit to "-I../msdos". Add ../msdos/inttypes.h to prerequisites of lread.o. src/dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)' rather than `XVECTOR (FOO)->size'. --- msdos/ChangeLog | 12 ++++++++++++ msdos/inttypes.h | 31 +++++++++++++++++++++++++++++++ msdos/sed1v2.inp | 5 ++++- msdos/sed2v2.inp | 4 ++++ msdos/sedlibmk.inp | 5 +++-- src/ChangeLog | 3 +++ src/dosfns.c | 6 +++--- 7 files changed, 60 insertions(+), 6 deletions(-) create mode 100644 msdos/inttypes.h diff --git a/msdos/ChangeLog b/msdos/ChangeLog index fa88328e3a6..4e62bd42a4b 100644 --- a/msdos/ChangeLog +++ b/msdos/ChangeLog @@ -1,3 +1,15 @@ +2011-04-30 Eli Zaretskii + + * inttypes.h: New file. + + * sed2v2.inp (HAVE_DECL_STRTOULL, HAVE_DECL_STRTOUMAX) + (HAVE_STRTOULL, HAVE_STRTOULL): Define to 1. + + * sedlibmk.inp (BUILT_SOURCES): Edit out inttypes.h. + + * sed1v2.inp (CPPFLAGS): Edit to "-I../msdos". + Add ../msdos/inttypes.h to prerequisites of lread.o. + 2011-04-24 Eli Zaretskii * sedlibmk.inp (am_libgnu_a_OBJECTS): Edit out diff --git a/msdos/inttypes.h b/msdos/inttypes.h new file mode 100644 index 00000000000..650fea1d0a8 --- /dev/null +++ b/msdos/inttypes.h @@ -0,0 +1,31 @@ +/* Replacement inntypes.h file for building GNU Emacs on MS-DOS with DJGPP. + +Copyright (C) 2011 Free Software Foundation, Inc. + +This file is part of GNU Emacs. + +GNU Emacs is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +GNU Emacs is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with GNU Emacs. If not, see . */ + +#ifndef _REPL_INTTYPES_H +#define _REPL_INTTYPES_H + +#if __DJGPP__ > 2 || __DJGPP_MINOR__ >= 4 +#include_next +#else /* __DJGPP__ < 2.04 */ +#include +#define uintmax_t unsigned long long +#define strtoumax strtoull +#endif /* __DJGPP__ < 2.04 */ + +#endif diff --git a/msdos/sed1v2.inp b/msdos/sed1v2.inp index 2afce070e30..44ee53a5c34 100644 --- a/msdos/sed1v2.inp +++ b/msdos/sed1v2.inp @@ -28,7 +28,8 @@ s/\.h\.in/.h-in/ /^CPP *=/s/@[^@\n]*@/gcc -e/ /^CFLAGS *=/s/@[^@\n]*@/-O2 -gcoff/ /^ALL_CFLAGS *=/s/@[^@\n]*@//g -/^CPPFLAGS *=/s/@[^@\n]*@// +/^ALL_CFLAGS *=/s/ -I\.//g +/^CPPFLAGS *=/s|@[^@\n]*@|-I../msdos| /^LDFLAGS *=/s/@[^@\n]*@// /^LD_FIRSTFLAG *=/s/@[^@\n]*@// /^LIBS *=/s/@[^@\n]*@// @@ -193,3 +194,5 @@ s/\$(LIBOTF_CFLAGS) \$(M17N_FLT_CFLAGS) \$(DEPFLAGS) // s/ \$(C_SWITCH_X_SITE)// s/ \$(DBUS_CFLAGS)// s| -I\$(srcdir)/../lib|| +# Add our local inttypes.h to prerequisites where needed +/^lread\.o:/s|lread\.c|& ../msdos/inttypes.h| diff --git a/msdos/sed2v2.inp b/msdos/sed2v2.inp index 030b69e583f..18144ccf9fc 100644 --- a/msdos/sed2v2.inp +++ b/msdos/sed2v2.inp @@ -100,6 +100,10 @@ s/^#undef POINTER_TYPE *$/#define POINTER_TYPE void/ #else\ #undef HAVE_STDINT_H\ #endif +s/^#undef HAVE_DECL_STRTOULL *$/#define HAVE_DECL_STRTOULL 1/ +s/^#undef HAVE_DECL_STRTOUMAX *$/#define HAVE_DECL_STRTOUMAX 1/ +s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ +s/^#undef HAVE_STRTOULL *$/#define HAVE_STRTOULL 1/ # Comment out any remaining undef directives, because some of them # might be defined in sys/config.h we include at the top of config.h. diff --git a/msdos/sedlibmk.inp b/msdos/sedlibmk.inp index 92313b96421..a99d0229df8 100644 --- a/msdos/sedlibmk.inp +++ b/msdos/sedlibmk.inp @@ -515,8 +515,9 @@ am__cd = cd /^WCHAR_T_SUFFIX *=/s/@WCHAR_T_SUFFIX@/h/ /^WINT_T_SUFFIX *=/s/@WINT_T_SUFFIX@// /^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o strftime.o time_r.o getloadavg.o md5.o filemode.o/ -/^am_libgnu_a_OBJECTS *=/s/careadlinkat.\$(OBJEXT)// -/^am_libgnu_a_OBJECTS *=/s/allocator.\$(OBJEXT)// +/^BUILT_SOURCES *=/s/ *inttypes\.h// +/^am_libgnu_a_OBJECTS *=/s/careadlinkat\.\$(OBJEXT)// +/^am_libgnu_a_OBJECTS *=/s/allocator\.\$(OBJEXT)// /^srcdir *=/s/@[^@\n]*@/./ /^top_srcdir *=/s/@[^@\n]*@/../ /^top_builddir *=/s/@[^@\n]*@/../ diff --git a/src/ChangeLog b/src/ChangeLog index 9c672d38089..32f7052bee3 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,5 +1,8 @@ 2011-04-30 Eli Zaretskii + * dosfns.c (Fint86, Fdos_memget, Fdos_memput): Use `ASIZE (FOO)' + rather than `XVECTOR (FOO)->size'. + * process.c: Remove HAVE_INTTYPES_H condition from inclusion of inttypes.h, as a gnulib replacement is used if it not available in system headers. diff --git a/src/dosfns.c b/src/dosfns.c index 3b9b2dbc038..e903ef20af0 100644 --- a/src/dosfns.c +++ b/src/dosfns.c @@ -62,7 +62,7 @@ REGISTERS should be a vector produced by `make-register' and CHECK_NUMBER (interrupt); no = (unsigned long) XINT (interrupt); CHECK_VECTOR (registers); - if (no < 0 || no > 0xff || XVECTOR (registers)-> size != 8) + if (no < 0 || no > 0xff || ASIZE (registers) != 8) return Qnil; for (i = 0; i < 8; i++) CHECK_NUMBER (XVECTOR (registers)->contents[i]); @@ -102,7 +102,7 @@ Return the updated VECTOR. */) CHECK_NUMBER (address); offs = (unsigned long) XINT (address); CHECK_VECTOR (vector); - len = XVECTOR (vector)-> size; + len = ASIZE (vector); if (len < 1 || len > 2048 || offs < 0 || offs > 0xfffff - len) return Qnil; buf = alloca (len); @@ -125,7 +125,7 @@ DEFUN ("msdos-memput", Fdos_memput, Sdos_memput, 2, 2, 0, CHECK_NUMBER (address); offs = (unsigned long) XINT (address); CHECK_VECTOR (vector); - len = XVECTOR (vector)-> size; + len = ASIZE (vector); if (len < 1 || len > 2048 || offs < 0 || offs > 0xfffff - len) return Qnil; buf = alloca (len); -- cgit v1.2.1