/**
- ** 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.
+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.
"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.
+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.
#include <stdlib.h>
#define strtoumax strtoull
#define strtoimax strtoll
+#define PRIuMAX "llu"
#endif /* __DJGPP__ < 2.04 */
#endif
bootstrap-clean: FRC
cd lib
- $(MAKE) $(MFLAGS) $@
+ -$(MAKE) $(MFLAGS) maintainer-clean
cd ..
cd src
$(MAKE) $(MFLAGS) $@
/^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]*@//
/^[\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\
s| -I\$(srcdir)/../lib||
# Add our local inttypes.h to prerequisites where needed
/^lread\.o:/s|lread\.c|& ../msdos/inttypes.h|
+/^ *test "X/d
/^#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/
/^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@//
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
/^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/
/^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/
/^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/
/^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/
/^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>/
/^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>/
/^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/
/^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/
/^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/
/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]*@/./
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
+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.
/* 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"
#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. */
#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;
}
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)
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. */
/* 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.
#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
#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
#if defined (DARWIN_OS)
#undef init_process
#endif
-#ifndef WINDOWSNT
+#ifndef DOS_NT
#include <sys/select.h>
#endif
#if defined (DARWIN_OS)
#if !defined (HAVE_SELECT)
#define select sys_select
#endif
+
+#ifndef HAVE_PSELECT
+#define pselect sys_select
+#endif