aboutsummaryrefslogtreecommitdiffstats
path: root/src/msdos.c
diff options
context:
space:
mode:
authorEli Zaretskii2016-04-30 13:45:33 +0300
committerEli Zaretskii2016-04-30 13:45:33 +0300
commitccdaf04cfdaa42fb85d456274405cce32ee9f5d4 (patch)
tree631c59e4dad1db81cca00edeaa721ae8c0e522e5 /src/msdos.c
parentffe701cb07cfb3584c4e4894976f0c9487d02c59 (diff)
downloademacs-ccdaf04cfdaa42fb85d456274405cce32ee9f5d4.tar.gz
emacs-ccdaf04cfdaa42fb85d456274405cce32ee9f5d4.zip
Fix the MSDOS build
* config.bat: * msdos/sedlisp.inp: * msdos/sedlibmk.inp: * msdos/sedleim.inp: * msdos/sedadmin.inp: * msdos/sed6.inp: * msdos/sed3v2.inp: * msdos/sed2v2.inp: * msdos/sed1v2.inp: Adapt to Emacs 25. * src/process.c (remove_slash_colon): Move out of "#ifdef subprocesses" block, as it its called unconditionally. Move ADD_SUBFEATURE calls into "#ifdef subprocesses" block, as they reference variables only defined in that block. * src/msdos.h: Provide prototypes for IT_set_frame_parameters, faccessat, msdos_fatal_signal, syms_of_msdos, pthread_sigmask, dos_keysns, dos_keyread, run_msdos_command, and syms_of_win16select, to avoid compiler warnings. * src/msdos.c (SYS_ENVIRON): Define to either '_environ' or 'environ', depending on the DJGPP version. Remove declarations of externally-visible Lisp objects, like Qbackground_color and Qreverse. (run_msdos_command): First argument is not signed, not unsigned. Use SYS_ENVIRON. (sys_select): Use 'timespec_cmp' instead of 'timespec_sign', as the latter doesn't work when 'time_t' is an unsigned data type. This caused idle timers to behave incorrectly: they only fired after a keyboard input event. * src/frame.c (adjust_frame_size) [MSDOS]: Account for FRAME_TOP_MARGIN that isn't counted in the frame's number of lines, but dos_set_window_size needs it to be added. * src/lread.c (INFINITY, NAN) [DJGPP < 2.05]: Provide definitions. * src/fns.c (sort_vector_copy) [__GNUC__ < 4]: Provide a prototype that works around compilation errors with older GCC versions. * src/w16select.c: Don't declare QCLIPBOARD and QPRIMARY as Lisp Objects. * src/filelock.c [MSDOS]: Ifdef away most of the code. Provide no-op implementations for 'lock_file' and 'unlock_file'. (Ffile_locked_p) [MSDOS]: Always return nil. This avoids multiple ifdefs in all users of filelock.c functionality. * src/conf_post.h (EOVERFLOW, SIZE_MAX) [DJGPP < 2.04]: Define. * src/emacs.c [MSDOS]: Include dosfns.h, to avoid compiler warnings. * src/dosfns.h: Provide prototypes for dos_cleanup, syms_of_dosfns, and init_dosfns. * src/deps.mk (atimer.o): Depend on msdos.h. (emacs.o): Depend on dosfns.h. * src/atimer.c [MSDOS]: Include msdos.h, to avoid compiler warnings. * lisp/window.el (window--adjust-process-windows): Skip the body if 'process-list' is not available. This avoids failure to start up on MS-DOS. * lisp/vc/diff.el (diff-no-select): Test 'make-process', not 'start-process', as the latter is now available on all platforms. * lisp/textmodes/ispell.el (ispell-async-processp): Replace 'start-process' with 'make-process' in a comment. * lisp/term/internal.el (IT-unicode-translations): Modify and add a few translations to display Info files with Unicode markup. Fix an ancient off-by-one mismatch error with Unicode codepoints. * lisp/progmodes/compile.el (compilation-start): Test 'make-process', not 'start-process', as the latter is now available on all platforms. * lisp/man.el (Man-build-man-command, Man-getpage-in-background): Test 'make-process', not 'start-process', as the latter is now available on all platforms. * lisp/international/mule-cmds.el (set-coding-system-map): Test 'make-process', not 'start-process', as the latter is now available on all platforms. * lisp/eshell/esh-cmd.el (eshell-do-pipelines-synchronously): Doc fix. (eshell-execute-pipeline): Test 'make-process', not 'start-process', as the latter is now available on all platforms.
Diffstat (limited to 'src/msdos.c')
-rw-r--r--src/msdos.c36
1 files changed, 19 insertions, 17 deletions
diff --git a/src/msdos.c b/src/msdos.c
index 84e8c39ec0c..62411ea2f6d 100644
--- a/src/msdos.c
+++ b/src/msdos.c
@@ -59,6 +59,12 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
59#include <libc/dosio.h> /* for _USE_LFN */ 59#include <libc/dosio.h> /* for _USE_LFN */
60#include <conio.h> /* for cputs */ 60#include <conio.h> /* for cputs */
61 61
62#if (__DJGPP__ + (__DJGPP_MINOR__ > 3)) >= 3
63#define SYS_ENVIRON _environ
64#else
65#define SYS_ENVIRON environ
66#endif
67
62#include "msdos.h" 68#include "msdos.h"
63#include "systime.h" 69#include "systime.h"
64#include "frame.h" 70#include "frame.h"
@@ -422,8 +428,6 @@ static unsigned long screen_old_address = 0;
422/* Segment and offset of the virtual screen. If 0, DOS/V is NOT loaded. */ 428/* Segment and offset of the virtual screen. If 0, DOS/V is NOT loaded. */
423static unsigned short screen_virtual_segment = 0; 429static unsigned short screen_virtual_segment = 0;
424static unsigned short screen_virtual_offset = 0; 430static unsigned short screen_virtual_offset = 0;
425extern Lisp_Object Qcursor_type;
426extern Lisp_Object Qbar, Qhbar;
427 431
428/* The screen colors of the current frame, which serve as the default 432/* The screen colors of the current frame, which serve as the default
429 colors for newly-created frames. */ 433 colors for newly-created frames. */
@@ -1384,11 +1388,6 @@ IT_delete_glyphs (struct frame *f, int n)
1384 1388
1385/* This was copied from xfaces.c */ 1389/* This was copied from xfaces.c */
1386 1390
1387extern Lisp_Object Qbackground_color;
1388extern Lisp_Object Qforeground_color;
1389Lisp_Object Qreverse;
1390extern Lisp_Object Qtitle;
1391
1392/* IT_set_terminal_modes is called when emacs is started, 1391/* IT_set_terminal_modes is called when emacs is started,
1393 resumed, and whenever the screen is redrawn! */ 1392 resumed, and whenever the screen is redrawn! */
1394 1393
@@ -3710,7 +3709,7 @@ dos_ttcooked (void)
3710 file TEMPOUT and stderr to TEMPERR. */ 3709 file TEMPOUT and stderr to TEMPERR. */
3711 3710
3712int 3711int
3713run_msdos_command (unsigned char **argv, const char *working_dir, 3712run_msdos_command (char **argv, const char *working_dir,
3714 int tempin, int tempout, int temperr, char **envv) 3713 int tempin, int tempout, int temperr, char **envv)
3715{ 3714{
3716 char *saveargv1, *saveargv2, *lowcase_argv0, *pa, *pl; 3715 char *saveargv1, *saveargv2, *lowcase_argv0, *pa, *pl;
@@ -3796,8 +3795,8 @@ run_msdos_command (unsigned char **argv, const char *working_dir,
3796 ; 3795 ;
3797 if (*cmnd) 3796 if (*cmnd)
3798 { 3797 {
3799 extern char **environ; 3798 extern char **SYS_ENVIRON;
3800 char **save_env = environ; 3799 char **save_env = SYS_ENVIRON;
3801 int save_system_flags = __system_flags; 3800 int save_system_flags = __system_flags;
3802 3801
3803 /* Request the most powerful version of `system'. We need 3802 /* Request the most powerful version of `system'. We need
@@ -3809,16 +3808,16 @@ run_msdos_command (unsigned char **argv, const char *working_dir,
3809 | __system_handle_null_commands 3808 | __system_handle_null_commands
3810 | __system_emulate_chdir); 3809 | __system_emulate_chdir);
3811 3810
3812 environ = envv; 3811 SYS_ENVIRON = envv;
3813 result = system (cmnd); 3812 result = system (cmnd);
3814 __system_flags = save_system_flags; 3813 __system_flags = save_system_flags;
3815 environ = save_env; 3814 SYS_ENVIRON = save_env;
3816 } 3815 }
3817 else 3816 else
3818 result = 0; /* emulate Unixy shell behavior with empty cmd line */ 3817 result = 0; /* emulate Unixy shell behavior with empty cmd line */
3819 } 3818 }
3820 else 3819 else
3821 result = spawnve (P_WAIT, argv[0], (char **)argv, envv); 3820 result = spawnve (P_WAIT, argv[0], argv, envv);
3822 3821
3823 dup2 (inbak, 0); 3822 dup2 (inbak, 0);
3824 dup2 (outbak, 1); 3823 dup2 (outbak, 1);
@@ -4085,11 +4084,14 @@ sys_select (int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds,
4085 gettime (&t); 4084 gettime (&t);
4086 clnow = make_timespec (t.tv_sec, t.tv_nsec); 4085 clnow = make_timespec (t.tv_sec, t.tv_nsec);
4087 cldiff = timespec_sub (clnow, cllast); 4086 cldiff = timespec_sub (clnow, cllast);
4087 /* Stop when timeout value is about to cross zero. */
4088 if (timespec_cmp (*timeout, cldiff) <= 0)
4089 {
4090 timeout->tv_sec = 0;
4091 timeout->tv_nsec = 0;
4092 return 0;
4093 }
4088 *timeout = timespec_sub (*timeout, cldiff); 4094 *timeout = timespec_sub (*timeout, cldiff);
4089
4090 /* Stop when timeout value crosses zero. */
4091 if (timespec_sign (*timeout) <= 0)
4092 return 0;
4093 cllast = clnow; 4095 cllast = clnow;
4094 dos_yield_time_slice (); 4096 dos_yield_time_slice ();
4095 } 4097 }