diff options
| author | Eli Zaretskii | 2010-04-01 17:59:46 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2010-04-01 17:59:46 +0300 |
| commit | ed68db4d2cf55caf6847151079e1b3861e5d0879 (patch) | |
| tree | a906021821c631f3d8ee4595c09e6d3afbe723df /src | |
| parent | 814062c76646a9dd4504ae578d7fb41891a5cab4 (diff) | |
| download | emacs-ed68db4d2cf55caf6847151079e1b3861e5d0879.tar.gz emacs-ed68db4d2cf55caf6847151079e1b3861e5d0879.zip | |
Remove support for DJGPP v1.x (bug#5813).
src/:
w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility.
s/msdos.h:
unexec.c (make_hdr, copy_text_and_data):
sysdep.c (wait_for_termination, sys_subshell):
msdos.c (dos_set_window_size, msdos_set_cursor_shape)
(IT_set_terminal_modes):
(__write, _rename, gethostname, gettimeofday, alarm, fork, kill)
(dos_ttraw, dos_ttcooked, run_msdos_command, abort): Remove DJGPP
v1.x code and tests of the value of __DJGPP__.
(nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x
compatibility code.
lread.c:
gmalloc.c (memalign):
fileio.c (Fcopy_file, check_executable, Ffile_modes):
emacs.c (main):
dosfns.c (init_dosfns):
dired.c (file_name_completion_stat): Remove tests of __DJGPP__.
msdos/:
sed3.inp:
sed2.inp:
sed1.inp:
mainmake: Files removed.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 21 | ||||
| -rw-r--r-- | src/dired.c | 4 | ||||
| -rw-r--r-- | src/dosfns.c | 7 | ||||
| -rw-r--r-- | src/emacs.c | 6 | ||||
| -rw-r--r-- | src/fileio.c | 21 | ||||
| -rw-r--r-- | src/gmalloc.c | 10 | ||||
| -rw-r--r-- | src/lread.c | 3 | ||||
| -rw-r--r-- | src/msdos.c | 460 | ||||
| -rw-r--r-- | src/s/msdos.h | 48 | ||||
| -rw-r--r-- | src/sysdep.c | 12 | ||||
| -rw-r--r-- | src/unexec.c | 8 | ||||
| -rw-r--r-- | src/w16select.c | 21 |
12 files changed, 28 insertions, 593 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index df0453a341b..aea5701ec9c 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,5 +1,26 @@ | |||
| 1 | 2010-04-01 Eli Zaretskii <eliz@gnu.org> | 1 | 2010-04-01 Eli Zaretskii <eliz@gnu.org> |
| 2 | 2 | ||
| 3 | Remove support for DJGPP v1.x (bug#5813). | ||
| 4 | |||
| 5 | * w16select.c (__dpmi_int): Remove DJGPP v1.x compatibility. | ||
| 6 | * s/msdos.h: | ||
| 7 | * unexec.c (make_hdr, copy_text_and_data): | ||
| 8 | * sysdep.c (wait_for_termination, sys_subshell): | ||
| 9 | * msdos.c (dos_set_window_size, msdos_set_cursor_shape) | ||
| 10 | (IT_set_terminal_modes): | ||
| 11 | (__write, _rename, gethostname, gettimeofday, alarm, fork, kill) | ||
| 12 | (dos_ttraw, dos_ttcooked, run_msdos_command, abort): Remove DJGPP | ||
| 13 | v1.x code and tests of the value of __DJGPP__. | ||
| 14 | (nice, pause, sigsetmask, sigblock): Remove DJGPP v1.x | ||
| 15 | compatibility code. | ||
| 16 | |||
| 17 | * lread.c: | ||
| 18 | * gmalloc.c (memalign): | ||
| 19 | * fileio.c (Fcopy_file, check_executable, Ffile_modes): | ||
| 20 | * emacs.c (main): | ||
| 21 | * dosfns.c (init_dosfns): | ||
| 22 | * dired.c (file_name_completion_stat): Remove tests of __DJGPP__. | ||
| 23 | |||
| 3 | * xdisp.c (set_cursor_from_row): Fix cursor positioning when the | 24 | * xdisp.c (set_cursor_from_row): Fix cursor positioning when the |
| 4 | string with `cursor' property comes from an `after-string' | 25 | string with `cursor' property comes from an `after-string' |
| 5 | overlay. (Bug#5816) | 26 | overlay. (Bug#5816) |
diff --git a/src/dired.c b/src/dired.c index 951969be0a4..2240f6ec76e 100644 --- a/src/dired.c +++ b/src/dired.c | |||
| @@ -859,7 +859,6 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 859 | char *fullname = (char *) alloca (len + pos + 2); | 859 | char *fullname = (char *) alloca (len + pos + 2); |
| 860 | 860 | ||
| 861 | #ifdef MSDOS | 861 | #ifdef MSDOS |
| 862 | #if __DJGPP__ > 1 | ||
| 863 | /* Some fields of struct stat are *very* expensive to compute on MS-DOS, | 862 | /* Some fields of struct stat are *very* expensive to compute on MS-DOS, |
| 864 | but aren't required here. Avoid computing the following fields: | 863 | but aren't required here. Avoid computing the following fields: |
| 865 | st_inode, st_size and st_nlink for directories, and the execute bits | 864 | st_inode, st_size and st_nlink for directories, and the execute bits |
| @@ -868,7 +867,6 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 868 | unsigned short save_djstat_flags = _djstat_flags; | 867 | unsigned short save_djstat_flags = _djstat_flags; |
| 869 | 868 | ||
| 870 | _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; | 869 | _djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE; |
| 871 | #endif /* __DJGPP__ > 1 */ | ||
| 872 | #endif /* MSDOS */ | 870 | #endif /* MSDOS */ |
| 873 | 871 | ||
| 874 | bcopy (SDATA (dirname), fullname, pos); | 872 | bcopy (SDATA (dirname), fullname, pos); |
| @@ -888,9 +886,7 @@ file_name_completion_stat (dirname, dp, st_addr) | |||
| 888 | #else | 886 | #else |
| 889 | value = stat (fullname, st_addr); | 887 | value = stat (fullname, st_addr); |
| 890 | #ifdef MSDOS | 888 | #ifdef MSDOS |
| 891 | #if __DJGPP__ > 1 | ||
| 892 | _djstat_flags = save_djstat_flags; | 889 | _djstat_flags = save_djstat_flags; |
| 893 | #endif /* __DJGPP__ > 1 */ | ||
| 894 | #endif /* MSDOS */ | 890 | #endif /* MSDOS */ |
| 895 | return value; | 891 | return value; |
| 896 | #endif /* S_IFLNK */ | 892 | #endif /* S_IFLNK */ |
diff --git a/src/dosfns.c b/src/dosfns.c index d04c28b3156..e8756de21a1 100644 --- a/src/dosfns.c +++ b/src/dosfns.c | |||
| @@ -48,10 +48,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 48 | #include <grp.h> | 48 | #include <grp.h> |
| 49 | #include <crt0.h> | 49 | #include <crt0.h> |
| 50 | 50 | ||
| 51 | #ifndef __DJGPP_MINOR__ | ||
| 52 | # define __tb _go32_info_block.linear_address_of_transfer_buffer; | ||
| 53 | #endif | ||
| 54 | |||
| 55 | DEFUN ("int86", Fint86, Sint86, 2, 2, 0, | 51 | DEFUN ("int86", Fint86, Sint86, 2, 2, 0, |
| 56 | doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS. | 52 | doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS. |
| 57 | Return the updated REGISTER vector. | 53 | Return the updated REGISTER vector. |
| @@ -385,8 +381,6 @@ init_dosfns () | |||
| 385 | } | 381 | } |
| 386 | #endif /* !HAVE_X_WINDOWS */ | 382 | #endif /* !HAVE_X_WINDOWS */ |
| 387 | 383 | ||
| 388 | #if __DJGPP__ >= 2 | ||
| 389 | |||
| 390 | /* Without this, we never see hidden files. | 384 | /* Without this, we never see hidden files. |
| 391 | Don't OR it with the previous value, so the value recorded at dump | 385 | Don't OR it with the previous value, so the value recorded at dump |
| 392 | time, possibly with `preserve-case' flags set, won't get through. */ | 386 | time, possibly with `preserve-case' flags set, won't get through. */ |
| @@ -398,7 +392,6 @@ init_dosfns () | |||
| 398 | if (!NILP (Fmsdos_long_file_names ())) | 392 | if (!NILP (Fmsdos_long_file_names ())) |
| 399 | __opendir_flags |= __OPENDIR_PRESERVE_CASE; | 393 | __opendir_flags |= __OPENDIR_PRESERVE_CASE; |
| 400 | #endif /* __DJGPP_MINOR__ == 0 */ | 394 | #endif /* __DJGPP_MINOR__ == 0 */ |
| 401 | #endif /* __DJGPP__ >= 2 */ | ||
| 402 | } | 395 | } |
| 403 | 396 | ||
| 404 | #ifndef HAVE_X_WINDOWS | 397 | #ifndef HAVE_X_WINDOWS |
diff --git a/src/emacs.c b/src/emacs.c index 6327fd8a7d3..0d90776df83 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -945,7 +945,6 @@ main (int argc, char **argv) | |||
| 945 | #endif /* MSDOS || WINDOWSNT */ | 945 | #endif /* MSDOS || WINDOWSNT */ |
| 946 | 946 | ||
| 947 | #ifdef MSDOS | 947 | #ifdef MSDOS |
| 948 | #if __DJGPP__ >= 2 | ||
| 949 | if (!isatty (fileno (stdin))) | 948 | if (!isatty (fileno (stdin))) |
| 950 | setmode (fileno (stdin), O_BINARY); | 949 | setmode (fileno (stdin), O_BINARY); |
| 951 | if (!isatty (fileno (stdout))) | 950 | if (!isatty (fileno (stdout))) |
| @@ -953,11 +952,6 @@ main (int argc, char **argv) | |||
| 953 | fflush (stdout); | 952 | fflush (stdout); |
| 954 | setmode (fileno (stdout), O_BINARY); | 953 | setmode (fileno (stdout), O_BINARY); |
| 955 | } | 954 | } |
| 956 | #else /* not __DJGPP__ >= 2 */ | ||
| 957 | (stdin)->_flag &= ~_IOTEXT; | ||
| 958 | (stdout)->_flag &= ~_IOTEXT; | ||
| 959 | (stderr)->_flag &= ~_IOTEXT; | ||
| 960 | #endif /* not __DJGPP__ >= 2 */ | ||
| 961 | #endif /* MSDOS */ | 955 | #endif /* MSDOS */ |
| 962 | 956 | ||
| 963 | #ifdef SET_EMACS_PRIORITY | 957 | #ifdef SET_EMACS_PRIORITY |
diff --git a/src/fileio.c b/src/fileio.c index a80ba11bcab..4ae74de5c67 100644 --- a/src/fileio.c +++ b/src/fileio.c | |||
| @@ -79,11 +79,9 @@ extern int errno; | |||
| 79 | #ifdef MSDOS | 79 | #ifdef MSDOS |
| 80 | #include "msdos.h" | 80 | #include "msdos.h" |
| 81 | #include <sys/param.h> | 81 | #include <sys/param.h> |
| 82 | #if __DJGPP__ >= 2 | ||
| 83 | #include <fcntl.h> | 82 | #include <fcntl.h> |
| 84 | #include <string.h> | 83 | #include <string.h> |
| 85 | #endif | 84 | #endif |
| 86 | #endif | ||
| 87 | 85 | ||
| 88 | #ifdef DOS_NT | 86 | #ifdef DOS_NT |
| 89 | #define CORRECT_DIR_SEPS(s) \ | 87 | #define CORRECT_DIR_SEPS(s) \ |
| @@ -2012,7 +2010,6 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2012 | copyable by us. */ | 2010 | copyable by us. */ |
| 2013 | input_file_statable_p = (fstat (ifd, &st) >= 0); | 2011 | input_file_statable_p = (fstat (ifd, &st) >= 0); |
| 2014 | 2012 | ||
| 2015 | #if !defined (MSDOS) || __DJGPP__ > 1 | ||
| 2016 | if (out_st.st_mode != 0 | 2013 | if (out_st.st_mode != 0 |
| 2017 | && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) | 2014 | && st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino) |
| 2018 | { | 2015 | { |
| @@ -2020,7 +2017,6 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2020 | report_file_error ("Input and output files are the same", | 2017 | report_file_error ("Input and output files are the same", |
| 2021 | Fcons (file, Fcons (newname, Qnil))); | 2018 | Fcons (file, Fcons (newname, Qnil))); |
| 2022 | } | 2019 | } |
| 2023 | #endif | ||
| 2024 | 2020 | ||
| 2025 | #if defined (S_ISREG) && defined (S_ISLNK) | 2021 | #if defined (S_ISREG) && defined (S_ISLNK) |
| 2026 | if (input_file_statable_p) | 2022 | if (input_file_statable_p) |
| @@ -2091,7 +2087,7 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2091 | 2087 | ||
| 2092 | emacs_close (ifd); | 2088 | emacs_close (ifd); |
| 2093 | 2089 | ||
| 2094 | #if defined (__DJGPP__) && __DJGPP__ > 1 | 2090 | #ifdef MSDOS |
| 2095 | if (input_file_statable_p) | 2091 | if (input_file_statable_p) |
| 2096 | { | 2092 | { |
| 2097 | /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, | 2093 | /* In DJGPP v2.0 and later, fstat usually returns true file mode bits, |
| @@ -2101,7 +2097,7 @@ uid and gid of FILE to NEWNAME. */) | |||
| 2101 | if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) | 2097 | if ((_djstat_flags & _STFAIL_WRITEBIT) == 0) |
| 2102 | chmod (SDATA (encoded_newname), st.st_mode & 07777); | 2098 | chmod (SDATA (encoded_newname), st.st_mode & 07777); |
| 2103 | } | 2099 | } |
| 2104 | #endif /* DJGPP version 2 or newer */ | 2100 | #endif /* MSDOS */ |
| 2105 | #endif /* not WINDOWSNT */ | 2101 | #endif /* not WINDOWSNT */ |
| 2106 | 2102 | ||
| 2107 | /* Discard the unwind protects. */ | 2103 | /* Discard the unwind protects. */ |
| @@ -2477,16 +2473,7 @@ check_executable (filename) | |||
| 2477 | struct stat st; | 2473 | struct stat st; |
| 2478 | if (stat (filename, &st) < 0) | 2474 | if (stat (filename, &st) < 0) |
| 2479 | return 0; | 2475 | return 0; |
| 2480 | #if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1) | ||
| 2481 | return ((st.st_mode & S_IEXEC) != 0); | 2476 | return ((st.st_mode & S_IEXEC) != 0); |
| 2482 | #else | ||
| 2483 | return (S_ISREG (st.st_mode) | ||
| 2484 | && len >= 5 | ||
| 2485 | && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0 | ||
| 2486 | || xstrcasecmp (suffix, ".exe") == 0 | ||
| 2487 | || xstrcasecmp (suffix, ".bat") == 0) | ||
| 2488 | || (st.st_mode & S_IFMT) == S_IFDIR); | ||
| 2489 | #endif /* not WINDOWSNT */ | ||
| 2490 | #else /* not DOS_NT */ | 2477 | #else /* not DOS_NT */ |
| 2491 | #ifdef HAVE_EUIDACCESS | 2478 | #ifdef HAVE_EUIDACCESS |
| 2492 | return (euidaccess (filename, 1) >= 0); | 2479 | return (euidaccess (filename, 1) >= 0); |
| @@ -2885,10 +2872,6 @@ Return nil, if file does not exist or is not accessible. */) | |||
| 2885 | 2872 | ||
| 2886 | if (stat (SDATA (absname), &st) < 0) | 2873 | if (stat (SDATA (absname), &st) < 0) |
| 2887 | return Qnil; | 2874 | return Qnil; |
| 2888 | #if defined (MSDOS) && __DJGPP__ < 2 | ||
| 2889 | if (check_executable (SDATA (absname))) | ||
| 2890 | st.st_mode |= S_IEXEC; | ||
| 2891 | #endif /* MSDOS && __DJGPP__ < 2 */ | ||
| 2892 | 2875 | ||
| 2893 | return make_number (st.st_mode & 07777); | 2876 | return make_number (st.st_mode & 07777); |
| 2894 | } | 2877 | } |
diff --git a/src/gmalloc.c b/src/gmalloc.c index f1be37ba348..6445c56e6d4 100644 --- a/src/gmalloc.c +++ b/src/gmalloc.c | |||
| @@ -122,7 +122,7 @@ extern __ptr_t calloc PP ((__malloc_size_t __nmemb, __malloc_size_t __size)); | |||
| 122 | extern void free PP ((__ptr_t __ptr)); | 122 | extern void free PP ((__ptr_t __ptr)); |
| 123 | 123 | ||
| 124 | /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ | 124 | /* Allocate SIZE bytes allocated to ALIGNMENT bytes. */ |
| 125 | #if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */ | 125 | #if !defined (_MALLOC_INTERNAL) || defined (MSDOS) /* Avoid conflict. */ |
| 126 | extern __ptr_t memalign PP ((__malloc_size_t __alignment, | 126 | extern __ptr_t memalign PP ((__malloc_size_t __alignment, |
| 127 | __malloc_size_t __size)); | 127 | __malloc_size_t __size)); |
| 128 | extern int posix_memalign PP ((__ptr_t *, __malloc_size_t, | 128 | extern int posix_memalign PP ((__ptr_t *, __malloc_size_t, |
| @@ -1763,13 +1763,6 @@ Fifth Floor, Boston, MA 02110-1301, USA. */ | |||
| 1763 | #include <malloc.h> | 1763 | #include <malloc.h> |
| 1764 | #endif | 1764 | #endif |
| 1765 | 1765 | ||
| 1766 | #if __DJGPP__ - 0 == 1 | ||
| 1767 | |||
| 1768 | /* There is some problem with memalign in DJGPP v1 and we are supposed | ||
| 1769 | to omit it. Noone told me why, they just told me to do it. */ | ||
| 1770 | |||
| 1771 | #else | ||
| 1772 | |||
| 1773 | __ptr_t (*__memalign_hook) PP ((__malloc_size_t __size, | 1766 | __ptr_t (*__memalign_hook) PP ((__malloc_size_t __size, |
| 1774 | __malloc_size_t __alignment)); | 1767 | __malloc_size_t __alignment)); |
| 1775 | 1768 | ||
| @@ -1878,7 +1871,6 @@ posix_memalign (memptr, alignment, size) | |||
| 1878 | return 0; | 1871 | return 0; |
| 1879 | } | 1872 | } |
| 1880 | 1873 | ||
| 1881 | #endif /* Not DJGPP v1 */ | ||
| 1882 | /* Allocate memory on a page boundary. | 1874 | /* Allocate memory on a page boundary. |
| 1883 | Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc. | 1875 | Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc. |
| 1884 | 1876 | ||
diff --git a/src/lread.c b/src/lread.c index ba9d5378104..90edca90a16 100644 --- a/src/lread.c +++ b/src/lread.c | |||
| @@ -41,9 +41,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 41 | #include "blockinput.h" | 41 | #include "blockinput.h" |
| 42 | 42 | ||
| 43 | #ifdef MSDOS | 43 | #ifdef MSDOS |
| 44 | #if __DJGPP__ < 2 | ||
| 45 | #include <unistd.h> /* to get X_OK */ | ||
| 46 | #endif | ||
| 47 | #include "msdos.h" | 44 | #include "msdos.h" |
| 48 | #endif | 45 | #endif |
| 49 | 46 | ||
diff --git a/src/msdos.c b/src/msdos.c index a413184f966..dbc3506582a 100644 --- a/src/msdos.c +++ b/src/msdos.c | |||
| @@ -39,7 +39,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 39 | #include <sys/stat.h> /* for _fixpath */ | 39 | #include <sys/stat.h> /* for _fixpath */ |
| 40 | #include <unistd.h> /* for chdir, dup, dup2, etc. */ | 40 | #include <unistd.h> /* for chdir, dup, dup2, etc. */ |
| 41 | #include <dir.h> /* for getdisk */ | 41 | #include <dir.h> /* for getdisk */ |
| 42 | #if __DJGPP__ >= 2 | ||
| 43 | #pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */ | 42 | #pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */ |
| 44 | #include <fcntl.h> | 43 | #include <fcntl.h> |
| 45 | #include <io.h> /* for setmode */ | 44 | #include <io.h> /* for setmode */ |
| @@ -47,7 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 47 | #include <sys/farptr.h> /* for _farsetsel, _farnspokeb */ | 46 | #include <sys/farptr.h> /* for _farsetsel, _farnspokeb */ |
| 48 | #include <libc/dosio.h> /* for _USE_LFN */ | 47 | #include <libc/dosio.h> /* for _USE_LFN */ |
| 49 | #include <conio.h> /* for cputs */ | 48 | #include <conio.h> /* for cputs */ |
| 50 | #endif | ||
| 51 | 49 | ||
| 52 | #include "msdos.h" | 50 | #include "msdos.h" |
| 53 | #include "systime.h" | 51 | #include "systime.h" |
| @@ -81,8 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 81 | #define _dos_ds _go32_info_block.selector_for_linear_memory | 79 | #define _dos_ds _go32_info_block.selector_for_linear_memory |
| 82 | #endif | 80 | #endif |
| 83 | 81 | ||
| 84 | #if __DJGPP__ > 1 | ||
| 85 | |||
| 86 | #include <signal.h> | 82 | #include <signal.h> |
| 87 | #include "syssignal.h" | 83 | #include "syssignal.h" |
| 88 | 84 | ||
| @@ -104,7 +100,6 @@ int _crt0_startup_flags = (_CRT0_FLAG_UNIX_SBRK | _CRT0_FLAG_FILL_SBRK_MEMORY); | |||
| 104 | #endif /* GNU_MALLOC */ | 100 | #endif /* GNU_MALLOC */ |
| 105 | 101 | ||
| 106 | #endif /* not SYSTEM_MALLOC */ | 102 | #endif /* not SYSTEM_MALLOC */ |
| 107 | #endif /* __DJGPP__ > 1 */ | ||
| 108 | 103 | ||
| 109 | static unsigned long | 104 | static unsigned long |
| 110 | event_timestamp () | 105 | event_timestamp () |
| @@ -427,7 +422,6 @@ extern Lisp_Object Qbar, Qhbar; | |||
| 427 | colors for newly-created frames. */ | 422 | colors for newly-created frames. */ |
| 428 | static int initial_screen_colors[2]; | 423 | static int initial_screen_colors[2]; |
| 429 | 424 | ||
| 430 | #if __DJGPP__ > 1 | ||
| 431 | /* Update the screen from a part of relocated DOS/V screen buffer which | 425 | /* Update the screen from a part of relocated DOS/V screen buffer which |
| 432 | begins at OFFSET and includes COUNT characters. */ | 426 | begins at OFFSET and includes COUNT characters. */ |
| 433 | static void | 427 | static void |
| @@ -444,7 +438,6 @@ dosv_refresh_virtual_screen (int offset, int count) | |||
| 444 | regs.x.cx = count; | 438 | regs.x.cx = count; |
| 445 | __dpmi_int (0x10, ®s); | 439 | __dpmi_int (0x10, ®s); |
| 446 | } | 440 | } |
| 447 | #endif | ||
| 448 | 441 | ||
| 449 | static void | 442 | static void |
| 450 | dos_direct_output (y, x, buf, len) | 443 | dos_direct_output (y, x, buf, len) |
| @@ -456,67 +449,12 @@ dos_direct_output (y, x, buf, len) | |||
| 456 | int t = t0 + (int) ScreenPrimary; | 449 | int t = t0 + (int) ScreenPrimary; |
| 457 | int l0 = len; | 450 | int l0 = len; |
| 458 | 451 | ||
| 459 | #if (__DJGPP__ < 2) | ||
| 460 | while (--len >= 0) { | ||
| 461 | dosmemput (buf++, 1, t); | ||
| 462 | t += 2; | ||
| 463 | } | ||
| 464 | #else | ||
| 465 | /* This is faster. */ | 452 | /* This is faster. */ |
| 466 | for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++) | 453 | for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++) |
| 467 | _farnspokeb (t, *buf); | 454 | _farnspokeb (t, *buf); |
| 468 | 455 | ||
| 469 | if (screen_virtual_segment) | 456 | if (screen_virtual_segment) |
| 470 | dosv_refresh_virtual_screen (t0, l0); | 457 | dosv_refresh_virtual_screen (t0, l0); |
| 471 | #endif | ||
| 472 | } | ||
| 473 | #endif | ||
| 474 | |||
| 475 | /* Flash the screen as a substitute for BEEPs. */ | ||
| 476 | |||
| 477 | #if (__DJGPP__ < 2) | ||
| 478 | static void | ||
| 479 | do_visible_bell (xorattr) | ||
| 480 | unsigned char xorattr; | ||
| 481 | { | ||
| 482 | asm volatile | ||
| 483 | (" movb $1,%%dl \n\ | ||
| 484 | visible_bell_0: \n\ | ||
| 485 | movl _ScreenPrimary,%%eax \n\ | ||
| 486 | call dosmemsetup \n\ | ||
| 487 | movl %%eax,%%ebx \n\ | ||
| 488 | movl %1,%%ecx \n\ | ||
| 489 | movb %0,%%al \n\ | ||
| 490 | incl %%ebx \n\ | ||
| 491 | visible_bell_1: \n\ | ||
| 492 | xorb %%al,%%gs:(%%ebx) \n\ | ||
| 493 | addl $2,%%ebx \n\ | ||
| 494 | decl %%ecx \n\ | ||
| 495 | jne visible_bell_1 \n\ | ||
| 496 | decb %%dl \n\ | ||
| 497 | jne visible_bell_3 \n\ | ||
| 498 | visible_bell_2: \n\ | ||
| 499 | movzwl %%ax,%%eax \n\ | ||
| 500 | movzwl %%ax,%%eax \n\ | ||
| 501 | movzwl %%ax,%%eax \n\ | ||
| 502 | movzwl %%ax,%%eax \n\ | ||
| 503 | decw %%cx \n\ | ||
| 504 | jne visible_bell_2 \n\ | ||
| 505 | jmp visible_bell_0 \n\ | ||
| 506 | visible_bell_3:" | ||
| 507 | : /* no output */ | ||
| 508 | : "m" (xorattr), "g" (screen_size) | ||
| 509 | : "%eax", "%ebx", /* "%gs",*/ "%ecx", "%edx"); | ||
| 510 | } | ||
| 511 | |||
| 512 | static void | ||
| 513 | ScreenVisualBell (void) | ||
| 514 | { | ||
| 515 | /* This creates an xor-mask that will swap the default fore- and | ||
| 516 | background colors. */ | ||
| 517 | do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ()) | ||
| 518 | ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ())) | ||
| 519 | * 0x11) & 0x7f); | ||
| 520 | } | 458 | } |
| 521 | #endif | 459 | #endif |
| 522 | 460 | ||
| @@ -611,9 +549,6 @@ dos_set_window_size (rows, cols) | |||
| 611 | 549 | ||
| 612 | /* Find one of the dimensions supported by standard EGA/VGA | 550 | /* Find one of the dimensions supported by standard EGA/VGA |
| 613 | which gives us at least the required dimensions. */ | 551 | which gives us at least the required dimensions. */ |
| 614 | |||
| 615 | #if __DJGPP__ > 1 | ||
| 616 | |||
| 617 | else | 552 | else |
| 618 | { | 553 | { |
| 619 | static struct { | 554 | static struct { |
| @@ -642,41 +577,6 @@ dos_set_window_size (rows, cols) | |||
| 642 | } | 577 | } |
| 643 | } | 578 | } |
| 644 | 579 | ||
| 645 | #else /* not __DJGPP__ > 1 */ | ||
| 646 | |||
| 647 | else if (*rows <= 25) | ||
| 648 | { | ||
| 649 | if (current_rows != 25 || current_cols != 80) | ||
| 650 | { | ||
| 651 | regs.x.ax = 3; | ||
| 652 | int86 (0x10, ®s, ®s); | ||
| 653 | regs.x.ax = 0x1101; | ||
| 654 | regs.h.bl = 0; | ||
| 655 | int86 (0x10, ®s, ®s); | ||
| 656 | regs.x.ax = 0x1200; | ||
| 657 | regs.h.bl = 32; | ||
| 658 | int86 (0x10, ®s, ®s); | ||
| 659 | regs.x.ax = 3; | ||
| 660 | int86 (0x10, ®s, ®s); | ||
| 661 | } | ||
| 662 | } | ||
| 663 | else if (*rows <= 50) | ||
| 664 | if (have_vga && (current_rows != 50 || current_cols != 80) | ||
| 665 | || *rows <= 43 && (current_rows != 43 || current_cols != 80)) | ||
| 666 | { | ||
| 667 | regs.x.ax = 3; | ||
| 668 | int86 (0x10, ®s, ®s); | ||
| 669 | regs.x.ax = 0x1112; | ||
| 670 | regs.h.bl = 0; | ||
| 671 | int86 (0x10, ®s, ®s); | ||
| 672 | regs.x.ax = 0x1200; | ||
| 673 | regs.h.bl = 32; | ||
| 674 | int86 (0x10, ®s, ®s); | ||
| 675 | regs.x.ax = 0x0100; | ||
| 676 | regs.x.cx = 7; | ||
| 677 | int86 (0x10, ®s, ®s); | ||
| 678 | } | ||
| 679 | #endif /* not __DJGPP__ > 1 */ | ||
| 680 | 580 | ||
| 681 | if (have_mouse) | 581 | if (have_mouse) |
| 682 | { | 582 | { |
| @@ -693,7 +593,6 @@ dos_set_window_size (rows, cols) | |||
| 693 | screen_size_Y = *rows; | 593 | screen_size_Y = *rows; |
| 694 | screen_size = *cols * *rows; | 594 | screen_size = *cols * *rows; |
| 695 | 595 | ||
| 696 | #if __DJGPP__ > 1 | ||
| 697 | /* If the dimensions changed, the mouse highlight info is invalid. */ | 596 | /* If the dimensions changed, the mouse highlight info is invalid. */ |
| 698 | if (current_rows != *rows || current_cols != *cols) | 597 | if (current_rows != *rows || current_cols != *cols) |
| 699 | { | 598 | { |
| @@ -708,7 +607,6 @@ dos_set_window_size (rows, cols) | |||
| 708 | dpyinfo->mouse_face_window = Qnil; | 607 | dpyinfo->mouse_face_window = Qnil; |
| 709 | } | 608 | } |
| 710 | } | 609 | } |
| 711 | #endif | ||
| 712 | 610 | ||
| 713 | /* Enable bright background colors. */ | 611 | /* Enable bright background colors. */ |
| 714 | bright_bg (); | 612 | bright_bg (); |
| @@ -747,7 +645,6 @@ mouse_off_maybe () | |||
| 747 | static void | 645 | static void |
| 748 | msdos_set_cursor_shape (struct frame *f, int start_line, int width) | 646 | msdos_set_cursor_shape (struct frame *f, int start_line, int width) |
| 749 | { | 647 | { |
| 750 | #if __DJGPP__ > 1 | ||
| 751 | unsigned desired_cursor; | 648 | unsigned desired_cursor; |
| 752 | __dpmi_regs regs; | 649 | __dpmi_regs regs; |
| 753 | int max_line, top_line, bot_line; | 650 | int max_line, top_line, bot_line; |
| @@ -824,7 +721,6 @@ msdos_set_cursor_shape (struct frame *f, int start_line, int width) | |||
| 824 | regs.h.ah = 1; | 721 | regs.h.ah = 1; |
| 825 | regs.x.cx = desired_cursor; | 722 | regs.x.cx = desired_cursor; |
| 826 | __dpmi_int (0x10, ®s); | 723 | __dpmi_int (0x10, ®s); |
| 827 | #endif /* __DJGPP__ > 1 */ | ||
| 828 | } | 724 | } |
| 829 | 725 | ||
| 830 | static void | 726 | static void |
| @@ -2041,7 +1937,6 @@ IT_set_terminal_modes (struct terminal *term) | |||
| 2041 | startup_screen_size_Y = screen_size_Y; | 1937 | startup_screen_size_Y = screen_size_Y; |
| 2042 | startup_screen_attrib = ScreenAttrib; | 1938 | startup_screen_attrib = ScreenAttrib; |
| 2043 | 1939 | ||
| 2044 | #if __DJGPP__ > 1 | ||
| 2045 | /* Is DOS/V (or any other RSIS software which relocates | 1940 | /* Is DOS/V (or any other RSIS software which relocates |
| 2046 | the screen) installed? */ | 1941 | the screen) installed? */ |
| 2047 | { | 1942 | { |
| @@ -2072,7 +1967,6 @@ IT_set_terminal_modes (struct terminal *term) | |||
| 2072 | ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset; | 1967 | ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset; |
| 2073 | } | 1968 | } |
| 2074 | } | 1969 | } |
| 2075 | #endif /* __DJGPP__ > 1 */ | ||
| 2076 | 1970 | ||
| 2077 | ScreenGetCursor (&startup_pos_Y, &startup_pos_X); | 1971 | ScreenGetCursor (&startup_pos_Y, &startup_pos_X); |
| 2078 | ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2)); | 1972 | ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2)); |
| @@ -4068,195 +3962,6 @@ crlf_to_lf (n, buf) | |||
| 4068 | return np - startp; | 3962 | return np - startp; |
| 4069 | } | 3963 | } |
| 4070 | 3964 | ||
| 4071 | #if defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 0 | ||
| 4072 | |||
| 4073 | /* In DJGPP v2.0, library `write' can call `malloc', which might | ||
| 4074 | cause relocation of the buffer whose address we get in ADDR. | ||
| 4075 | Here is a version of `write' that avoids calling `malloc', | ||
| 4076 | to serve us until such time as the library is fixed. | ||
| 4077 | Actually, what we define here is called `__write', because | ||
| 4078 | `write' is a stub that just jmp's to `__write' (to be | ||
| 4079 | POSIXLY-correct with respect to the global name-space). */ | ||
| 4080 | |||
| 4081 | #include <io.h> /* for _write */ | ||
| 4082 | #include <libc/dosio.h> /* for __file_handle_modes[] */ | ||
| 4083 | |||
| 4084 | static char xbuf[64 * 1024]; /* DOS cannot write more in one chunk */ | ||
| 4085 | |||
| 4086 | #define XBUF_END (xbuf + sizeof (xbuf) - 1) | ||
| 4087 | |||
| 4088 | int | ||
| 4089 | __write (int handle, const void *buffer, size_t count) | ||
| 4090 | { | ||
| 4091 | if (count == 0) | ||
| 4092 | return 0; | ||
| 4093 | |||
| 4094 | if(__file_handle_modes[handle] & O_BINARY) | ||
| 4095 | return _write (handle, buffer, count); | ||
| 4096 | else | ||
| 4097 | { | ||
| 4098 | char *xbp = xbuf; | ||
| 4099 | const char *bp = buffer; | ||
| 4100 | int total_written = 0; | ||
| 4101 | int nmoved = 0, ncr = 0; | ||
| 4102 | |||
| 4103 | while (count) | ||
| 4104 | { | ||
| 4105 | /* The next test makes sure there's space for at least 2 more | ||
| 4106 | characters in xbuf[], so both CR and LF can be put there. */ | ||
| 4107 | if (xbp < XBUF_END) | ||
| 4108 | { | ||
| 4109 | if (*bp == '\n') | ||
| 4110 | { | ||
| 4111 | ncr++; | ||
| 4112 | *xbp++ = '\r'; | ||
| 4113 | } | ||
| 4114 | *xbp++ = *bp++; | ||
| 4115 | nmoved++; | ||
| 4116 | count--; | ||
| 4117 | } | ||
| 4118 | if (xbp >= XBUF_END || !count) | ||
| 4119 | { | ||
| 4120 | size_t to_write = nmoved + ncr; | ||
| 4121 | int written = _write (handle, xbuf, to_write); | ||
| 4122 | |||
| 4123 | if (written == -1) | ||
| 4124 | return -1; | ||
| 4125 | else | ||
| 4126 | total_written += nmoved; /* CRs aren't counted in ret value */ | ||
| 4127 | |||
| 4128 | /* If some, but not all were written (disk full?), return | ||
| 4129 | an estimate of the total written bytes not counting CRs. */ | ||
| 4130 | if (written < to_write) | ||
| 4131 | return total_written - (to_write - written) * nmoved/to_write; | ||
| 4132 | |||
| 4133 | nmoved = 0; | ||
| 4134 | ncr = 0; | ||
| 4135 | xbp = xbuf; | ||
| 4136 | } | ||
| 4137 | } | ||
| 4138 | return total_written; | ||
| 4139 | } | ||
| 4140 | } | ||
| 4141 | |||
| 4142 | /* A low-level file-renaming function which works around Windows 95 bug. | ||
| 4143 | This is pulled directly out of DJGPP v2.01 library sources, and only | ||
| 4144 | used when you compile with DJGPP v2.0. */ | ||
| 4145 | |||
| 4146 | #include <io.h> | ||
| 4147 | |||
| 4148 | int _rename(const char *old, const char *new) | ||
| 4149 | { | ||
| 4150 | __dpmi_regs r; | ||
| 4151 | int olen = strlen(old) + 1; | ||
| 4152 | int i; | ||
| 4153 | int use_lfn = _USE_LFN; | ||
| 4154 | char tempfile[FILENAME_MAX]; | ||
| 4155 | const char *orig = old; | ||
| 4156 | int lfn_fd = -1; | ||
| 4157 | |||
| 4158 | r.x.dx = __tb_offset; | ||
| 4159 | r.x.di = __tb_offset + olen; | ||
| 4160 | r.x.ds = r.x.es = __tb_segment; | ||
| 4161 | |||
| 4162 | if (use_lfn) | ||
| 4163 | { | ||
| 4164 | /* Windows 95 bug: for some filenames, when you rename | ||
| 4165 | file -> file~ (as in Emacs, to leave a backup), the | ||
| 4166 | short 8+3 alias doesn't change, which effectively | ||
| 4167 | makes OLD and NEW the same file. We must rename | ||
| 4168 | through a temporary file to work around this. */ | ||
| 4169 | |||
| 4170 | char *pbase = 0, *p; | ||
| 4171 | static char try_char[] = "abcdefghijklmnopqrstuvwxyz012345789"; | ||
| 4172 | int idx = sizeof(try_char) - 1; | ||
| 4173 | |||
| 4174 | /* Generate a temporary name. Can't use `tmpnam', since $TMPDIR | ||
| 4175 | might point to another drive, which will fail the DOS call. */ | ||
| 4176 | strcpy(tempfile, old); | ||
| 4177 | for (p = tempfile; *p; p++) /* ensure temporary is on the same drive */ | ||
| 4178 | if (*p == '/' || *p == '\\' || *p == ':') | ||
| 4179 | pbase = p; | ||
| 4180 | if (pbase) | ||
| 4181 | pbase++; | ||
| 4182 | else | ||
| 4183 | pbase = tempfile; | ||
| 4184 | strcpy(pbase, "X$$djren$$.$$temp$$"); | ||
| 4185 | |||
| 4186 | do | ||
| 4187 | { | ||
| 4188 | if (idx <= 0) | ||
| 4189 | return -1; | ||
| 4190 | *pbase = try_char[--idx]; | ||
| 4191 | } while (_chmod(tempfile, 0) != -1); | ||
| 4192 | |||
| 4193 | r.x.ax = 0x7156; | ||
| 4194 | _put_path2(tempfile, olen); | ||
| 4195 | _put_path(old); | ||
| 4196 | __dpmi_int(0x21, &r); | ||
| 4197 | if (r.x.flags & 1) | ||
| 4198 | { | ||
| 4199 | errno = __doserr_to_errno(r.x.ax); | ||
| 4200 | return -1; | ||
| 4201 | } | ||
| 4202 | |||
| 4203 | /* Now create a file with the original name. This will | ||
| 4204 | ensure that NEW will always have a 8+3 alias | ||
| 4205 | different from that of OLD. (Seems to be required | ||
| 4206 | when NameNumericTail in the Registry is set to 0.) */ | ||
| 4207 | lfn_fd = _creat(old, 0); | ||
| 4208 | |||
| 4209 | olen = strlen(tempfile) + 1; | ||
| 4210 | old = tempfile; | ||
| 4211 | r.x.di = __tb_offset + olen; | ||
| 4212 | } | ||
| 4213 | |||
| 4214 | for (i=0; i<2; i++) | ||
| 4215 | { | ||
| 4216 | if(use_lfn) | ||
| 4217 | r.x.ax = 0x7156; | ||
| 4218 | else | ||
| 4219 | r.h.ah = 0x56; | ||
| 4220 | _put_path2(new, olen); | ||
| 4221 | _put_path(old); | ||
| 4222 | __dpmi_int(0x21, &r); | ||
| 4223 | if(r.x.flags & 1) | ||
| 4224 | { | ||
| 4225 | if (r.x.ax == 5 && i == 0) /* access denied */ | ||
| 4226 | remove(new); /* and try again */ | ||
| 4227 | else | ||
| 4228 | { | ||
| 4229 | errno = __doserr_to_errno(r.x.ax); | ||
| 4230 | |||
| 4231 | /* Restore to original name if we renamed it to temporary. */ | ||
| 4232 | if (use_lfn) | ||
| 4233 | { | ||
| 4234 | if (lfn_fd != -1) | ||
| 4235 | { | ||
| 4236 | _close (lfn_fd); | ||
| 4237 | remove (orig); | ||
| 4238 | } | ||
| 4239 | _put_path2(orig, olen); | ||
| 4240 | _put_path(tempfile); | ||
| 4241 | r.x.ax = 0x7156; | ||
| 4242 | __dpmi_int(0x21, &r); | ||
| 4243 | } | ||
| 4244 | return -1; | ||
| 4245 | } | ||
| 4246 | } | ||
| 4247 | else | ||
| 4248 | break; | ||
| 4249 | } | ||
| 4250 | |||
| 4251 | /* Success. Delete the file possibly created to work | ||
| 4252 | around the Windows 95 bug. */ | ||
| 4253 | if (lfn_fd != -1) | ||
| 4254 | return (_close (lfn_fd) == 0) ? remove (orig) : -1; | ||
| 4255 | return 0; | ||
| 4256 | } | ||
| 4257 | |||
| 4258 | #endif /* __DJGPP__ == 2 && __DJGPP_MINOR__ == 0 */ | ||
| 4259 | |||
| 4260 | DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names, | 3965 | DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names, |
| 4261 | 0, 0, 0, | 3966 | 0, 0, 0, |
| 4262 | doc: /* Return non-nil if long file names are supported on MS-DOS. */) | 3967 | doc: /* Return non-nil if long file names are supported on MS-DOS. */) |
| @@ -4502,39 +4207,6 @@ init_environment (argc, argv, skip_args) | |||
| 4502 | static int break_stat; /* BREAK check mode status. */ | 4207 | static int break_stat; /* BREAK check mode status. */ |
| 4503 | static int stdin_stat; /* stdin IOCTL status. */ | 4208 | static int stdin_stat; /* stdin IOCTL status. */ |
| 4504 | 4209 | ||
| 4505 | #if __DJGPP__ < 2 | ||
| 4506 | |||
| 4507 | /* These must be global. */ | ||
| 4508 | static _go32_dpmi_seginfo ctrl_break_vector; | ||
| 4509 | static _go32_dpmi_registers ctrl_break_regs; | ||
| 4510 | static int ctrlbreakinstalled = 0; | ||
| 4511 | |||
| 4512 | /* Interrupt level detection of Ctrl-Break. Don't do anything fancy here! */ | ||
| 4513 | |||
| 4514 | void | ||
| 4515 | ctrl_break_func (regs) | ||
| 4516 | _go32_dpmi_registers *regs; | ||
| 4517 | { | ||
| 4518 | Vquit_flag = Qt; | ||
| 4519 | } | ||
| 4520 | |||
| 4521 | void | ||
| 4522 | install_ctrl_break_check () | ||
| 4523 | { | ||
| 4524 | if (!ctrlbreakinstalled) | ||
| 4525 | { | ||
| 4526 | /* Don't press Ctrl-Break if you don't have either DPMI or Emacs | ||
| 4527 | was compiler with Djgpp 1.11 maintenance level 5 or later! */ | ||
| 4528 | ctrlbreakinstalled = 1; | ||
| 4529 | ctrl_break_vector.pm_offset = (int) ctrl_break_func; | ||
| 4530 | _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector, | ||
| 4531 | &ctrl_break_regs); | ||
| 4532 | _go32_dpmi_set_real_mode_interrupt_vector (0x1b, &ctrl_break_vector); | ||
| 4533 | } | ||
| 4534 | } | ||
| 4535 | |||
| 4536 | #endif /* __DJGPP__ < 2 */ | ||
| 4537 | |||
| 4538 | /* Turn off Dos' Ctrl-C checking and inhibit interpretation of | 4210 | /* Turn off Dos' Ctrl-C checking and inhibit interpretation of |
| 4539 | control chars by DOS. Determine the keyboard type. */ | 4211 | control chars by DOS. Determine the keyboard type. */ |
| 4540 | 4212 | ||
| @@ -4551,9 +4223,6 @@ dos_ttraw (struct tty_display_info *tty) | |||
| 4551 | 4223 | ||
| 4552 | break_stat = getcbrk (); | 4224 | break_stat = getcbrk (); |
| 4553 | setcbrk (0); | 4225 | setcbrk (0); |
| 4554 | #if __DJGPP__ < 2 | ||
| 4555 | install_ctrl_break_check (); | ||
| 4556 | #endif | ||
| 4557 | 4226 | ||
| 4558 | if (first_time) | 4227 | if (first_time) |
| 4559 | { | 4228 | { |
| @@ -4585,42 +4254,18 @@ dos_ttraw (struct tty_display_info *tty) | |||
| 4585 | mouse_button_count = outregs.x.bx; | 4254 | mouse_button_count = outregs.x.bx; |
| 4586 | 4255 | ||
| 4587 | #ifndef HAVE_X_WINDOWS | 4256 | #ifndef HAVE_X_WINDOWS |
| 4588 | #if __DJGPP__ >= 2 | ||
| 4589 | /* Save the cursor shape used outside Emacs. */ | 4257 | /* Save the cursor shape used outside Emacs. */ |
| 4590 | outside_cursor = _farpeekw (_dos_ds, 0x460); | 4258 | outside_cursor = _farpeekw (_dos_ds, 0x460); |
| 4591 | #endif | 4259 | #endif |
| 4592 | #endif | ||
| 4593 | } | 4260 | } |
| 4594 | 4261 | ||
| 4595 | first_time = 0; | 4262 | first_time = 0; |
| 4596 | 4263 | ||
| 4597 | #if __DJGPP__ >= 2 | ||
| 4598 | |||
| 4599 | stdin_stat = setmode (fileno (stdin), O_BINARY); | 4264 | stdin_stat = setmode (fileno (stdin), O_BINARY); |
| 4600 | return (stdin_stat != -1); | 4265 | return (stdin_stat != -1); |
| 4601 | } | 4266 | } |
| 4602 | else | 4267 | else |
| 4603 | return (setmode (fileno (stdin), O_BINARY) != -1); | 4268 | return (setmode (fileno (stdin), O_BINARY) != -1); |
| 4604 | |||
| 4605 | #else /* __DJGPP__ < 2 */ | ||
| 4606 | |||
| 4607 | } | ||
| 4608 | |||
| 4609 | /* I think it is wrong to overwrite `stdin_stat' every time | ||
| 4610 | but the first one this function is called, but I don't | ||
| 4611 | want to change the way it used to work in v1.x.--EZ */ | ||
| 4612 | |||
| 4613 | inregs.x.ax = 0x4400; /* Get IOCTL status. */ | ||
| 4614 | inregs.x.bx = 0x00; /* 0 = stdin. */ | ||
| 4615 | intdos (&inregs, &outregs); | ||
| 4616 | stdin_stat = outregs.h.dl; | ||
| 4617 | |||
| 4618 | inregs.x.dx = stdin_stat | 0x0020; /* raw mode */ | ||
| 4619 | inregs.x.ax = 0x4401; /* Set IOCTL status */ | ||
| 4620 | intdos (&inregs, &outregs); | ||
| 4621 | return !outregs.x.cflag; | ||
| 4622 | |||
| 4623 | #endif /* __DJGPP__ < 2 */ | ||
| 4624 | } | 4269 | } |
| 4625 | 4270 | ||
| 4626 | /* Restore status of standard input and Ctrl-C checking. */ | 4271 | /* Restore status of standard input and Ctrl-C checking. */ |
| @@ -4633,8 +4278,6 @@ dos_ttcooked () | |||
| 4633 | setcbrk (break_stat); | 4278 | setcbrk (break_stat); |
| 4634 | mouse_off (); | 4279 | mouse_off (); |
| 4635 | 4280 | ||
| 4636 | #if __DJGPP__ >= 2 | ||
| 4637 | |||
| 4638 | #ifndef HAVE_X_WINDOWS | 4281 | #ifndef HAVE_X_WINDOWS |
| 4639 | /* Restore the cursor shape we found on startup. */ | 4282 | /* Restore the cursor shape we found on startup. */ |
| 4640 | if (outside_cursor) | 4283 | if (outside_cursor) |
| @@ -4646,16 +4289,6 @@ dos_ttcooked () | |||
| 4646 | #endif | 4289 | #endif |
| 4647 | 4290 | ||
| 4648 | return (setmode (fileno (stdin), stdin_stat) != -1); | 4291 | return (setmode (fileno (stdin), stdin_stat) != -1); |
| 4649 | |||
| 4650 | #else /* not __DJGPP__ >= 2 */ | ||
| 4651 | |||
| 4652 | inregs.x.ax = 0x4401; /* Set IOCTL status. */ | ||
| 4653 | inregs.x.bx = 0x00; /* 0 = stdin. */ | ||
| 4654 | inregs.x.dx = stdin_stat; | ||
| 4655 | intdos (&inregs, &outregs); | ||
| 4656 | return !outregs.x.cflag; | ||
| 4657 | |||
| 4658 | #endif /* not __DJGPP__ >= 2 */ | ||
| 4659 | } | 4292 | } |
| 4660 | 4293 | ||
| 4661 | 4294 | ||
| @@ -4735,8 +4368,6 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv) | |||
| 4735 | dup2 (tempout, 1); | 4368 | dup2 (tempout, 1); |
| 4736 | dup2 (temperr, 2); | 4369 | dup2 (temperr, 2); |
| 4737 | 4370 | ||
| 4738 | #if __DJGPP__ > 1 | ||
| 4739 | |||
| 4740 | if (msshell && !argv[3]) | 4371 | if (msshell && !argv[3]) |
| 4741 | { | 4372 | { |
| 4742 | /* MS-DOS native shells are too restrictive. For starters, they | 4373 | /* MS-DOS native shells are too restrictive. For starters, they |
| @@ -4777,10 +4408,7 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv) | |||
| 4777 | result = 0; /* emulate Unixy shell behavior with empty cmd line */ | 4408 | result = 0; /* emulate Unixy shell behavior with empty cmd line */ |
| 4778 | } | 4409 | } |
| 4779 | else | 4410 | else |
| 4780 | 4411 | result = spawnve (P_WAIT, argv[0], argv, envv); | |
| 4781 | #endif /* __DJGPP__ > 1 */ | ||
| 4782 | |||
| 4783 | result = spawnve (P_WAIT, argv[0], argv, envv); | ||
| 4784 | 4412 | ||
| 4785 | dup2 (inbak, 0); | 4413 | dup2 (inbak, 0); |
| 4786 | dup2 (outbak, 1); | 4414 | dup2 (outbak, 1); |
| @@ -4822,88 +4450,7 @@ croak (badfunc) | |||
| 4822 | exit (1); | 4450 | exit (1); |
| 4823 | } | 4451 | } |
| 4824 | 4452 | ||
| 4825 | #if __DJGPP__ < 2 | 4453 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 |
| 4826 | |||
| 4827 | /* ------------------------- Compatibility functions ------------------- | ||
| 4828 | * gethostname | ||
| 4829 | * gettimeofday | ||
| 4830 | */ | ||
| 4831 | |||
| 4832 | /* Hostnames for a pc are not really funny, | ||
| 4833 | but they are used in change log so we emulate the best we can. */ | ||
| 4834 | |||
| 4835 | gethostname (p, size) | ||
| 4836 | char *p; | ||
| 4837 | int size; | ||
| 4838 | { | ||
| 4839 | char *q = egetenv ("HOSTNAME"); | ||
| 4840 | |||
| 4841 | if (!q) q = "pc"; | ||
| 4842 | strcpy (p, q); | ||
| 4843 | return 0; | ||
| 4844 | } | ||
| 4845 | |||
| 4846 | /* When time zones are set from Ms-Dos too many C-libraries are playing | ||
| 4847 | tricks with time values. We solve this by defining our own version | ||
| 4848 | of `gettimeofday' bypassing GO32. Our version needs to be initialized | ||
| 4849 | once and after each call to `tzset' with TZ changed. That is | ||
| 4850 | accomplished by aliasing tzset to init_gettimeofday. */ | ||
| 4851 | |||
| 4852 | static struct tm time_rec; | ||
| 4853 | |||
| 4854 | int | ||
| 4855 | gettimeofday (struct timeval *tp, struct timezone *tzp) | ||
| 4856 | { | ||
| 4857 | if (tp) | ||
| 4858 | { | ||
| 4859 | struct time t; | ||
| 4860 | struct tm tm; | ||
| 4861 | |||
| 4862 | gettime (&t); | ||
| 4863 | if (t.ti_hour < time_rec.tm_hour) /* midnight wrap */ | ||
| 4864 | { | ||
| 4865 | struct date d; | ||
| 4866 | getdate (&d); | ||
| 4867 | time_rec.tm_year = d.da_year - 1900; | ||
| 4868 | time_rec.tm_mon = d.da_mon - 1; | ||
| 4869 | time_rec.tm_mday = d.da_day; | ||
| 4870 | } | ||
| 4871 | |||
| 4872 | time_rec.tm_hour = t.ti_hour; | ||
| 4873 | time_rec.tm_min = t.ti_min; | ||
| 4874 | time_rec.tm_sec = t.ti_sec; | ||
| 4875 | |||
| 4876 | tm = time_rec; | ||
| 4877 | tm.tm_gmtoff = dos_timezone_offset; | ||
| 4878 | |||
| 4879 | tp->tv_sec = mktime (&tm); /* may modify tm */ | ||
| 4880 | tp->tv_usec = t.ti_hund * (1000000 / 100); | ||
| 4881 | } | ||
| 4882 | /* Ignore tzp; it's obsolescent. */ | ||
| 4883 | return 0; | ||
| 4884 | } | ||
| 4885 | |||
| 4886 | #endif /* __DJGPP__ < 2 */ | ||
| 4887 | |||
| 4888 | /* | ||
| 4889 | * A list of unimplemented functions that we silently ignore. | ||
| 4890 | */ | ||
| 4891 | |||
| 4892 | #if __DJGPP__ < 2 | ||
| 4893 | unsigned alarm (s) unsigned s; {} | ||
| 4894 | fork () { return 0; } | ||
| 4895 | int kill (x, y) int x, y; { return -1; } | ||
| 4896 | nice (p) int p; {} | ||
| 4897 | void volatile pause () {} | ||
| 4898 | sigsetmask (x) int x; { return 0; } | ||
| 4899 | sigblock (mask) int mask; { return 0; } | ||
| 4900 | #endif | ||
| 4901 | |||
| 4902 | setpgrp () {return 0; } | ||
| 4903 | setpriority (x,y,z) int x,y,z; { return 0; } | ||
| 4904 | |||
| 4905 | #if __DJGPP__ > 1 | ||
| 4906 | #if __DJGPP_MINOR__ < 2 | ||
| 4907 | 4454 | ||
| 4908 | #ifdef POSIX_SIGNALS | 4455 | #ifdef POSIX_SIGNALS |
| 4909 | 4456 | ||
| @@ -5011,7 +4558,6 @@ sigblock (mask) int mask; { return 0; } | |||
| 5011 | 4558 | ||
| 5012 | #endif /* not POSIX_SIGNALS */ | 4559 | #endif /* not POSIX_SIGNALS */ |
| 5013 | #endif /* not __DJGPP_MINOR__ < 2 */ | 4560 | #endif /* not __DJGPP_MINOR__ < 2 */ |
| 5014 | #endif /* __DJGPP__ > 1 */ | ||
| 5015 | 4561 | ||
| 5016 | #ifndef HAVE_SELECT | 4562 | #ifndef HAVE_SELECT |
| 5017 | #include "sysselect.h" | 4563 | #include "sysselect.h" |
| @@ -5194,7 +4740,6 @@ abort () | |||
| 5194 | dos_ttcooked (); | 4740 | dos_ttcooked (); |
| 5195 | ScreenSetCursor (10, 0); | 4741 | ScreenSetCursor (10, 0); |
| 5196 | cputs ("\r\n\nEmacs aborted!\r\n"); | 4742 | cputs ("\r\n\nEmacs aborted!\r\n"); |
| 5197 | #if __DJGPP__ > 1 | ||
| 5198 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 | 4743 | #if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2 |
| 5199 | if (screen_virtual_segment) | 4744 | if (screen_virtual_segment) |
| 5200 | dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X); | 4745 | dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X); |
| @@ -5204,7 +4749,6 @@ abort () | |||
| 5204 | #else /* __DJGPP_MINOR__ >= 2 */ | 4749 | #else /* __DJGPP_MINOR__ >= 2 */ |
| 5205 | raise (SIGABRT); | 4750 | raise (SIGABRT); |
| 5206 | #endif /* __DJGPP_MINOR__ >= 2 */ | 4751 | #endif /* __DJGPP_MINOR__ >= 2 */ |
| 5207 | #endif | ||
| 5208 | exit (2); | 4752 | exit (2); |
| 5209 | } | 4753 | } |
| 5210 | #endif | 4754 | #endif |
diff --git a/src/s/msdos.h b/src/s/msdos.h index 88771b9f15f..29fbdab8369 100644 --- a/src/s/msdos.h +++ b/src/s/msdos.h | |||
| @@ -30,11 +30,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 30 | #define MSDOS | 30 | #define MSDOS |
| 31 | #endif | 31 | #endif |
| 32 | 32 | ||
| 33 | #ifdef __GO32__ | ||
| 34 | #ifndef __DJGPP__ | 33 | #ifndef __DJGPP__ |
| 35 | #define __DJGPP__ 1 /* V2 defines __DJGPP__ == 2 */ | ||
| 36 | #endif | ||
| 37 | #else | ||
| 38 | You lose; /* Emacs for DOS must be compiled with DJGPP */ | 34 | You lose; /* Emacs for DOS must be compiled with DJGPP */ |
| 39 | #endif | 35 | #endif |
| 40 | 36 | ||
| @@ -97,34 +93,11 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 97 | #define _setjmp setjmp | 93 | #define _setjmp setjmp |
| 98 | #define _longjmp longjmp | 94 | #define _longjmp longjmp |
| 99 | 95 | ||
| 100 | #if __DJGPP__ < 2 | ||
| 101 | |||
| 102 | /* New chdir () routine. | ||
| 103 | DJGPP v2.0 and later doesn't need it because its chdir() does | ||
| 104 | set the drive itself. */ | ||
| 105 | #ifdef chdir | ||
| 106 | #undef chdir | ||
| 107 | #endif | ||
| 108 | #define chdir sys_chdir | ||
| 109 | |||
| 110 | #define LIBS_SYSTEM -lpc /* isn't required in DJGPP v2.0, either */ | ||
| 111 | |||
| 112 | #endif /* __DJGPP__ < 2 */ | ||
| 113 | |||
| 114 | #if __DJGPP__ > 1 | ||
| 115 | |||
| 116 | #define DATA_START (&etext + 1) | 96 | #define DATA_START (&etext + 1) |
| 117 | #define TEXT_START &start | 97 | #define TEXT_START &start |
| 118 | 98 | ||
| 119 | #define _NAIVE_DOS_REGS | 99 | #define _NAIVE_DOS_REGS |
| 120 | 100 | ||
| 121 | #else /* not __DJGPP__ > 1 */ | ||
| 122 | |||
| 123 | /* This somehow needs to be defined even though we use COFF. */ | ||
| 124 | #define TEXT_START -1 | ||
| 125 | |||
| 126 | #endif /* not __DJGPP__ > 1 */ | ||
| 127 | |||
| 128 | #define ORDINARY_LINK | 101 | #define ORDINARY_LINK |
| 129 | 102 | ||
| 130 | /* command.com does not understand `...` so we define this. */ | 103 | /* command.com does not understand `...` so we define this. */ |
| @@ -133,19 +106,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 133 | 106 | ||
| 134 | #define NULL_DEVICE "nul" | 107 | #define NULL_DEVICE "nul" |
| 135 | 108 | ||
| 136 | #if __DJGPP__ < 2 | ||
| 137 | #define O_RDONLY 0x0001 | ||
| 138 | #define O_WRONLY 0x0002 | ||
| 139 | #define O_RDWR 0x0004 | ||
| 140 | #define O_CREAT 0x0100 | ||
| 141 | #define O_TRUNC 0x0200 | ||
| 142 | #define O_EXCL 0x0400 | ||
| 143 | #define O_APPEND 0x0800 | ||
| 144 | #define O_TEXT 0x4000 | ||
| 145 | #define O_BINARY 0x8000 | ||
| 146 | #define NO_MATHERR | ||
| 147 | #endif | ||
| 148 | |||
| 149 | #define HAVE_INVERSE_HYPERBOLIC | 109 | #define HAVE_INVERSE_HYPERBOLIC |
| 150 | #define FLOAT_CHECK_DOMAIN | 110 | #define FLOAT_CHECK_DOMAIN |
| 151 | 111 | ||
| @@ -166,12 +126,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 166 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') | 126 | #define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\') |
| 167 | #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) | 127 | #define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_)) |
| 168 | 128 | ||
| 169 | /* Call init_gettimeofday when TZ changes. */ | ||
| 170 | #if __DJGPP__ < 2 | ||
| 171 | #define LOCALTIME_CACHE | ||
| 172 | #define tzset init_gettimeofday | ||
| 173 | #endif | ||
| 174 | |||
| 175 | /* bcopy under djgpp is quite safe */ | 129 | /* bcopy under djgpp is quite safe */ |
| 176 | #define GAP_USE_BCOPY | 130 | #define GAP_USE_BCOPY |
| 177 | #define BCOPY_UPWARD_SAFE 1 | 131 | #define BCOPY_UPWARD_SAFE 1 |
| @@ -181,9 +135,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */ | |||
| 181 | #define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") | 135 | #define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B") |
| 182 | 136 | ||
| 183 | /* Do we have POSIX signals? */ | 137 | /* Do we have POSIX signals? */ |
| 184 | #if __DJGPP__ > 1 | ||
| 185 | #define POSIX_SIGNALS | 138 | #define POSIX_SIGNALS |
| 186 | #endif | ||
| 187 | 139 | ||
| 188 | /* We have (the code to control) a mouse. */ | 140 | /* We have (the code to control) a mouse. */ |
| 189 | #define HAVE_MOUSE | 141 | #define HAVE_MOUSE |
diff --git a/src/sysdep.c b/src/sysdep.c index e23f52d92e5..71b2a0f461b 100644 --- a/src/sysdep.c +++ b/src/sysdep.c | |||
| @@ -90,11 +90,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 90 | #include "msdos.h" | 90 | #include "msdos.h" |
| 91 | #include <sys/param.h> | 91 | #include <sys/param.h> |
| 92 | 92 | ||
| 93 | #if __DJGPP__ > 1 | ||
| 94 | extern int etext; | 93 | extern int etext; |
| 95 | extern unsigned start __asm__ ("start"); | 94 | extern unsigned start __asm__ ("start"); |
| 96 | #endif | 95 | #endif |
| 97 | #endif | ||
| 98 | 96 | ||
| 99 | #ifndef USE_CRT_DLL | 97 | #ifndef USE_CRT_DLL |
| 100 | #ifndef errno | 98 | #ifndef errno |
| @@ -462,13 +460,7 @@ wait_for_termination (pid) | |||
| 462 | #endif /* not POSIX_SIGNALS */ | 460 | #endif /* not POSIX_SIGNALS */ |
| 463 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ | 461 | #endif /* not BSD_SYSTEM, and not HPUX version >= 6 */ |
| 464 | #else /* not subprocesses */ | 462 | #else /* not subprocesses */ |
| 465 | #if __DJGPP__ > 1 | ||
| 466 | break; | 463 | break; |
| 467 | #else /* not __DJGPP__ > 1 */ | ||
| 468 | if (kill (pid, 0) < 0) | ||
| 469 | break; | ||
| 470 | wait (0); | ||
| 471 | #endif /* not __DJGPP__ > 1*/ | ||
| 472 | #endif /* not subprocesses */ | 464 | #endif /* not subprocesses */ |
| 473 | } | 465 | } |
| 474 | } | 466 | } |
| @@ -672,10 +664,8 @@ sys_subshell () | |||
| 672 | 664 | ||
| 673 | #ifdef DOS_NT | 665 | #ifdef DOS_NT |
| 674 | pid = 0; | 666 | pid = 0; |
| 675 | #if __DJGPP__ > 1 | ||
| 676 | save_signal_handlers (saved_handlers); | 667 | save_signal_handlers (saved_handlers); |
| 677 | synch_process_alive = 1; | 668 | synch_process_alive = 1; |
| 678 | #endif /* __DJGPP__ > 1 */ | ||
| 679 | #else | 669 | #else |
| 680 | pid = vfork (); | 670 | pid = vfork (); |
| 681 | if (pid == -1) | 671 | if (pid == -1) |
| @@ -747,7 +737,7 @@ sys_subshell () | |||
| 747 | } | 737 | } |
| 748 | 738 | ||
| 749 | /* Do this now if we did not do it before. */ | 739 | /* Do this now if we did not do it before. */ |
| 750 | #if !defined (MSDOS) || __DJGPP__ == 1 | 740 | #ifndef MSDOS |
| 751 | save_signal_handlers (saved_handlers); | 741 | save_signal_handlers (saved_handlers); |
| 752 | synch_process_alive = 1; | 742 | synch_process_alive = 1; |
| 753 | #endif | 743 | #endif |
diff --git a/src/unexec.c b/src/unexec.c index a1bb5460d3c..6cb27b35c36 100644 --- a/src/unexec.c +++ b/src/unexec.c | |||
| @@ -131,11 +131,9 @@ initialize nonstandard fields in the file header | |||
| 131 | #ifdef HAVE_COFF_H | 131 | #ifdef HAVE_COFF_H |
| 132 | #include <coff.h> | 132 | #include <coff.h> |
| 133 | #ifdef MSDOS | 133 | #ifdef MSDOS |
| 134 | #if __DJGPP__ > 1 | ||
| 135 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ | 134 | #include <fcntl.h> /* for O_RDONLY, O_RDWR */ |
| 136 | #include <crt0.h> /* for _crt0_startup_flags and its bits */ | 135 | #include <crt0.h> /* for _crt0_startup_flags and its bits */ |
| 137 | static int save_djgpp_startup_flags; | 136 | static int save_djgpp_startup_flags; |
| 138 | #endif /* __DJGPP__ > 1 */ | ||
| 139 | #define filehdr external_filehdr | 137 | #define filehdr external_filehdr |
| 140 | #define scnhdr external_scnhdr | 138 | #define scnhdr external_scnhdr |
| 141 | #define syment external_syment | 139 | #define syment external_syment |
| @@ -310,7 +308,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 310 | if (a_out >= 0) | 308 | if (a_out >= 0) |
| 311 | { | 309 | { |
| 312 | #ifdef MSDOS | 310 | #ifdef MSDOS |
| 313 | #if __DJGPP__ > 1 | ||
| 314 | /* Support the coff-go32-exe format with a prepended stub, since | 311 | /* Support the coff-go32-exe format with a prepended stub, since |
| 315 | this is what GCC 2.8.0 and later generates by default in DJGPP. */ | 312 | this is what GCC 2.8.0 and later generates by default in DJGPP. */ |
| 316 | unsigned short mz_header[3]; | 313 | unsigned short mz_header[3]; |
| @@ -328,7 +325,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name) | |||
| 328 | } | 325 | } |
| 329 | else | 326 | else |
| 330 | lseek (a_out, 0L, 0); | 327 | lseek (a_out, 0L, 0); |
| 331 | #endif /* __DJGPP__ > 1 */ | ||
| 332 | #endif /* MSDOS */ | 328 | #endif /* MSDOS */ |
| 333 | if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) | 329 | if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr)) |
| 334 | { | 330 | { |
| @@ -532,7 +528,6 @@ copy_text_and_data (new, a_out) | |||
| 532 | register char *ptr; | 528 | register char *ptr; |
| 533 | 529 | ||
| 534 | #ifdef MSDOS | 530 | #ifdef MSDOS |
| 535 | #if __DJGPP__ >= 2 | ||
| 536 | /* Dump the original table of exception handlers, not the one | 531 | /* Dump the original table of exception handlers, not the one |
| 537 | where our exception hooks are registered. */ | 532 | where our exception hooks are registered. */ |
| 538 | __djgpp_exception_toggle (); | 533 | __djgpp_exception_toggle (); |
| @@ -542,7 +537,6 @@ copy_text_and_data (new, a_out) | |||
| 542 | save_djgpp_startup_flags = _crt0_startup_flags; | 537 | save_djgpp_startup_flags = _crt0_startup_flags; |
| 543 | _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); | 538 | _crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR); |
| 544 | #endif | 539 | #endif |
| 545 | #endif | ||
| 546 | 540 | ||
| 547 | lseek (new, (long) text_scnptr, 0); | 541 | lseek (new, (long) text_scnptr, 0); |
| 548 | ptr = (char *) f_ohdr.text_start; | 542 | ptr = (char *) f_ohdr.text_start; |
| @@ -555,14 +549,12 @@ copy_text_and_data (new, a_out) | |||
| 555 | write_segment (new, ptr, end); | 549 | write_segment (new, ptr, end); |
| 556 | 550 | ||
| 557 | #ifdef MSDOS | 551 | #ifdef MSDOS |
| 558 | #if __DJGPP__ >= 2 | ||
| 559 | /* Restore our exception hooks. */ | 552 | /* Restore our exception hooks. */ |
| 560 | __djgpp_exception_toggle (); | 553 | __djgpp_exception_toggle (); |
| 561 | 554 | ||
| 562 | /* Restore the startup flags. */ | 555 | /* Restore the startup flags. */ |
| 563 | _crt0_startup_flags = save_djgpp_startup_flags; | 556 | _crt0_startup_flags = save_djgpp_startup_flags; |
| 564 | #endif | 557 | #endif |
| 565 | #endif | ||
| 566 | 558 | ||
| 567 | 559 | ||
| 568 | return 0; | 560 | return 0; |
diff --git a/src/w16select.c b/src/w16select.c index d6951be4d82..c6a84e46a60 100644 --- a/src/w16select.c +++ b/src/w16select.c | |||
| @@ -23,7 +23,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */ | |||
| 23 | menus, and the Windows clipboard. */ | 23 | menus, and the Windows clipboard. */ |
| 24 | 24 | ||
| 25 | /* Written by Dale P. Smith <dpsm@en.com> */ | 25 | /* Written by Dale P. Smith <dpsm@en.com> */ |
| 26 | /* Adapted to DJGPP v1 by Eli Zaretskii <eliz@is.elta.co.il> */ | 26 | /* Adapted to DJGPP by Eli Zaretskii <eliz@gnu.org> */ |
| 27 | 27 | ||
| 28 | #ifdef MSDOS | 28 | #ifdef MSDOS |
| 29 | 29 | ||
| @@ -94,25 +94,6 @@ static unsigned char *last_clipboard_text; | |||
| 94 | /* The size of allocated storage for storing the clipboard data. */ | 94 | /* The size of allocated storage for storing the clipboard data. */ |
| 95 | static size_t clipboard_storage_size; | 95 | static size_t clipboard_storage_size; |
| 96 | 96 | ||
| 97 | /* Emulation of `__dpmi_int' and friends for DJGPP v1.x */ | ||
| 98 | |||
| 99 | #if __DJGPP__ < 2 | ||
| 100 | |||
| 101 | typedef _go32_dpmi_registers __dpmi_regs; | ||
| 102 | #define __tb _go32_info_block.linear_address_of_transfer_buffer | ||
| 103 | #define _dos_ds _go32_info_block.selector_for_linear_memory | ||
| 104 | |||
| 105 | static int | ||
| 106 | __dpmi_int (intno, regs) | ||
| 107 | int intno; | ||
| 108 | __dpmi_regs *regs; | ||
| 109 | { | ||
| 110 | regs->x.ss = regs->x.sp = regs->x.flags = 0; | ||
| 111 | return _go32_dpmi_simulate_int (intno, regs); | ||
| 112 | } | ||
| 113 | |||
| 114 | #endif /* __DJGPP__ < 2 */ | ||
| 115 | |||
| 116 | /* C functions to access the Windows 3.1x clipboard from DOS apps. | 97 | /* C functions to access the Windows 3.1x clipboard from DOS apps. |
| 117 | 98 | ||
| 118 | The information was obtained from the Microsoft Knowledge Base, | 99 | The information was obtained from the Microsoft Knowledge Base, |