aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2012-06-30 18:32:51 +0300
committerEli Zaretskii2012-06-30 18:32:51 +0300
commit0d23c240ea378d9a29042266216f4cf25151a04d (patch)
treedc3d25374540cc607085f405c4692d976ec14834 /src
parent3cfbebba71090f6ea0c2ca4a6056a3e645cee2e8 (diff)
downloademacs-0d23c240ea378d9a29042266216f4cf25151a04d.tar.gz
emacs-0d23c240ea378d9a29042266216f4cf25151a04d.zip
Adapt the MS-DOS build to the latest changes.
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.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog21
-rw-r--r--src/dosfns.c6
-rw-r--r--src/msdos.c29
-rw-r--r--src/process.c2
-rw-r--r--src/s/ms-w32.h2
-rw-r--r--src/sysdep.c2
-rw-r--r--src/sysselect.h6
7 files changed, 48 insertions, 20 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 4f3c229481e..c88007fd694 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,24 @@
12012-06-30 Eli Zaretskii <eliz@gnu.org>
2
3 * sysselect.h [DOS_NT]: Don't include sys/select.h.
4
5 * s/ms-w32.h (select, pselect): Don't define here, they are
6 defined in sysselect.h
7
8 * sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select.
9
10 * sysdep.c: Don't include dos.h and dosfns.h.
11
12 * process.c (sys_select):
13 * msdos.c (sys_select): Accept one more argument and ignore it.
14
15 * msdos.c (event_timestamp, sys_select): Use gnulib's gettime;
16 adapt data types and code to that.
17
18 * dosfns.c:
19 * msdos.c (gettime, settime): Define away the prototypes in dos.h,
20 which clashes with the gnulib function of the same name.
21
12012-06-29 Eli Zaretskii <eliz@gnu.org> 222012-06-29 Eli Zaretskii <eliz@gnu.org>
2 23
3 * xdisp.c (try_window_id): Undo last change. 24 * xdisp.c (try_window_id): Undo last change.
diff --git a/src/dosfns.c b/src/dosfns.c
index 11d2258f614..0561a941162 100644
--- a/src/dosfns.c
+++ b/src/dosfns.c
@@ -23,7 +23,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
23/* The entire file is within this conditional */ 23/* The entire file is within this conditional */
24 24
25#include <stdio.h> 25#include <stdio.h>
26/* gettine and settime in dos.h clash with their namesakes from
27 gnulib, so we move out of our way the prototypes in dos.h. */
28#define gettime dos_h_gettime_
29#define settime dos_h_settime_
26#include <dos.h> 30#include <dos.h>
31#undef gettime
32#undef settime
27#include <setjmp.h> 33#include <setjmp.h>
28#include "lisp.h" 34#include "lisp.h"
29#include "character.h" 35#include "character.h"
diff --git a/src/msdos.c b/src/msdos.c
index a79fad0ccd4..4dec901988b 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -31,7 +31,13 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
31#include <time.h> 31#include <time.h>
32#include <sys/param.h> 32#include <sys/param.h>
33#include <sys/time.h> 33#include <sys/time.h>
34/* gettine and settime in dos.h clash with their namesakes from
35 gnulib, so we move out of our way the prototypes in dos.h. */
36#define gettime dos_h_gettime_
37#define settime dos_h_settime_
34#include <dos.h> 38#include <dos.h>
39#undef gettime
40#undef settime
35#include <errno.h> 41#include <errno.h>
36#include <sys/stat.h> /* for _fixpath */ 42#include <sys/stat.h> /* for _fixpath */
37#include <unistd.h> /* for chdir, dup, dup2, etc. */ 43#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);
103 109
104#endif /* not SYSTEM_MALLOC */ 110#endif /* not SYSTEM_MALLOC */
105 111
112/* Return the current timestamp in milliseconds since midnight. */
106static unsigned long 113static unsigned long
107event_timestamp (void) 114event_timestamp (void)
108{ 115{
109 struct time t; 116 struct timespec t;
110 unsigned long s; 117 unsigned long s;
111 118
112 gettime (&t); 119 gettime (&t);
113 s = t.ti_min; 120 s = t.tv_sec;
114 s *= 60; 121 s %= 86400;
115 s += t.ti_sec;
116 s *= 1000; 122 s *= 1000;
117 s += t.ti_hund * 10; 123 s += t.tv_nsec * 1000000;
118 124
119 return s; 125 return s;
120} 126}
@@ -4097,10 +4103,10 @@ dos_yield_time_slice (void)
4097 because wait_reading_process_output takes care of that. */ 4103 because wait_reading_process_output takes care of that. */
4098int 4104int
4099sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, 4105sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
4100 EMACS_TIME *timeout) 4106 EMACS_TIME *timeout, void *ignored)
4101{ 4107{
4102 int check_input; 4108 int check_input;
4103 struct time t; 4109 struct timespec t;
4104 4110
4105 check_input = 0; 4111 check_input = 0;
4106 if (rfds) 4112 if (rfds)
@@ -4130,18 +4136,13 @@ sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds,
4130 EMACS_TIME clnow, cllast, cldiff; 4136 EMACS_TIME clnow, cllast, cldiff;
4131 4137
4132 gettime (&t); 4138 gettime (&t);
4133 EMACS_SET_SECS_USECS (cllast, t.ti_sec, t.ti_hund * 10000L); 4139 EMACS_SET_SECS_NSECS (cllast, t.tv_sec, t.tv_nsec);
4134 4140
4135 while (!check_input || !detect_input_pending ()) 4141 while (!check_input || !detect_input_pending ())
4136 { 4142 {
4137 gettime (&t); 4143 gettime (&t);
4138 EMACS_SET_SECS_USECS (clnow, t.ti_sec, t.ti_hund * 10000L); 4144 EMACS_SET_SECS_NSECS (clnow, t.tv_sec, t.tv_nsec);
4139 EMACS_SUB_TIME (cldiff, clnow, cllast); 4145 EMACS_SUB_TIME (cldiff, clnow, cllast);
4140
4141 /* When seconds wrap around, we assume that no more than
4142 1 minute passed since last `gettime'. */
4143 if (EMACS_TIME_SIGN (cldiff) < 0)
4144 EMACS_SET_SECS (cldiff, EMACS_SECS (cldiff) + 60);
4145 EMACS_SUB_TIME (*timeout, *timeout, cldiff); 4146 EMACS_SUB_TIME (*timeout, *timeout, cldiff);
4146 4147
4147 /* Stop when timeout value crosses zero. */ 4148 /* Stop when timeout value crosses zero. */
diff --git a/src/process.c b/src/process.c
index de7fc147975..be2f5370491 100644
--- a/src/process.c
+++ b/src/process.c
@@ -6808,7 +6808,7 @@ keyboard_bit_set (fd_set *mask)
6808 6808
6809/* Defined on msdos.c. */ 6809/* Defined on msdos.c. */
6810extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, 6810extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *,
6811 EMACS_TIME *); 6811 EMACS_TIME *, void *);
6812 6812
6813/* Implementation of wait_reading_process_output, assuming that there 6813/* Implementation of wait_reading_process_output, assuming that there
6814 are no subprocesses. Used only by the MS-DOS build. 6814 are no subprocesses. Used only by the MS-DOS build.
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 38e368e5bd2..9bfbde31065 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -233,8 +233,6 @@ struct sigaction {
233#define read sys_read 233#define read sys_read
234#define rename sys_rename 234#define rename sys_rename
235#define rmdir sys_rmdir 235#define rmdir sys_rmdir
236#define select sys_select
237#define pselect sys_select
238#define sleep sys_sleep 236#define sleep sys_sleep
239#define strerror sys_strerror 237#define strerror sys_strerror
240#undef unlink 238#undef unlink
diff --git a/src/sysdep.c b/src/sysdep.c
index 089b7ba5c8e..29e396c914d 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -65,8 +65,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
65#endif 65#endif
66 66
67#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */ 67#ifdef MSDOS /* Demacs 1.1.2 91/10/20 Manabu Higashida, MW Aug 1993 */
68#include <dos.h>
69#include "dosfns.h"
70#include "msdos.h" 68#include "msdos.h"
71#include <sys/param.h> 69#include <sys/param.h>
72#endif 70#endif
diff --git a/src/sysselect.h b/src/sysselect.h
index 328372d427c..27a38fd687f 100644
--- a/src/sysselect.h
+++ b/src/sysselect.h
@@ -19,7 +19,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
19#if defined (DARWIN_OS) 19#if defined (DARWIN_OS)
20#undef init_process 20#undef init_process
21#endif 21#endif
22#ifndef WINDOWSNT 22#ifndef DOS_NT
23#include <sys/select.h> 23#include <sys/select.h>
24#endif 24#endif
25#if defined (DARWIN_OS) 25#if defined (DARWIN_OS)
@@ -52,3 +52,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
52#if !defined (HAVE_SELECT) 52#if !defined (HAVE_SELECT)
53#define select sys_select 53#define select sys_select
54#endif 54#endif
55
56#ifndef HAVE_PSELECT
57#define pselect sys_select
58#endif