]> git.eshelyaron.com Git - emacs.git/commitdiff
Adapt the MS-DOS build to the latest changes.
authorEli Zaretskii <eliz@gnu.org>
Sat, 30 Jun 2012 15:32:51 +0000 (18:32 +0300)
committerEli Zaretskii <eliz@gnu.org>
Sat, 30 Jun 2012 15:32:51 +0000 (18:32 +0300)
 msdos/mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
 bootstrap-clean (which doesn't exist).
 msdos/inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
 msdos/sedleim.inp (MKDIR_P): Edit to DOS "md" command.
 msdos/sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
 Remove lines that invoke PAXCTL.
 (clean): Fix recipe not to run Unixy shell commands.
 msdos/sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
 (HAVE_STRNCASECMP): Edit to 1.
 msdos/sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
 (C_SWITCH_SYSTEM): Add "-I../msdos".
 msdos/sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
 (GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
 (HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
 (NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
 (NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
 (REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
 (BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
 (mostlyclean-local, distclean-generic): Fix recipe not to run
 Unixy shell commands.

 src/sysselect.h [DOS_NT]: Don't include sys/select.h.
 src/s/ms-w32.h (select, pselect): Don't define here, they are
 defined in sysselect.h
 src/sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
 src/sysdep.c: Don't include dos.h and dosfns.h.
 src/process.c (sys_select):
 src/msdos.c (sys_select): Accept one more argument and ignore it.
 src/msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
 adapt data types and code to that.
 src/dosfns.c:
 src/msdos.c (gettime, settime): Define away the prototypes in dos.h,
 which clashes with the gnulib function of the same name.

 lisp/emacs-lisp/timer.el (timer-until): Subtract results of
 float-time, instead of taking float-time of the result of
 time-subtract, since float-time signals an error for negative time
 arguments.

18 files changed:
lib-src/profile.c
lisp/ChangeLog
lisp/emacs-lisp/timer.el
msdos/ChangeLog
msdos/inttypes.h
msdos/mainmake.v2
msdos/sed1v2.inp
msdos/sed2v2.inp
msdos/sed3v2.inp
msdos/sedleim.inp
msdos/sedlibmk.inp
src/ChangeLog
src/dosfns.c
src/msdos.c
src/process.c
src/s/ms-w32.h
src/sysdep.c
src/sysselect.h

index 3e642237c6bf98da3d20b147f8f44ee823b63387..02471d89da8d8ff161b7ee1f4112b888dd9585e6 100644 (file)
@@ -20,7 +20,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 
 /**
- **  To be run as an emacs process. Input string that starts with:
+ **  To be run as an emacs subprocess.  Input string that starts with:
  **    'z' -- resets the watch (to zero).
  **    'p' -- return time (on stdout) as string with format <sec>.<micro-sec>
  **    'q' -- exit.
index f2fa5a37ac7ae227326260028367b6d5ec290e14..975478e1732a36c7ad0ec8b413431f6e7d31b5b9 100644 (file)
@@ -1,3 +1,10 @@
+2012-06-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * emacs-lisp/timer.el (timer-until): Subtract results of
+       float-time, instead of taking float-time of the result of
+       time-subtract, since float-time signals an error for negative time
+       arguments.
+
 2012-06-30  Stefan Monnier  <monnier@iro.umontreal.ca>
 
        * emacs-lisp/cl-lib.el (cl-pushnew): Use macroexp-let2.
index eab96fe202a986587539fbd240b58c2f0926060e..a66d5972d826533790ac59399463b54b54112356 100644 (file)
@@ -268,7 +268,7 @@ how many will really happen."
   "Calculate number of seconds from when TIMER will run, until TIME.
 TIMER is a timer, and stands for the time when its next repeat is scheduled.
 TIME is a time-list."
-  (float-time (time-subtract time (timer--time timer))))
+  (- (float-time time) (float-time (timer--time timer))))
 
 (defun timer-event-handler (timer)
   "Call the handler for the timer TIMER.
index 1e156563e066eff18915d491c0c0784ac4fad11e..f0c3703f36c9b963409175756671741c41efb961 100644 (file)
@@ -1,3 +1,32 @@
+2012-06-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * mainmake.v2 (bootstrap-clean): Do a maintainer-clean in lib, not
+       bootstrap-clean (which doesn't exist).
+
+       * inttypes.h (PRIuMAX) [__DJGPP__ < 2.04]: Define to "llu".
+
+       * sedleim.inp (MKDIR_P): Edit to DOS "md" command.
+
+       * sed1v2.inp: (LIB_CLOCK_GETTIME): Edit to empty.
+       Remove lines that invoke PAXCTL.
+       (clean): Fix recipe not to run Unixy shell commands.
+
+       * sed2v2.inp (GETTIMEOFDAY_TIMEZONE): Edit to 'struct timezone'.
+       (HAVE_STRNCASECMP): Edit to 1.
+
+       * sed3v2.inp (LIB_CLOCK_GETTIME): Edit to empty.
+       (C_SWITCH_SYSTEM): Add "-I../msdos".
+
+       * sedlibmk.inp (GNULIB_GETTIMEOFDAY, GNULIB_PSELECT)
+       (GNULIB_SELECT, HAVE_STRUCT_TIMEVAL, HAVE_SYS_SELECT_H)
+       (HAVE_SYS_TIME_H, NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H)
+       (NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H, NEXT_SYS_SELECT_H)
+       (NEXT_SYS_TIME_H, REPLACE_GETTIMEOFDAY, REPLACE_PSELECT)
+       (REPLACE_STRUCT_TIMEVAL): Edit to appropriate values.
+       (BUILT_SOURCES): Edit out sys/select.h and sys/time.h.
+       (mostlyclean-local, distclean-generic): Fix recipe not to run
+       Unixy shell commands.
+
 2012-06-26  Paul Eggert  <eggert@cs.ucla.edu>
 
        Clean out last vestiges of the old HAVE_CONFIG_H stuff.
index 6128cbf31557145be4127c4e39475455d467f37a..dba56f837606624930abf8b9195596f97df3740b 100644 (file)
@@ -31,6 +31,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <stdlib.h>
 #define strtoumax strtoull
 #define strtoimax strtoll
+#define PRIuMAX   "llu"
 #endif /* __DJGPP__ < 2.04 */
 
 #endif
index b4837b99fb98014dbee3b2adf5431d3d41153299..e1e646a855cfd8f185977416ffeeae9eb523fde5 100644 (file)
@@ -269,7 +269,7 @@ extraclean:
 
 bootstrap-clean: FRC
        cd lib
-       $(MAKE) $(MFLAGS) $@
+       -$(MAKE) $(MFLAGS) maintainer-clean
        cd ..
        cd src
        $(MAKE) $(MFLAGS) $@
index b9e94afea5118cd19e43109d61bc690c0dca39f6..b2ce4b327dcfd01b661e40ec388e8db3dd5e722d 100644 (file)
@@ -105,6 +105,7 @@ s/\.h\.in/.h-in/
 /^LIBRESOLV *=/s/@LIBRESOLV@//
 /^LIBSELINUX_LIBS *=/s/@LIBSELINUX_LIBS@//
 /^LIB_PTHREAD_SIGMASK *=/s/@[^@\n]*@//
+/^LIB_CLOCK_GETTIME *=/s/@[^@\n]*@//g
 /^LIBGNUTLS_LIBS *=/s/@[^@\n]*@//
 /^LIBGNUTLS_CFLAGS *=/s/@[^@\n]*@//
 /^GETLOADAVG_LIBS *=/s/@[^@\n]*@//
@@ -137,6 +138,8 @@ s/\.h\.in/.h-in/
 /^[\f   ]*$/d
 /^     if test -f/,/^  fi$/c\
        command.com /c if exist .gdbinit rm -f _gdbinit
+/^      *test "X\$(PAXCTL)" = X/d
+/^      *test "\$(CANNOT_DUMP)" = "yes"/d
 /^     if test "\$(CANNOT_DUMP)" =/,/^ else /d
 /^     fi/d
 /^      *LC_ALL=C \$(RUN_TEMACS)/i\
@@ -198,3 +201,4 @@ s/ \$(DBUS_CFLAGS)//
 s| -I\$(srcdir)/../lib||
 # Add our local inttypes.h to prerequisites where needed
 /^lread\.o:/s|lread\.c|& ../msdos/inttypes.h|
+/^      *test "X/d
index 85ab02c877e4d5c15f82e81e63584d3848c60101..853c64fb17875e0c13b8239d00568c81cebd2422 100644 (file)
 /^#undef HAVE_MEMMOVE *$/s/^.*$/#define HAVE_MEMMOVE 1/
 /^#undef HAVE_SETRLIMIT *$/s/^.*$/#define HAVE_SETRLIMIT 1/
 /^#undef HAVE_GETRUSAGE *$/s/^.*$/#define HAVE_GETRUSAGE 1/
+/^#undef GETTIMEOFDAY_TIMEZONE *$/s/^.*$/#define GETTIMEOFDAY_TIMEZONE struct timezone/
 /^#undef HAVE_TM_GMTOFF *$/s/^.*$/#define HAVE_TM_GMTOFF 1/
 /^#undef HAVE_STRUCT_TIMEZONE *$/s/^.*$/#define HAVE_STRUCT_TIMEZONE 1/
 /^#undef HAVE_SIZE_T *$/s/^.*$/#define HAVE_SIZE_T 1/
 /^#undef HAVE_MKSTEMP *$/s/^.*$/#define HAVE_MKSTEMP 1/
+/^#undef HAVE_STRNCASECMP *$/s/^.*$/#define HAVE_STRNCASECMP 1/
 /^#undef HAVE_STRUCT_TM_TM_ZONE *$/s/^.*$/#define HAVE_STRUCT_TM_TM_ZONE 1/
 /^#undef HAVE_SYNC *$/s/^.*$/#define HAVE_SYNC 1/
 /^#undef HAVE___BUILTIN_UNWIND_INIT *$/s/^.*$/#define HAVE___BUILTIN_UNWIND_INIT 1/
index faa57996a25a25f8999566988da2b99220898e35..bfa008b3e81dc373945cdb831f5aefcc5065a3ad 100644 (file)
@@ -35,8 +35,9 @@ s/-DVERSION[^ ]* //
 /^LIBRESOLV *=/s/@[^@\n]*@//g
 /^LIBS_MAIL *=/s/@[^@\n]*@//g
 /^LIBS_SYSTEM *=/s/@[^@\n]*@//g
+/^LIB_CLOCK_GETTIME *=/s/@[^@\n]*@//g
 /^CFLAGS *=/s!=.*$!=-O2 -g!
-/^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS!
+/^C_SWITCH_SYSTEM *=/s!=.*$!=-DMSDOS -I../msdos!
 /^C_SWITCH_MACHINE *=/s/@C_SWITCH_MACHINE@//
 /^WARN_CFLAGS *=/s/@WARN_CFLAGS@//
 /^WERROR_CFLAGS *=/s/@WERROR_CFLAGS@//
index 41f87d92047d3e9566f856580b5f85b2a9e17265..461a2b7a9ec945dd8903ecdbabb2a5d341932c8f 100644 (file)
@@ -35,6 +35,8 @@ s|\([         ]\)echo|\1djecho|g
 export EMACSLOADPATH=${buildlisppath}\
 RUN_EMACS = ${EMACS} -batch --no-site-file
 
+/^MKDIR_P *=/s,@MKDIR_P@,command.com /c md,
+
 /^     cd ../c\
        ${MAKE} -C ../src ${MFLAGS} emacs
 
index 31335e1e8c69e7119c0b2751d1a99b181ad60aec..40b94acf107d0f7a8c5cb49c52abbe92bd48cc46 100644 (file)
@@ -211,6 +211,7 @@ am__cd = cd
 /^GNULIB_GETPAGESIZE *=/s/@GNULIB_GETPAGESIZE@/0/
 /^GNULIB_GL_UNISTD_H_GETOPT *=/s/@GNULIB_GL_UNISTD_H_GETOPT@/1/
 /^GNULIB_GETSUBOPT *=/s/@GNULIB_GETSUBOPT@/0/
+/^GNULIB_GETTIMEOFDAY *=/s/@GNULIB_GETTIMEOFDAY@/0/
 /^GNULIB_GETUSERSHELL *=/s/@GNULIB_GETUSERSHELL@/0/
 /^GNULIB_GRANTPT *=/s/@GNULIB_GRANTPT@/0/
 /^GNULIB_GROUP_MEMBER *=/s/@GNULIB_GROUP_MEMBER@/0/
@@ -246,6 +247,7 @@ am__cd = cd
 /^GNULIB_PREAD *=/s/@GNULIB_PREAD@/0/
 /^GNULIB_PRINTF *=/s/@GNULIB_PRINTF@/0/
 /^GNULIB_PRINTF_POSIX *=/s/@GNULIB_PRINTF_POSIX@/0/
+/^GNULIB_PSELECT *=/s/@GNULIB_PSELECT@/0/
 /^GNULIB_PTHREAD_SIGMASK *=/s/@GNULIB_PTHREAD_SIGMASK@/0/
 /^GNULIB_PTSNAME *=/s/@GNULIB_PTSNAME@/0/
 /^GNULIB_PTSNAME_R *=/s/@GNULIB_PTSNAME_R@/0/
@@ -268,6 +270,7 @@ am__cd = cd
 /^GNULIB_RMDIR *=/s/@GNULIB_RMDIR@/0/
 /^GNULIB_RPMATCH *=/s/@GNULIB_RPMATCH@/0/
 /^GNULIB_SCANF *=/s/@GNULIB_SCANF@/0/
+/^GNULIB_SELECT *=/s/@GNULIB_SELECT@/0/
 /^GNULIB_SETENV *=/s/@GNULIB_SETENV@/0/
 /^GNULIB_SETHOSTNAME *=/s/@GNULIB_SETHOSTNAME@/0/
 /^GNULIB_SIGACTION *=/s/@GNULIB_SIGACTION@/0/
@@ -418,12 +421,15 @@ am__cd = cd
 /^HAVE_STRTOULL *=/s/@HAVE_STRTOULL@/1/
 /^HAVE_STRUCT_SIGACTION_SA_SIGACTION *=/s/@HAVE_STRUCT_SIGACTION_SA_SIGACTION@/0/
 /^HAVE_STRUCT_RANDOM_DATA *=/s/@HAVE_STRUCT_RANDOM_DATA@/0/
+/^HAVE_STRUCT_TIMEVAL *=/s/@HAVE_STRUCT_TIMEVAL@/1/
 /^HAVE_SYMLINK *=/s/@HAVE_SYMLINK@/1/
 /^HAVE_SYMLINKAT *=/s/@HAVE_SYMLINKAT@/0/
 /^HAVE_SYS_BITYPES_H *=/s/@HAVE_SYS_BITYPES_H@/0/
 /^HAVE_SYS_INTTYPES_H *=/s/@HAVE_SYS_INTTYPES_H@/0/
 /^HAVE_SYS_LOADAVG_H *=/s/@HAVE_SYS_LOADAVG_H@/0/
 /^HAVE_SYS_PARAM_H *=/s/@HAVE_SYS_PARAM_H@/1/
+/^HAVE_SYS_SELECT_H *=/s/@HAVE_SYS_SELECT_H@/0/
+/^HAVE_SYS_TIME_H *=/s/@HAVE_SYS_TIME_H@/1/
 /^HAVE_SYS_TYPES_H *=/s/@HAVE_SYS_TYPES_H@/1/
 /^HAVE_TIMEGM *=/s/@HAVE_TIMEGM@/0/
 /^HAVE_TYPE_VOLATILE_SIG_ATOMIC_T *=/s/@HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@/1/
@@ -457,7 +463,9 @@ am__cd = cd
 /^NEXT_AS_FIRST_DIRECTIVE_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
 /^NEXT_AS_FIRST_DIRECTIVE_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
 /^NEXT_AS_FIRST_DIRECTIVE_STDLIB_H *=/s/@[^@\n]*@/<stdlib.h>/
+/^NEXT_AS_FIRST_DIRECTIVE_SYS_SELECT_H *=/s/@[^@\n]*@//
 /^NEXT_AS_FIRST_DIRECTIVE_SYS_STAT_H *=/s!@[^@\n]*@!<sys/stat.h>!
+/^NEXT_AS_FIRST_DIRECTIVE_SYS_TIME_H *=/s/@[^@\n]*@//
 /^NEXT_AS_FIRST_DIRECTIVE_SYS_TYPES_H *=/s!@[^@\n]*@!<sys/types.h>!
 /^NEXT_AS_FIRST_DIRECTIVE_TIME_H *=/s/@[^@\n]*@/<time.h>/
 /^NEXT_AS_FIRST_DIRECTIVE_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/
@@ -468,7 +476,9 @@ am__cd = cd
 /^NEXT_STDIO_H *=/s/@[^@\n]*@/<stdio.h>/
 /^NEXT_STDINT_H *=/s/@[^@\n]*@/<stdint.h>/
 /^NEXT_STDLIB_H *=/s/@[^@\n]*@/<stdlib.h>/
+/^NEXT_SYS_SELECT_H *=/s/@[^@\n]*@//
 /^NEXT_SYS_STAT_H *=/s!@[^@\n]*@!<sys/stat.h>!
+/^NEXT_SYS_TIME_H *=/s/@[^@\n]*@//
 /^NEXT_SYS_TYPES_H *=/s!@[^@\n]*@!<sys/types.h>!
 /^NEXT_TIME_H *=/s/@[^@\n]*@/<time.h>/
 /^NEXT_UNISTD_H *=/s/@[^@\n]*@/<unistd.h>/
@@ -507,6 +517,7 @@ am__cd = cd
 /^REPLACE_GETLINE *=/s/@REPLACE_GETLINE@/0/
 /^REPLACE_GETLOGIN_R *=/s/@REPLACE_GETLOGIN_R@/0/
 /^REPLACE_GETPAGESIZE *=/s/@REPLACE_GETPAGESIZE@/0/
+/^REPLACE_GETTIMEOFDAY *=/s/@REPLACE_GETTIMEOFDAY@/0/
 /^REPLACE_ISATTY *=/s/@REPLACE_ISATTY@/0/
 /^REPLACE_LCHOWN *=/s/@REPLACE_LCHOWN@/0/
 /^REPLACE_LINK *=/s/@REPLACE_LINK@/0/
@@ -529,6 +540,7 @@ am__cd = cd
 /^REPLACE_PREAD *=/s/@REPLACE_PREAD@/0/
 /^REPLACE_PRINTF *=/s/@REPLACE_PRINTF@/0/
 /^REPLACE_PTHREAD_SIGMASK *=/s/@REPLACE_PTHREAD_SIGMASK@/0/
+/^REPLACE_PSELECT *=/s/@REPLACE_PSELECT@/0/
 /^REPLACE_PTSNAME_R *=/s/@REPLACE_PTSNAME_R@/0/
 /^REPLACE_PUTENV *=/s/@REPLACE_PUTENV@/0/
 /^REPLACE_PWRITE *=/s/@REPLACE_PWRITE@/0/
@@ -551,6 +563,7 @@ am__cd = cd
 /^REPLACE_STDIO_WRITE_FUNCS *=/s/@REPLACE_STDIO_WRITE_FUNCS@/0/
 /^REPLACE_STRTOD *=/s/@REPLACE_STRTOD@/0/
 /^REPLACE_STRTOIMAX *=/s/@REPLACE_STRTOIMAX@/0/
+/^REPLACE_STRUCT_TIMEVAL *=/s/@REPLACE_STRUCT_TIMEVAL@/0/
 /^REPLACE_SYMLINK *=/s/@REPLACE_SYMLINK@/0/
 /^REPLACE_TIMEGM *=/s/@REPLACE_TIMEGM@/0/
 /^REPLACE_TMPFILE *=/s/@REPLACE_TMPFILE@/0/
@@ -588,6 +601,10 @@ am__cd = cd
 /am__append_2 *=.*verify\.h/s/@[^@\n]*@//
 /^gl_LIBOBJS *=/s/@[^@\n]*@/getopt.o getopt1.o strftime.o time_r.o getloadavg.o pthread_sigmask.o/
 /^BUILT_SOURCES *=/s/ *inttypes\.h//
+/^BUILT_SOURCES *=/,/^[^       ]/{
+  s| *sys/select\.h||
+  s| *sys/time\.h||
+}
 /^am_libgnu_a_OBJECTS *=/s/careadlinkat\.\$(OBJEXT)//
 /^am_libgnu_a_OBJECTS *=/s/allocator\.\$(OBJEXT)//
 /^srcdir *=/s/@[^@\n]*@/./
@@ -661,3 +678,6 @@ s/\.in-h\;  *\\$/.in-h >> $@-t/
   s/'\; \\ *$/' >> $@-t/
 }
 s!\$(MKDIR_P)[         ][      ]*sys!command.com /c "if not exist sys\\stat.h md sys"!
+/^     @for dir in/,/^[^        ]/c\
+       -rm -rf $(MOSTLYCLEANDIRS)
+/^      *-test . /d
index 4f3c229481e8089a8a4e97b7077d6417989ec039..c88007fd694f945a9399c64082df2ff5aaf12294 100644 (file)
@@ -1,3 +1,24 @@
+2012-06-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * sysselect.h [DOS_NT]: Don't include sys/select.h.
+
+       * s/ms-w32.h (select, pselect): Don't define here, they are
+       defined in sysselect.h
+
+       * sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
+
+       * sysdep.c: Don't include dos.h and dosfns.h.
+
+       * process.c (sys_select):
+       * msdos.c (sys_select): Accept one more argument and ignore it.
+
+       * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
+       adapt data types and code to that.
+
+       * dosfns.c:
+       * msdos.c (gettime, settime): Define away the prototypes in dos.h,
+       which clashes with the gnulib function of the same name.
+
 2012-06-29  Eli Zaretskii  <eliz@gnu.org>
 
        * xdisp.c (try_window_id): Undo last change.
index 11d2258f614131ee814092cbda416a33701cfcef..0561a94116222d59404b0282362e43d2d4933452 100644 (file)
@@ -23,7 +23,13 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 /* The entire file is within this conditional */
 
 #include <stdio.h>
+/* gettine and settime in dos.h clash with their namesakes from
+   gnulib, so we move out of our way the prototypes in dos.h.  */
+#define gettime dos_h_gettime_
+#define settime dos_h_settime_
 #include <dos.h>
+#undef gettime
+#undef settime
 #include <setjmp.h>
 #include "lisp.h"
 #include "character.h"
index a79fad0ccd4d2605b3c2aba411f42e7dda2a9395..4dec901988b4ba4a342756be6566bf9110c14569 100644 (file)
@@ -31,7 +31,13 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #include <time.h>
 #include <sys/param.h>
 #include <sys/time.h>
+/* gettine and settime in dos.h clash with their namesakes from
+   gnulib, so we move out of our way the prototypes in dos.h.  */
+#define gettime dos_h_gettime_
+#define settime dos_h_settime_
 #include <dos.h>
+#undef gettime
+#undef settime
 #include <errno.h>
 #include <sys/stat.h>    /* for _fixpath */
 #include <unistd.h>     /* for chdir, dup, dup2, etc. */
@@ -103,18 +109,18 @@ int _crt0_startup_flags = (_CRT0_FLAG_UNIX_SBRK | _CRT0_FLAG_FILL_SBRK_MEMORY);
 
 #endif /* not SYSTEM_MALLOC */
 
+/* Return the current timestamp in milliseconds since midnight.  */
 static unsigned long
 event_timestamp (void)
 {
-  struct time t;
+  struct timespec t;
   unsigned long s;
 
   gettime (&t);
-  s = t.ti_min;
-  s *= 60;
-  s += t.ti_sec;
+  s = t.tv_sec;
+  s %= 86400;
   s *= 1000;
-  s += t.ti_hund * 10;
+  s += t.tv_nsec * 1000000;
 
   return s;
 }
@@ -4097,10 +4103,10 @@ dos_yield_time_slice (void)
    because wait_reading_process_output takes care of that.  */
 int
 sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
-           EMACS_TIME *timeout)
+           EMACS_TIME *timeout, void *ignored)
 {
   int check_input;
-  struct time t;
+  struct timespec t;
 
   check_input = 0;
   if (rfds)
@@ -4130,18 +4136,13 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
       EMACS_TIME clnow, cllast, cldiff;
 
       gettime (&t);
-      EMACS_SET_SECS_USECS (cllast, t.ti_sec, t.ti_hund * 10000L);
+      EMACS_SET_SECS_NSECS (cllast, t.tv_sec, t.tv_nsec);
 
       while (!check_input || !detect_input_pending ())
        {
          gettime (&t);
-         EMACS_SET_SECS_USECS (clnow, t.ti_sec, t.ti_hund * 10000L);
+         EMACS_SET_SECS_NSECS (clnow, t.tv_sec, t.tv_nsec);
          EMACS_SUB_TIME (cldiff, clnow, cllast);
-
-         /* When seconds wrap around, we assume that no more than
-            1 minute passed since last `gettime'.  */
-         if (EMACS_TIME_SIGN (cldiff) < 0)
-           EMACS_SET_SECS (cldiff, EMACS_SECS (cldiff) + 60);
          EMACS_SUB_TIME (*timeout, *timeout, cldiff);
 
          /* Stop when timeout value crosses zero.  */
index de7fc14797504d3f561ff35e6c67f19d92a94fd7..be2f537049128b602fce41e79469bbbfa3022a0a 100644 (file)
@@ -6808,7 +6808,7 @@ keyboard_bit_set (fd_set *mask)
 
 /* Defined on msdos.c.  */
 extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
-                      EMACS_TIME *);
+                      EMACS_TIME *, void *);
 
 /* Implementation of wait_reading_process_output, assuming that there
    are no subprocesses.  Used only by the MS-DOS build.
index 38e368e5bd25e62d6e5d23672255d36d65f5e9da..9bfbde31065ebf567c7e5cd52885506ae22cdfab 100644 (file)
@@ -233,8 +233,6 @@ struct sigaction {
 #define read    sys_read
 #define rename  sys_rename
 #define rmdir   sys_rmdir
-#define select  sys_select
-#define pselect  sys_select
 #define sleep   sys_sleep
 #define strerror sys_strerror
 #undef unlink
index 089b7ba5c8e059789d1a5e53790e7ce738d8b083..29e396c914d2e58e047c7980444192809e080432 100644 (file)
@@ -65,8 +65,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifdef MSDOS   /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */
-#include <dos.h>
-#include "dosfns.h"
 #include "msdos.h"
 #include <sys/param.h>
 #endif
index 328372d427c5cd7a51ecb5b155f28df0ebe2f307..27a38fd687f04c7a220b0a7057186c8a2c796870 100644 (file)
@@ -19,7 +19,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #if defined (DARWIN_OS)
 #undef init_process
 #endif
-#ifndef WINDOWSNT
+#ifndef DOS_NT
 #include <sys/select.h>
 #endif
 #if defined (DARWIN_OS)
@@ -52,3 +52,7 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #if !defined (HAVE_SELECT)
 #define select sys_select
 #endif
+
+#ifndef HAVE_PSELECT
+#define pselect sys_select
+#endif