summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog63
-rw-r--r--src/Makefile.in13
-rw-r--r--src/buffer.c6
-rw-r--r--src/callproc.c5
-rw-r--r--src/dired.c4
-rw-r--r--src/dispnew.c3
-rw-r--r--src/dosfns.c7
-rw-r--r--src/ecrt0.c4
-rw-r--r--src/emacs.c9
-rw-r--r--src/fileio.c27
-rw-r--r--src/filelock.c3
-rw-r--r--src/floatfns.c4
-rw-r--r--src/gmalloc.c10
-rw-r--r--src/keyboard.c4
-rw-r--r--src/lread.c7
-rw-r--r--src/msdos.c458
-rw-r--r--src/process.c4
-rw-r--r--src/s/msdos.h50
-rw-r--r--src/s/netbsd.h2
-rw-r--r--src/sysdep.c18
-rw-r--r--src/unexaix.c1
-rw-r--r--src/unexec.c11
-rw-r--r--src/w16select.c21
-rw-r--r--src/w32term.c4
-rw-r--r--src/xdisp.c33
-rw-r--r--src/xrdb.c3
-rw-r--r--src/xterm.c2
27 files changed, 108 insertions, 668 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 908d83759f3..8859a10ad7a 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,66 @@
+2010-04-02 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove extern errno declarations.
+ * xterm.c:
+ * xrdb.c:
+ * w32term.c:
+ * unexec.c:
+ * unexaix.c:
+ * sysdep.c:
+ * process.c:
+ * lread.c:
+ * keyboard.c:
+ * floatfns.c:
+ * filelock.c:
+ * fileio.c:
+ * emacs.c (main):
+ * ecrt0.c:
+ * dispnew.c:
+ * callproc.c:
+ * buffer.c: Remove errno extern declarations.
+ * s/netbsd.h (NEED_ERRNO): Remove.
+
+2010-04-01 Dan Nicolaescu <dann@ics.uci.edu>
+
+ Remove all uses of LIBX11_SYSTEM.
+ * Makefile.in (LIBX11_SYSTEM): Remove.
+ * s/msdos.h (LIBX11_SYSTEM): Do not define, define LIBS_SYSTEM
+ instead.
+
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ Remove support for DJGPP v1.x (bug#5813).
+
+ * 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__.
+
+2010-04-01 Eli Zaretskii <eliz@gnu.org>
+
+ * xdisp.c (set_cursor_from_row): Fix cursor positioning when the
+ string with `cursor' property comes from an `after-string'
+ overlay. (Bug#5816)
+
+2010-04-01 Glenn Morris <rgm@gnu.org>
+
+ * Makefile.in (LIBTIFF, LIBJPEG, LIBPNG, LIBGIF, LIBXPM, XFT_LIBS):
+ Define as Makefile variables.
+ (LIBX): Use above variables rather than directly using autoconf.
+
2010-03-31 Dan Nicolaescu <dann@ics.uci.edu>
Clean up BSD_SYSTEM use.
diff --git a/src/Makefile.in b/src/Makefile.in
index 2305f6f6533..cd5027dc4d8 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -68,6 +68,13 @@ bootstrap_exe = ${abs_builddir}/bootstrap-emacs${EXEEXT}
OTHER_FILES = @OTHER_FILES@
+LIBTIFF=@LIBTIFF@
+LIBJPEG=@LIBJPEG@
+LIBPNG=@LIBPNG@
+LIBGIF=@LIBGIF@
+LIBXPM=@LIBXPM@
+XFT_LIBS=@XFT_LIBS@
+
# ========================== start of cpp stuff =======================
/* From here on, comments must be done in C syntax. */
@@ -277,10 +284,6 @@ ALL_OBJC_CFLAGS=$(ALL_CFLAGS) @GNU_OBJC_CFLAGS@
#endif
$(CC) -c $(CPPFLAGS) $(ALL_OBJC_CFLAGS) $<
-#ifndef LIBX11_SYSTEM
-#define LIBX11_SYSTEM
-#endif
-
#ifndef LIB_X11_LIB
#define LIB_X11_LIB -lX11
#endif
@@ -369,7 +372,7 @@ LIBXT=$(LIBW)
/* LD_SWITCH_X_DEFAULT comes after everything else that specifies
options for where to find X libraries, but before those libraries. */
X11_LDFLAGS = LD_SWITCH_X_SITE LD_SWITCH_X_DEFAULT
-LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) @LIBTIFF@ @LIBJPEG@ @LIBPNG@ @LIBGIF@ @LIBXPM@ LIB_X11_LIB LIBX11_SYSTEM @XFT_LIBS@
+LIBX= $(LIBXMENU) $(X11_LDFLAGS) $(LIBXT) $(LIBTIFF) $(LIBJPEG) $(LIBPNG) $(LIBGIF) $(LIBXPM) LIB_X11_LIB $(XFT_LIBS)
#else /* not HAVE_X11 */
LIBX= $(LIBXMENU) LD_SWITCH_X_SITE
#endif /* not HAVE_X11 */
diff --git a/src/buffer.c b/src/buffer.c
index 0c6e57d45be..9035a986b4c 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -28,11 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <setjmp.h>
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
-
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
@@ -4627,7 +4622,6 @@ buffer_slot_type_mismatch (newval, type)
#endif
#include <stdio.h>
-#include <errno.h>
#if MAP_ANON == 0
#include <fcntl.h>
diff --git a/src/callproc.c b/src/callproc.c
index bed3302e508..378c647f385 100644
--- a/src/callproc.c
+++ b/src/callproc.c
@@ -25,10 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <stdio.h>
#include <setjmp.h>
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* Define SIGCHLD as an alias for SIGCLD. */
#if !defined (SIGCHLD) && defined (SIGCLD)
@@ -61,7 +57,6 @@ extern int errno;
#include <fcntl.h>
#include <sys/stat.h>
#include <sys/param.h>
-#include <errno.h>
#endif /* MSDOS */
#ifndef O_RDONLY
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)
char *fullname = (char *) alloca (len + pos + 2);
#ifdef MSDOS
-#if __DJGPP__ > 1
/* Some fields of struct stat are *very* expensive to compute on MS-DOS,
but aren't required here. Avoid computing the following fields:
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)
unsigned short save_djstat_flags = _djstat_flags;
_djstat_flags = _STAT_INODE | _STAT_EXEC_MAGIC | _STAT_DIRSIZE;
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
bcopy (SDATA (dirname), fullname, pos);
@@ -888,9 +886,7 @@ file_name_completion_stat (dirname, dp, st_addr)
#else
value = stat (fullname, st_addr);
#ifdef MSDOS
-#if __DJGPP__ > 1
_djstat_flags = save_djstat_flags;
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
return value;
#endif /* S_IFLNK */
diff --git a/src/dispnew.c b/src/dispnew.c
index 52d7f38728f..2be00c9c3b0 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -5809,9 +5809,6 @@ window_change_signal (signalnum) /* If we don't have an argument, */
int signalnum; /* some compilers complain in signal calls. */
{
int width, height;
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
int old_errno = errno;
struct tty_display_info *tty;
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/>. */
#include <grp.h>
#include <crt0.h>
-#ifndef __DJGPP_MINOR__
-# define __tb _go32_info_block.linear_address_of_transfer_buffer;
-#endif
-
DEFUN ("int86", Fint86, Sint86, 2, 2, 0,
doc: /* Call specific MS-DOS interrupt number INTERRUPT with REGISTERS.
Return the updated REGISTER vector.
@@ -385,8 +381,6 @@ init_dosfns ()
}
#endif /* !HAVE_X_WINDOWS */
-#if __DJGPP__ >= 2
-
/* Without this, we never see hidden files.
Don't OR it with the previous value, so the value recorded at dump
time, possibly with `preserve-case' flags set, won't get through. */
@@ -398,7 +392,6 @@ init_dosfns ()
if (!NILP (Fmsdos_long_file_names ()))
__opendir_flags |= __OPENDIR_PRESERVE_CASE;
#endif /* __DJGPP_MINOR__ == 0 */
-#endif /* __DJGPP__ >= 2 */
}
#ifndef HAVE_X_WINDOWS
diff --git a/src/ecrt0.c b/src/ecrt0.c
index 7dbbd6c5ef1..40549884935 100644
--- a/src/ecrt0.c
+++ b/src/ecrt0.c
@@ -59,10 +59,6 @@ And always:
int data_start = 0;
-#ifdef NEED_ERRNO
-int errno;
-#endif
-
#ifndef MSDOS
char **environ;
#endif
diff --git a/src/emacs.c b/src/emacs.c
index 6327fd8a7d3..400a6b0e594 100644
--- a/src/emacs.c
+++ b/src/emacs.c
@@ -756,9 +756,6 @@ main (int argc, char **argv)
char stack_bottom_variable;
int do_initial_setlocale;
int skip_args = 0;
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
#ifdef HAVE_SETRLIMIT
struct rlimit rlim;
#endif
@@ -945,7 +942,6 @@ main (int argc, char **argv)
#endif /* MSDOS || WINDOWSNT */
#ifdef MSDOS
-#if __DJGPP__ >= 2
if (!isatty (fileno (stdin)))
setmode (fileno (stdin), O_BINARY);
if (!isatty (fileno (stdout)))
@@ -953,11 +949,6 @@ main (int argc, char **argv)
fflush (stdout);
setmode (fileno (stdout), O_BINARY);
}
-#else /* not __DJGPP__ >= 2 */
- (stdin)->_flag &= ~_IOTEXT;
- (stdout)->_flag &= ~_IOTEXT;
- (stderr)->_flag &= ~_IOTEXT;
-#endif /* not __DJGPP__ >= 2 */
#endif /* MSDOS */
#ifdef SET_EMACS_PRIORITY
diff --git a/src/fileio.c b/src/fileio.c
index a80ba11bcab..c62d5724eff 100644
--- a/src/fileio.c
+++ b/src/fileio.c
@@ -53,12 +53,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <ctype.h>
#include <errno.h>
-#ifndef vax11c
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-#endif
-
#include "lisp.h"
#include "intervals.h"
#include "buffer.h"
@@ -79,11 +73,9 @@ extern int errno;
#ifdef MSDOS
#include "msdos.h"
#include <sys/param.h>
-#if __DJGPP__ >= 2
#include <fcntl.h>
#include <string.h>
#endif
-#endif
#ifdef DOS_NT
#define CORRECT_DIR_SEPS(s) \
@@ -2012,7 +2004,6 @@ uid and gid of FILE to NEWNAME. */)
copyable by us. */
input_file_statable_p = (fstat (ifd, &st) >= 0);
-#if !defined (MSDOS) || __DJGPP__ > 1
if (out_st.st_mode != 0
&& st.st_dev == out_st.st_dev && st.st_ino == out_st.st_ino)
{
@@ -2020,7 +2011,6 @@ uid and gid of FILE to NEWNAME. */)
report_file_error ("Input and output files are the same",
Fcons (file, Fcons (newname, Qnil)));
}
-#endif
#if defined (S_ISREG) && defined (S_ISLNK)
if (input_file_statable_p)
@@ -2091,7 +2081,7 @@ uid and gid of FILE to NEWNAME. */)
emacs_close (ifd);
-#if defined (__DJGPP__) && __DJGPP__ > 1
+#ifdef MSDOS
if (input_file_statable_p)
{
/* In DJGPP v2.0 and later, fstat usually returns true file mode bits,
@@ -2101,7 +2091,7 @@ uid and gid of FILE to NEWNAME. */)
if ((_djstat_flags & _STFAIL_WRITEBIT) == 0)
chmod (SDATA (encoded_newname), st.st_mode & 07777);
}
-#endif /* DJGPP version 2 or newer */
+#endif /* MSDOS */
#endif /* not WINDOWSNT */
/* Discard the unwind protects. */
@@ -2477,16 +2467,7 @@ check_executable (filename)
struct stat st;
if (stat (filename, &st) < 0)
return 0;
-#if defined (WINDOWSNT) || (defined (MSDOS) && __DJGPP__ > 1)
return ((st.st_mode & S_IEXEC) != 0);
-#else
- return (S_ISREG (st.st_mode)
- && len >= 5
- && (xstrcasecmp ((suffix = filename + len-4), ".com") == 0
- || xstrcasecmp (suffix, ".exe") == 0
- || xstrcasecmp (suffix, ".bat") == 0)
- || (st.st_mode & S_IFMT) == S_IFDIR);
-#endif /* not WINDOWSNT */
#else /* not DOS_NT */
#ifdef HAVE_EUIDACCESS
return (euidaccess (filename, 1) >= 0);
@@ -2885,10 +2866,6 @@ Return nil, if file does not exist or is not accessible. */)
if (stat (SDATA (absname), &st) < 0)
return Qnil;
-#if defined (MSDOS) && __DJGPP__ < 2
- if (check_executable (SDATA (absname)))
- st.st_mode |= S_IEXEC;
-#endif /* MSDOS && __DJGPP__ < 2 */
return make_number (st.st_mode & 07777);
}
diff --git a/src/filelock.c b/src/filelock.c
index 7c69ea954fc..b11338c58b6 100644
--- a/src/filelock.c
+++ b/src/filelock.c
@@ -47,9 +47,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#endif /* __FreeBSD__ */
#include <errno.h>
-#ifndef errno
-extern int errno;
-#endif
#include "lisp.h"
#include "buffer.h"
diff --git a/src/floatfns.c b/src/floatfns.c
index 97d9ec00aae..3f7030b7605 100644
--- a/src/floatfns.c
+++ b/src/floatfns.c
@@ -99,10 +99,6 @@ extern double logb ();
#ifdef FLOAT_CHECK_ERRNO
# include <errno.h>
-
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
#endif
#ifdef FLOAT_CATCH_SIGILL
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));
extern void free PP ((__ptr_t __ptr));
/* Allocate SIZE bytes allocated to ALIGNMENT bytes. */
-#if ! (defined (_MALLOC_INTERNAL) && __DJGPP__ - 0 == 1) /* Avoid conflict. */
+#if !defined (_MALLOC_INTERNAL) || defined (MSDOS) /* Avoid conflict. */
extern __ptr_t memalign PP ((__malloc_size_t __alignment,
__malloc_size_t __size));
extern int posix_memalign PP ((__ptr_t *, __malloc_size_t,
@@ -1763,13 +1763,6 @@ Fifth Floor, Boston, MA 02110-1301, USA. */
#include <malloc.h>
#endif
-#if __DJGPP__ - 0 == 1
-
-/* There is some problem with memalign in DJGPP v1 and we are supposed
- to omit it. Noone told me why, they just told me to do it. */
-
-#else
-
__ptr_t (*__memalign_hook) PP ((__malloc_size_t __size,
__malloc_size_t __alignment));
@@ -1878,7 +1871,6 @@ posix_memalign (memptr, alignment, size)
return 0;
}
-#endif /* Not DJGPP v1 */
/* Allocate memory on a page boundary.
Copyright (C) 1991, 92, 93, 94, 96 Free Software Foundation, Inc.
diff --git a/src/keyboard.c b/src/keyboard.c
index 3cd042fb21e..f2aeff89542 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -79,10 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "nsterm.h"
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* Variables for blockinput.h: */
/* Non-zero if interrupt input is blocked right now. */
diff --git a/src/lread.c b/src/lread.c
index ba9d5378104..83ebc8b3b10 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/>. */
#include "blockinput.h"
#ifdef MSDOS
-#if __DJGPP__ < 2
-#include <unistd.h> /* to get X_OK */
-#endif
#include "msdos.h"
#endif
@@ -76,10 +73,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define file_tell ftell
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* hash table read constants */
Lisp_Object Qhash_table, Qdata;
Lisp_Object Qtest, Qsize;
diff --git a/src/msdos.c b/src/msdos.c
index a413184f966..6cde7cd6ebc 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/>. */
#include <sys/stat.h> /* for _fixpath */
#include <unistd.h> /* for chdir, dup, dup2, etc. */
#include <dir.h> /* for getdisk */
-#if __DJGPP__ >= 2
#pragma pack(0) /* dir.h does a pack(4), which isn't GCC's default */
#include <fcntl.h>
#include <io.h> /* for setmode */
@@ -47,7 +46,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <sys/farptr.h> /* for _farsetsel, _farnspokeb */
#include <libc/dosio.h> /* for _USE_LFN */
#include <conio.h> /* for cputs */
-#endif
#include "msdos.h"
#include "systime.h"
@@ -81,8 +79,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _dos_ds _go32_info_block.selector_for_linear_memory
#endif
-#if __DJGPP__ > 1
-
#include <signal.h>
#include "syssignal.h"
@@ -104,7 +100,6 @@ int _crt0_startup_flags = (_CRT0_FLAG_UNIX_SBRK | _CRT0_FLAG_FILL_SBRK_MEMORY);
#endif /* GNU_MALLOC */
#endif /* not SYSTEM_MALLOC */
-#endif /* __DJGPP__ > 1 */
static unsigned long
event_timestamp ()
@@ -427,7 +422,6 @@ extern Lisp_Object Qbar, Qhbar;
colors for newly-created frames. */
static int initial_screen_colors[2];
-#if __DJGPP__ > 1
/* Update the screen from a part of relocated DOS/V screen buffer which
begins at OFFSET and includes COUNT characters. */
static void
@@ -444,7 +438,6 @@ dosv_refresh_virtual_screen (int offset, int count)
regs.x.cx = count;
__dpmi_int (0x10, &regs);
}
-#endif
static void
dos_direct_output (y, x, buf, len)
@@ -456,67 +449,12 @@ dos_direct_output (y, x, buf, len)
int t = t0 + (int) ScreenPrimary;
int l0 = len;
-#if (__DJGPP__ < 2)
- while (--len >= 0) {
- dosmemput (buf++, 1, t);
- t += 2;
- }
-#else
/* This is faster. */
for (_farsetsel (_dos_ds); --len >= 0; t += 2, buf++)
_farnspokeb (t, *buf);
if (screen_virtual_segment)
dosv_refresh_virtual_screen (t0, l0);
-#endif
-}
-#endif
-
-/* Flash the screen as a substitute for BEEPs. */
-
-#if (__DJGPP__ < 2)
-static void
-do_visible_bell (xorattr)
- unsigned char xorattr;
-{
- asm volatile
- (" movb $1,%%dl \n\
-visible_bell_0: \n\
- movl _ScreenPrimary,%%eax \n\
- call dosmemsetup \n\
- movl %%eax,%%ebx \n\
- movl %1,%%ecx \n\
- movb %0,%%al \n\
- incl %%ebx \n\
-visible_bell_1: \n\
- xorb %%al,%%gs:(%%ebx) \n\
- addl $2,%%ebx \n\
- decl %%ecx \n\
- jne visible_bell_1 \n\
- decb %%dl \n\
- jne visible_bell_3 \n\
-visible_bell_2: \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- movzwl %%ax,%%eax \n\
- decw %%cx \n\
- jne visible_bell_2 \n\
- jmp visible_bell_0 \n\
-visible_bell_3:"
- : /* no output */
- : "m" (xorattr), "g" (screen_size)
- : "%eax", "%ebx", /* "%gs",*/ "%ecx", "%edx");
-}
-
-static void
-ScreenVisualBell (void)
-{
- /* This creates an xor-mask that will swap the default fore- and
- background colors. */
- do_visible_bell (((FRAME_FOREGROUND_PIXEL (SELECTED_FRAME ())
- ^ FRAME_BACKGROUND_PIXEL (SELECTED_FRAME ()))
- * 0x11) & 0x7f);
}
#endif
@@ -611,9 +549,6 @@ dos_set_window_size (rows, cols)
/* Find one of the dimensions supported by standard EGA/VGA
which gives us at least the required dimensions. */
-
-#if __DJGPP__ > 1
-
else
{
static struct {
@@ -642,41 +577,6 @@ dos_set_window_size (rows, cols)
}
}
-#else /* not __DJGPP__ > 1 */
-
- else if (*rows <= 25)
- {
- if (current_rows != 25 || current_cols != 80)
- {
- regs.x.ax = 3;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 0x1101;
- regs.h.bl = 0;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 0x1200;
- regs.h.bl = 32;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 3;
- int86 (0x10, &regs, &regs);
- }
- }
- else if (*rows <= 50)
- if (have_vga && (current_rows != 50 || current_cols != 80)
- || *rows <= 43 && (current_rows != 43 || current_cols != 80))
- {
- regs.x.ax = 3;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 0x1112;
- regs.h.bl = 0;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 0x1200;
- regs.h.bl = 32;
- int86 (0x10, &regs, &regs);
- regs.x.ax = 0x0100;
- regs.x.cx = 7;
- int86 (0x10, &regs, &regs);
- }
-#endif /* not __DJGPP__ > 1 */
if (have_mouse)
{
@@ -693,7 +593,6 @@ dos_set_window_size (rows, cols)
screen_size_Y = *rows;
screen_size = *cols * *rows;
-#if __DJGPP__ > 1
/* If the dimensions changed, the mouse highlight info is invalid. */
if (current_rows != *rows || current_cols != *cols)
{
@@ -708,7 +607,6 @@ dos_set_window_size (rows, cols)
dpyinfo->mouse_face_window = Qnil;
}
}
-#endif
/* Enable bright background colors. */
bright_bg ();
@@ -747,7 +645,6 @@ mouse_off_maybe ()
static void
msdos_set_cursor_shape (struct frame *f, int start_line, int width)
{
-#if __DJGPP__ > 1
unsigned desired_cursor;
__dpmi_regs regs;
int max_line, top_line, bot_line;
@@ -824,7 +721,6 @@ msdos_set_cursor_shape (struct frame *f, int start_line, int width)
regs.h.ah = 1;
regs.x.cx = desired_cursor;
__dpmi_int (0x10, &regs);
-#endif /* __DJGPP__ > 1 */
}
static void
@@ -2041,7 +1937,6 @@ IT_set_terminal_modes (struct terminal *term)
startup_screen_size_Y = screen_size_Y;
startup_screen_attrib = ScreenAttrib;
-#if __DJGPP__ > 1
/* Is DOS/V (or any other RSIS software which relocates
the screen) installed? */
{
@@ -2072,7 +1967,6 @@ IT_set_terminal_modes (struct terminal *term)
ScreenPrimary = (screen_virtual_segment << 4) + screen_virtual_offset;
}
}
-#endif /* __DJGPP__ > 1 */
ScreenGetCursor (&startup_pos_Y, &startup_pos_X);
ScreenRetrieve (startup_screen_buffer = xmalloc (screen_size * 2));
@@ -4068,195 +3962,6 @@ crlf_to_lf (n, buf)
return np - startp;
}
-#if defined(__DJGPP__) && __DJGPP__ == 2 && __DJGPP_MINOR__ == 0
-
-/* In DJGPP v2.0, library `write' can call `malloc', which might
- cause relocation of the buffer whose address we get in ADDR.
- Here is a version of `write' that avoids calling `malloc',
- to serve us until such time as the library is fixed.
- Actually, what we define here is called `__write', because
- `write' is a stub that just jmp's to `__write' (to be
- POSIXLY-correct with respect to the global name-space). */
-
-#include <io.h> /* for _write */
-#include <libc/dosio.h> /* for __file_handle_modes[] */
-
-static char xbuf[64 * 1024]; /* DOS cannot write more in one chunk */
-
-#define XBUF_END (xbuf + sizeof (xbuf) - 1)
-
-int
-__write (int handle, const void *buffer, size_t count)
-{
- if (count == 0)
- return 0;
-
- if(__file_handle_modes[handle] & O_BINARY)
- return _write (handle, buffer, count);
- else
- {
- char *xbp = xbuf;
- const char *bp = buffer;
- int total_written = 0;
- int nmoved = 0, ncr = 0;
-
- while (count)
- {
- /* The next test makes sure there's space for at least 2 more
- characters in xbuf[], so both CR and LF can be put there. */
- if (xbp < XBUF_END)
- {
- if (*bp == '\n')
- {
- ncr++;
- *xbp++ = '\r';
- }
- *xbp++ = *bp++;
- nmoved++;
- count--;
- }
- if (xbp >= XBUF_END || !count)
- {
- size_t to_write = nmoved + ncr;
- int written = _write (handle, xbuf, to_write);
-
- if (written == -1)
- return -1;
- else
- total_written += nmoved; /* CRs aren't counted in ret value */
-
- /* If some, but not all were written (disk full?), return
- an estimate of the total written bytes not counting CRs. */
- if (written < to_write)
- return total_written - (to_write - written) * nmoved/to_write;
-
- nmoved = 0;
- ncr = 0;
- xbp = xbuf;
- }
- }
- return total_written;
- }
-}
-
-/* A low-level file-renaming function which works around Windows 95 bug.
- This is pulled directly out of DJGPP v2.01 library sources, and only
- used when you compile with DJGPP v2.0. */
-
-#include <io.h>
-
-int _rename(const char *old, const char *new)
-{
- __dpmi_regs r;
- int olen = strlen(old) + 1;
- int i;
- int use_lfn = _USE_LFN;
- char tempfile[FILENAME_MAX];
- const char *orig = old;
- int lfn_fd = -1;
-
- r.x.dx = __tb_offset;
- r.x.di = __tb_offset + olen;
- r.x.ds = r.x.es = __tb_segment;
-
- if (use_lfn)
- {
- /* Windows 95 bug: for some filenames, when you rename
- file -> file~ (as in Emacs, to leave a backup), the
- short 8+3 alias doesn't change, which effectively
- makes OLD and NEW the same file. We must rename
- through a temporary file to work around this. */
-
- char *pbase = 0, *p;
- static char try_char[] = "abcdefghijklmnopqrstuvwxyz012345789";
- int idx = sizeof(try_char) - 1;
-
- /* Generate a temporary name. Can't use `tmpnam', since $TMPDIR
- might point to another drive, which will fail the DOS call. */
- strcpy(tempfile, old);
- for (p = tempfile; *p; p++) /* ensure temporary is on the same drive */
- if (*p == '/' || *p == '\\' || *p == ':')
- pbase = p;
- if (pbase)
- pbase++;
- else
- pbase = tempfile;
- strcpy(pbase, "X$$djren$$.$$temp$$");
-
- do
- {
- if (idx <= 0)
- return -1;
- *pbase = try_char[--idx];
- } while (_chmod(tempfile, 0) != -1);
-
- r.x.ax = 0x7156;
- _put_path2(tempfile, olen);
- _put_path(old);
- __dpmi_int(0x21, &r);
- if (r.x.flags & 1)
- {
- errno = __doserr_to_errno(r.x.ax);
- return -1;
- }
-
- /* Now create a file with the original name. This will
- ensure that NEW will always have a 8+3 alias
- different from that of OLD. (Seems to be required
- when NameNumericTail in the Registry is set to 0.) */
- lfn_fd = _creat(old, 0);
-
- olen = strlen(tempfile) + 1;
- old = tempfile;
- r.x.di = __tb_offset + olen;
- }
-
- for (i=0; i<2; i++)
- {
- if(use_lfn)
- r.x.ax = 0x7156;
- else
- r.h.ah = 0x56;
- _put_path2(new, olen);
- _put_path(old);
- __dpmi_int(0x21, &r);
- if(r.x.flags & 1)
- {
- if (r.x.ax == 5 && i == 0) /* access denied */
- remove(new); /* and try again */
- else
- {
- errno = __doserr_to_errno(r.x.ax);
-
- /* Restore to original name if we renamed it to temporary. */
- if (use_lfn)
- {
- if (lfn_fd != -1)
- {
- _close (lfn_fd);
- remove (orig);
- }
- _put_path2(orig, olen);
- _put_path(tempfile);
- r.x.ax = 0x7156;
- __dpmi_int(0x21, &r);
- }
- return -1;
- }
- }
- else
- break;
- }
-
- /* Success. Delete the file possibly created to work
- around the Windows 95 bug. */
- if (lfn_fd != -1)
- return (_close (lfn_fd) == 0) ? remove (orig) : -1;
- return 0;
-}
-
-#endif /* __DJGPP__ == 2 && __DJGPP_MINOR__ == 0 */
-
DEFUN ("msdos-long-file-names", Fmsdos_long_file_names, Smsdos_long_file_names,
0, 0, 0,
doc: /* Return non-nil if long file names are supported on MS-DOS. */)
@@ -4502,39 +4207,6 @@ init_environment (argc, argv, skip_args)
static int break_stat; /* BREAK check mode status. */
static int stdin_stat; /* stdin IOCTL status. */
-#if __DJGPP__ < 2
-
-/* These must be global. */
-static _go32_dpmi_seginfo ctrl_break_vector;
-static _go32_dpmi_registers ctrl_break_regs;
-static int ctrlbreakinstalled = 0;
-
-/* Interrupt level detection of Ctrl-Break. Don't do anything fancy here! */
-
-void
-ctrl_break_func (regs)
- _go32_dpmi_registers *regs;
-{
- Vquit_flag = Qt;
-}
-
-void
-install_ctrl_break_check ()
-{
- if (!ctrlbreakinstalled)
- {
- /* Don't press Ctrl-Break if you don't have either DPMI or Emacs
- was compiler with Djgpp 1.11 maintenance level 5 or later! */
- ctrlbreakinstalled = 1;
- ctrl_break_vector.pm_offset = (int) ctrl_break_func;
- _go32_dpmi_allocate_real_mode_callback_iret (&ctrl_break_vector,
- &ctrl_break_regs);
- _go32_dpmi_set_real_mode_interrupt_vector (0x1b, &ctrl_break_vector);
- }
-}
-
-#endif /* __DJGPP__ < 2 */
-
/* Turn off Dos' Ctrl-C checking and inhibit interpretation of
control chars by DOS. Determine the keyboard type. */
@@ -4551,9 +4223,6 @@ dos_ttraw (struct tty_display_info *tty)
break_stat = getcbrk ();
setcbrk (0);
-#if __DJGPP__ < 2
- install_ctrl_break_check ();
-#endif
if (first_time)
{
@@ -4585,42 +4254,18 @@ dos_ttraw (struct tty_display_info *tty)
mouse_button_count = outregs.x.bx;
#ifndef HAVE_X_WINDOWS
-#if __DJGPP__ >= 2
/* Save the cursor shape used outside Emacs. */
outside_cursor = _farpeekw (_dos_ds, 0x460);
#endif
-#endif
}
first_time = 0;
-#if __DJGPP__ >= 2
-
stdin_stat = setmode (fileno (stdin), O_BINARY);
return (stdin_stat != -1);
}
else
return (setmode (fileno (stdin), O_BINARY) != -1);
-
-#else /* __DJGPP__ < 2 */
-
- }
-
- /* I think it is wrong to overwrite `stdin_stat' every time
- but the first one this function is called, but I don't
- want to change the way it used to work in v1.x.--EZ */
-
- inregs.x.ax = 0x4400; /* Get IOCTL status. */
- inregs.x.bx = 0x00; /* 0 = stdin. */
- intdos (&inregs, &outregs);
- stdin_stat = outregs.h.dl;
-
- inregs.x.dx = stdin_stat | 0x0020; /* raw mode */
- inregs.x.ax = 0x4401; /* Set IOCTL status */
- intdos (&inregs, &outregs);
- return !outregs.x.cflag;
-
-#endif /* __DJGPP__ < 2 */
}
/* Restore status of standard input and Ctrl-C checking. */
@@ -4633,8 +4278,6 @@ dos_ttcooked ()
setcbrk (break_stat);
mouse_off ();
-#if __DJGPP__ >= 2
-
#ifndef HAVE_X_WINDOWS
/* Restore the cursor shape we found on startup. */
if (outside_cursor)
@@ -4646,16 +4289,6 @@ dos_ttcooked ()
#endif
return (setmode (fileno (stdin), stdin_stat) != -1);
-
-#else /* not __DJGPP__ >= 2 */
-
- inregs.x.ax = 0x4401; /* Set IOCTL status. */
- inregs.x.bx = 0x00; /* 0 = stdin. */
- inregs.x.dx = stdin_stat;
- intdos (&inregs, &outregs);
- return !outregs.x.cflag;
-
-#endif /* not __DJGPP__ >= 2 */
}
@@ -4735,8 +4368,6 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
dup2 (tempout, 1);
dup2 (temperr, 2);
-#if __DJGPP__ > 1
-
if (msshell && !argv[3])
{
/* MS-DOS native shells are too restrictive. For starters, they
@@ -4777,10 +4408,7 @@ run_msdos_command (argv, working_dir, tempin, tempout, temperr, envv)
result = 0; /* emulate Unixy shell behavior with empty cmd line */
}
else
-
-#endif /* __DJGPP__ > 1 */
-
- result = spawnve (P_WAIT, argv[0], argv, envv);
+ result = spawnve (P_WAIT, argv[0], argv, envv);
dup2 (inbak, 0);
dup2 (outbak, 1);
@@ -4822,88 +4450,13 @@ croak (badfunc)
exit (1);
}
-#if __DJGPP__ < 2
-
-/* ------------------------- Compatibility functions -------------------
- * gethostname
- * gettimeofday
- */
-
-/* Hostnames for a pc are not really funny,
- but they are used in change log so we emulate the best we can. */
-
-gethostname (p, size)
- char *p;
- int size;
-{
- char *q = egetenv ("HOSTNAME");
-
- if (!q) q = "pc";
- strcpy (p, q);
- return 0;
-}
-
-/* When time zones are set from Ms-Dos too many C-libraries are playing
- tricks with time values. We solve this by defining our own version
- of `gettimeofday' bypassing GO32. Our version needs to be initialized
- once and after each call to `tzset' with TZ changed. That is
- accomplished by aliasing tzset to init_gettimeofday. */
-
-static struct tm time_rec;
-
-int
-gettimeofday (struct timeval *tp, struct timezone *tzp)
-{
- if (tp)
- {
- struct time t;
- struct tm tm;
-
- gettime (&t);
- if (t.ti_hour < time_rec.tm_hour) /* midnight wrap */
- {
- struct date d;
- getdate (&d);
- time_rec.tm_year = d.da_year - 1900;
- time_rec.tm_mon = d.da_mon - 1;
- time_rec.tm_mday = d.da_day;
- }
-
- time_rec.tm_hour = t.ti_hour;
- time_rec.tm_min = t.ti_min;
- time_rec.tm_sec = t.ti_sec;
-
- tm = time_rec;
- tm.tm_gmtoff = dos_timezone_offset;
-
- tp->tv_sec = mktime (&tm); /* may modify tm */
- tp->tv_usec = t.ti_hund * (1000000 / 100);
- }
- /* Ignore tzp; it's obsolescent. */
- return 0;
-}
-
-#endif /* __DJGPP__ < 2 */
-
/*
- * A list of unimplemented functions that we silently ignore.
+ * A few unimplemented functions that we silently ignore.
*/
-
-#if __DJGPP__ < 2
-unsigned alarm (s) unsigned s; {}
-fork () { return 0; }
-int kill (x, y) int x, y; { return -1; }
-nice (p) int p; {}
-void volatile pause () {}
-sigsetmask (x) int x; { return 0; }
-sigblock (mask) int mask; { return 0; }
-#endif
-
setpgrp () {return 0; }
setpriority (x,y,z) int x,y,z; { return 0; }
-
-#if __DJGPP__ > 1
-#if __DJGPP_MINOR__ < 2
+
+#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
#ifdef POSIX_SIGNALS
@@ -5011,7 +4564,6 @@ sigblock (mask) int mask; { return 0; }
#endif /* not POSIX_SIGNALS */
#endif /* not __DJGPP_MINOR__ < 2 */
-#endif /* __DJGPP__ > 1 */
#ifndef HAVE_SELECT
#include "sysselect.h"
@@ -5194,7 +4746,6 @@ abort ()
dos_ttcooked ();
ScreenSetCursor (10, 0);
cputs ("\r\n\nEmacs aborted!\r\n");
-#if __DJGPP__ > 1
#if __DJGPP__ == 2 && __DJGPP_MINOR__ < 2
if (screen_virtual_segment)
dosv_refresh_virtual_screen (2 * 10 * screen_size_X, 4 * screen_size_X);
@@ -5204,7 +4755,6 @@ abort ()
#else /* __DJGPP_MINOR__ >= 2 */
raise (SIGABRT);
#endif /* __DJGPP_MINOR__ >= 2 */
-#endif
exit (2);
}
#endif
diff --git a/src/process.c b/src/process.c
index 43fa78c7bd4..3c539024b0a 100644
--- a/src/process.c
+++ b/src/process.c
@@ -195,10 +195,6 @@ extern int serial_open (char *port);
extern void serial_configure (struct Lisp_Process *p, Lisp_Object contact);
#endif
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
#ifndef HAVE_H_ERRNO
extern int h_errno;
#endif
diff --git a/src/s/msdos.h b/src/s/msdos.h
index 88771b9f15f..55f546589ec 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/>. */
#define MSDOS
#endif
-#ifdef __GO32__
#ifndef __DJGPP__
-#define __DJGPP__ 1 /* V2 defines __DJGPP__ == 2 */
-#endif
-#else
You lose; /* Emacs for DOS must be compiled with DJGPP */
#endif
@@ -97,34 +93,11 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define _setjmp setjmp
#define _longjmp longjmp
-#if __DJGPP__ < 2
-
-/* New chdir () routine.
- DJGPP v2.0 and later doesn't need it because its chdir() does
- set the drive itself. */
-#ifdef chdir
-#undef chdir
-#endif
-#define chdir sys_chdir
-
-#define LIBS_SYSTEM -lpc /* isn't required in DJGPP v2.0, either */
-
-#endif /* __DJGPP__ < 2 */
-
-#if __DJGPP__ > 1
-
#define DATA_START (&etext + 1)
#define TEXT_START &start
#define _NAIVE_DOS_REGS
-#else /* not __DJGPP__ > 1 */
-
-/* This somehow needs to be defined even though we use COFF. */
-#define TEXT_START -1
-
-#endif /* not __DJGPP__ > 1 */
-
#define ORDINARY_LINK
/* command.com does not understand `...` so we define this. */
@@ -133,19 +106,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define NULL_DEVICE "nul"
-#if __DJGPP__ < 2
-#define O_RDONLY 0x0001
-#define O_WRONLY 0x0002
-#define O_RDWR 0x0004
-#define O_CREAT 0x0100
-#define O_TRUNC 0x0200
-#define O_EXCL 0x0400
-#define O_APPEND 0x0800
-#define O_TEXT 0x4000
-#define O_BINARY 0x8000
-#define NO_MATHERR
-#endif
-
#define HAVE_INVERSE_HYPERBOLIC
#define FLOAT_CHECK_DOMAIN
@@ -166,12 +126,6 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define IS_DIRECTORY_SEP(_c_) ((_c_) == '/' || (_c_) == '\\')
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
-/* Call init_gettimeofday when TZ changes. */
-#if __DJGPP__ < 2
-#define LOCALTIME_CACHE
-#define tzset init_gettimeofday
-#endif
-
/* bcopy under djgpp is quite safe */
#define GAP_USE_BCOPY
#define BCOPY_UPWARD_SAFE 1
@@ -181,9 +135,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
#define MODE_LINE_BINARY_TEXT(buf) (NILP(buf->buffer_file_type) ? "T" : "B")
/* Do we have POSIX signals? */
-#if __DJGPP__ > 1
#define POSIX_SIGNALS
-#endif
/* We have (the code to control) a mouse. */
#define HAVE_MOUSE
@@ -197,7 +149,7 @@ You lose; /* Emacs for DOS must be compiled with DJGPP */
commentary below, in the non-X branch. The 140KB number was
measured on GNU/Linux and on MS-WIndows. */
#define SYSTEM_PURESIZE_EXTRA (-170000+140000)
-#define LIBX11_SYSTEM -lxext -lsys
+#define LIBS_SYSTEM -lxext -lsys
#else
/* We need a little extra space, see ../../lisp/loadup.el.
As of 20091024, DOS-specific files use up 62KB of pure space. But
diff --git a/src/s/netbsd.h b/src/s/netbsd.h
index 5552aece50a..682b9482352 100644
--- a/src/s/netbsd.h
+++ b/src/s/netbsd.h
@@ -28,8 +28,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define LIBS_TERMCAP -ltermcap
-#define NEED_ERRNO
-
#define START_FILES pre-crt0.o /usr/lib/crt0.o START_FILES_1 /usr/lib/crtbegin.o
#define LIB_STANDARD -lgcc -lc -lgcc /usr/lib/crtend.o END_FILES_1
#undef LIB_GCC
diff --git a/src/sysdep.c b/src/sysdep.c
index e23f52d92e5..37e7dfbaf9c 100644
--- a/src/sysdep.c
+++ b/src/sysdep.c
@@ -90,17 +90,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include "msdos.h"
#include <sys/param.h>
-#if __DJGPP__ > 1
extern int etext;
extern unsigned start __asm__ ("start");
#endif
-#endif
-
-#ifndef USE_CRT_DLL
-#ifndef errno
-extern int errno;
-#endif
-#endif
#include <sys/file.h>
@@ -462,13 +454,7 @@ wait_for_termination (pid)
#endif /* not POSIX_SIGNALS */
#endif /* not BSD_SYSTEM, and not HPUX version >= 6 */
#else /* not subprocesses */
-#if __DJGPP__ > 1
break;
-#else /* not __DJGPP__ > 1 */
- if (kill (pid, 0) < 0)
- break;
- wait (0);
-#endif /* not __DJGPP__ > 1*/
#endif /* not subprocesses */
}
}
@@ -672,10 +658,8 @@ sys_subshell ()
#ifdef DOS_NT
pid = 0;
-#if __DJGPP__ > 1
save_signal_handlers (saved_handlers);
synch_process_alive = 1;
-#endif /* __DJGPP__ > 1 */
#else
pid = vfork ();
if (pid == -1)
@@ -747,7 +731,7 @@ sys_subshell ()
}
/* Do this now if we did not do it before. */
-#if !defined (MSDOS) || __DJGPP__ == 1
+#ifndef MSDOS
save_signal_handlers (saved_handlers);
synch_process_alive = 1;
#endif
diff --git a/src/unexaix.c b/src/unexaix.c
index 97b69d7e5c7..2657d144296 100644
--- a/src/unexaix.c
+++ b/src/unexaix.c
@@ -435,7 +435,6 @@ write_segment (int new, char *ptr, char *end)
{
int i, nwrite, ret;
char buf[80];
- extern int errno;
char zeros[UnexBlockSz];
for (i = 0; ptr < end;)
diff --git a/src/unexec.c b/src/unexec.c
index a1bb5460d3c..1a27db1232d 100644
--- a/src/unexec.c
+++ b/src/unexec.c
@@ -131,11 +131,9 @@ initialize nonstandard fields in the file header
#ifdef HAVE_COFF_H
#include <coff.h>
#ifdef MSDOS
-#if __DJGPP__ > 1
#include <fcntl.h> /* for O_RDONLY, O_RDWR */
#include <crt0.h> /* for _crt0_startup_flags and its bits */
static int save_djgpp_startup_flags;
-#endif /* __DJGPP__ > 1 */
#define filehdr external_filehdr
#define scnhdr external_scnhdr
#define syment external_syment
@@ -310,7 +308,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
if (a_out >= 0)
{
#ifdef MSDOS
-#if __DJGPP__ > 1
/* Support the coff-go32-exe format with a prepended stub, since
this is what GCC 2.8.0 and later generates by default in DJGPP. */
unsigned short mz_header[3];
@@ -328,7 +325,6 @@ make_hdr (new, a_out, data_start, bss_start, entry_address, a_name, new_name)
}
else
lseek (a_out, 0L, 0);
-#endif /* __DJGPP__ > 1 */
#endif /* MSDOS */
if (read (a_out, &f_hdr, sizeof (f_hdr)) != sizeof (f_hdr))
{
@@ -470,9 +466,6 @@ write_segment (new, ptr, end)
{
register int i, nwrite, ret;
char buf[80];
-#ifndef USE_CRT_DLL
- extern int errno;
-#endif
/* This is the normal amount to write at once.
It is the size of block that NFS uses. */
int writesize = 1 << 13;
@@ -532,7 +525,6 @@ copy_text_and_data (new, a_out)
register char *ptr;
#ifdef MSDOS
-#if __DJGPP__ >= 2
/* Dump the original table of exception handlers, not the one
where our exception hooks are registered. */
__djgpp_exception_toggle ();
@@ -542,7 +534,6 @@ copy_text_and_data (new, a_out)
save_djgpp_startup_flags = _crt0_startup_flags;
_crt0_startup_flags &= ~(_CRT0_FLAG_NO_LFN | _CRT0_FLAG_NEARPTR);
#endif
-#endif
lseek (new, (long) text_scnptr, 0);
ptr = (char *) f_ohdr.text_start;
@@ -555,14 +546,12 @@ copy_text_and_data (new, a_out)
write_segment (new, ptr, end);
#ifdef MSDOS
-#if __DJGPP__ >= 2
/* Restore our exception hooks. */
__djgpp_exception_toggle ();
/* Restore the startup flags. */
_crt0_startup_flags = save_djgpp_startup_flags;
#endif
-#endif
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/>. */
menus, and the Windows clipboard. */
/* Written by Dale P. Smith <dpsm@en.com> */
-/* Adapted to DJGPP v1 by Eli Zaretskii <eliz@is.elta.co.il> */
+/* Adapted to DJGPP by Eli Zaretskii <eliz@gnu.org> */
#ifdef MSDOS
@@ -94,25 +94,6 @@ static unsigned char *last_clipboard_text;
/* The size of allocated storage for storing the clipboard data. */
static size_t clipboard_storage_size;
-/* Emulation of `__dpmi_int' and friends for DJGPP v1.x */
-
-#if __DJGPP__ < 2
-
-typedef _go32_dpmi_registers __dpmi_regs;
-#define __tb _go32_info_block.linear_address_of_transfer_buffer
-#define _dos_ds _go32_info_block.selector_for_linear_memory
-
-static int
-__dpmi_int (intno, regs)
- int intno;
- __dpmi_regs *regs;
-{
- regs->x.ss = regs->x.sp = regs->x.flags = 0;
- return _go32_dpmi_simulate_int (intno, regs);
-}
-
-#endif /* __DJGPP__ < 2 */
-
/* C functions to access the Windows 3.1x clipboard from DOS apps.
The information was obtained from the Microsoft Knowledge Base,
diff --git a/src/w32term.c b/src/w32term.c
index 4ed7beda233..7222e26efd2 100644
--- a/src/w32term.c
+++ b/src/w32term.c
@@ -228,10 +228,6 @@ static int input_signal_count;
extern Lisp_Object Vcommand_line_args, Vsystem_name;
-#ifndef USE_CRT_DLL
-extern int errno;
-#endif
-
/* A mask of extra modifier bits to put into every keyboard char. */
extern EMACS_INT extra_keyboard_modifiers;
diff --git a/src/xdisp.c b/src/xdisp.c
index 709ff5f6d68..997c76934d4 100644
--- a/src/xdisp.c
+++ b/src/xdisp.c
@@ -12606,7 +12606,8 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
}
if (INTEGERP (glyph->object) && glyph->charpos < 0)
--glyph;
- /* By default, put the cursor on the rightmost glyph. */
+ /* By default, in reversed rows we put the cursor on the
+ rightmost (first in the reading order) glyph. */
for (g = end + 1; g < glyph; g++)
x += g->pixel_width;
cursor_x = x;
@@ -12683,7 +12684,16 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
bpos_covered = bpos_max + XINT (chprop);
/* If the `cursor' property covers buffer positions up
to and including point, we should display cursor on
- this glyph. */
+ this glyph. Note that overlays and text properties
+ with string values stop bidi reordering, so every
+ buffer position to the left of the string is always
+ smaller than any position to the right of the
+ string. Therefore, if a `cursor' property on one
+ of the string's characters has an integer value, we
+ will break out of the loop below _before_ we get to
+ the position match above. IOW, integer values of
+ the `cursor' property override the "exact match for
+ point" strategy of positioning the cursor. */
/* Implementation note: bpos_max == pt_old when, e.g.,
we are in an empty line, where bpos_max is set to
MATRIX_ROW_START_CHARPOS, see above. */
@@ -12823,12 +12833,19 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
str = glyph->object;
tem = string_buffer_position_lim (w, str, pos, pos_after, 0);
- if (pos <= tem)
+ if (tem == 0 /* from overlay */
+ || pos <= tem)
{
/* If the string from which this glyph came is
found in the buffer at point, then we've
- found the glyph we've been looking for. */
- if (tem == pt_old)
+ found the glyph we've been looking for. If
+ it comes from an overlay (tem == 0), and it
+ has the `cursor' property on one of its
+ glyphs, record that glyph as a candidate for
+ displaying the cursor. (As in the
+ unidirectional version, we will display the
+ cursor on the last candidate we find.) */
+ if (tem == 0 || tem == pt_old)
{
/* The glyphs from this string could have
been reordered. Find the one with the
@@ -12861,9 +12878,11 @@ set_cursor_from_row (w, row, matrix, delta, delta_bytes, dy, dvpos)
}
}
- goto compute_x;
+ if (tem == pt_old)
+ goto compute_x;
}
- pos = tem + 1; /* don't find previous instances */
+ if (tem)
+ pos = tem + 1; /* don't find previous instances */
}
/* This string is not what we want; skip all of the
glyphs that came from it. */
diff --git a/src/xrdb.c b/src/xrdb.c
index c8cb55cb7b8..7808bacc59f 100644
--- a/src/xrdb.c
+++ b/src/xrdb.c
@@ -28,6 +28,7 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#include <unistd.h>
#endif
+#include <errno.h>
#include <epaths.h>
#include <stdio.h>
@@ -734,8 +735,6 @@ fatal (msg, prog, x1, x2, x3, x4, x5)
char *msg, *prog;
int x1, x2, x3, x4, x5;
{
- extern int errno;
-
if (errno)
perror (prog);
diff --git a/src/xterm.c b/src/xterm.c
index 1114fcccc53..90db15d9ed4 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -309,8 +309,6 @@ extern Lisp_Object Vx_no_window_manager;
extern Lisp_Object Qeql;
-extern int errno;
-
/* A mask of extra modifier bits to put into every keyboard char. */
extern EMACS_INT extra_keyboard_modifiers;