diff options
| author | Eli Zaretskii | 2012-06-30 18:55:27 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2012-06-30 18:55:27 +0300 |
| commit | c9240d7a6eb3d8aaca76cd3abc8f099b6ecaff0a (patch) | |
| tree | c230c2d0e84580f38fe44803b46e149e4149b739 /src | |
| parent | b3218de111201a7b19592f4176057b03749d55a0 (diff) | |
| parent | 0d23c240ea378d9a29042266216f4cf25151a04d (diff) | |
| download | emacs-c9240d7a6eb3d8aaca76cd3abc8f099b6ecaff0a.tar.gz emacs-c9240d7a6eb3d8aaca76cd3abc8f099b6ecaff0a.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/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.
src/ w32proc.c (sys_select): Accept and ignore one more argument.
src/w32.c (emacs_gnutls_pull): Call select with one more argument.
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/ChangeLog | 25 | ||||
| -rw-r--r-- | src/dosfns.c | 6 | ||||
| -rw-r--r-- | src/msdos.c | 29 | ||||
| -rw-r--r-- | src/process.c | 2 | ||||
| -rw-r--r-- | src/s/ms-w32.h | 2 | ||||
| -rw-r--r-- | src/sysdep.c | 2 | ||||
| -rw-r--r-- | src/sysselect.h | 6 | ||||
| -rw-r--r-- | src/w32.c | 2 | ||||
| -rw-r--r-- | src/w32proc.c | 2 |
9 files changed, 55 insertions, 21 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index ce817c19894..9794c5ad4cd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,28 @@ | |||
| 1 | 2012-06-30 Eli Zaretskii <eliz@gnu.org> | ||
| 2 | |||
| 3 | * w32proc.c (sys_select): Accept and ignore one more argument. | ||
| 4 | |||
| 5 | * w32.c (emacs_gnutls_pull): Call select with one more argument. | ||
| 6 | |||
| 7 | * sysselect.h [DOS_NT]: Don't include sys/select.h. | ||
| 8 | |||
| 9 | * s/ms-w32.h (select, pselect): Don't define here, they are | ||
| 10 | defined in sysselect.h | ||
| 11 | |||
| 12 | * sysselect.h (pselect) [!HAVE_PSELECT]: Redirect to sys_select. | ||
| 13 | |||
| 14 | * sysdep.c: Don't include dos.h and dosfns.h. | ||
| 15 | |||
| 16 | * process.c (sys_select): | ||
| 17 | * msdos.c (sys_select): Accept one more argument and ignore it. | ||
| 18 | |||
| 19 | * msdos.c (event_timestamp, sys_select): Use gnulib's gettime; | ||
| 20 | adapt data types and code to that. | ||
| 21 | |||
| 22 | * dosfns.c: | ||
| 23 | * msdos.c (gettime, settime): Define away the prototypes in dos.h, | ||
| 24 | which clashes with the gnulib function of the same name. | ||
| 25 | |||
| 1 | 2012-06-30 Andreas Schwab <schwab@linux-m68k.org> | 26 | 2012-06-30 Andreas Schwab <schwab@linux-m68k.org> |
| 2 | 27 | ||
| 3 | * font.c (font_style_to_value, font_style_symbolic) | 28 | * font.c (font_style_to_value, font_style_symbolic) |
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. */ | ||
| 106 | static unsigned long | 113 | static unsigned long |
| 107 | event_timestamp (void) | 114 | event_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. */ |
| 4098 | int | 4104 | int |
| 4099 | sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | 4105 | sys_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 e9ad3b10c33..fa16c178c16 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. */ |
| 6810 | extern int sys_select (int, SELECT_TYPE *, SELECT_TYPE *, SELECT_TYPE *, | 6810 | extern 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..3a95bffadb8 100644 --- a/src/s/ms-w32.h +++ b/src/s/ms-w32.h | |||
| @@ -234,7 +234,7 @@ struct sigaction { | |||
| 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 | 236 | #define select sys_select |
| 237 | #define pselect sys_select | 237 | #define pselect sys_select |
| 238 | #define sleep sys_sleep | 238 | #define sleep sys_sleep |
| 239 | #define strerror sys_strerror | 239 | #define strerror sys_strerror |
| 240 | #undef unlink | 240 | #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..2dbbede2bff 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 | #ifdef MSDOS | ||
| 57 | #define pselect sys_select | ||
| 58 | #endif | ||
| @@ -6312,7 +6312,7 @@ emacs_gnutls_pull (gnutls_transport_ptr_t p, void* buf, size_t sz) | |||
| 6312 | 6312 | ||
| 6313 | /* Use select with the timeout to poll the selector. */ | 6313 | /* Use select with the timeout to poll the selector. */ |
| 6314 | sc = select (fd + 1, &fdset, (SELECT_TYPE *)0, (SELECT_TYPE *)0, | 6314 | sc = select (fd + 1, &fdset, (SELECT_TYPE *)0, (SELECT_TYPE *)0, |
| 6315 | &timeout); | 6315 | &timeout, NULL); |
| 6316 | 6316 | ||
| 6317 | if (sc > 0) | 6317 | if (sc > 0) |
| 6318 | continue; /* Try again. */ | 6318 | continue; /* Try again. */ |
diff --git a/src/w32proc.c b/src/w32proc.c index 3864d15623a..afc1b21fdde 100644 --- a/src/w32proc.c +++ b/src/w32proc.c | |||
| @@ -1080,7 +1080,7 @@ extern int proc_buffered_char[]; | |||
| 1080 | 1080 | ||
| 1081 | int | 1081 | int |
| 1082 | sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, | 1082 | sys_select (int nfds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, |
| 1083 | EMACS_TIME *timeout) | 1083 | EMACS_TIME *timeout, void *ignored) |
| 1084 | { | 1084 | { |
| 1085 | SELECT_TYPE orfds; | 1085 | SELECT_TYPE orfds; |
| 1086 | DWORD timeout_ms, start_time; | 1086 | DWORD timeout_ms, start_time; |