summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeoff Voelker <voelker@cs.washington.edu>1997-09-03 01:14:40 +0000
committerGeoff Voelker <voelker@cs.washington.edu>1997-09-03 01:14:40 +0000
commit0923e7e6294362dadfc6ee377ff622986eef42c7 (patch)
tree7dfed1c35d5ed2ad4bb9cb0b58911cf957e81c56
parentbb7a479d5494093ec952ad3aba2d39a2e1d00455 (diff)
downloademacs-0923e7e6294362dadfc6ee377ff622986eef42c7.tar.gz
(INTERRUPT_INPUT): Don't define.
(bcopy): Use memmove instead of memcpy. (GAP_USE_BCOPY, BCOPY_UPWARD_SAFE, BCOPY_DOWNWARD_SAFE): Define. Undef system calls before redefining. Emulated calls redefined to sys_*, real calls redefined to _*. (DebPrint): Macro defined. Use pragmas to place Emacs initialized data in EMDATA segment, and Emacs uninitialized data in EMBSS segment.
-rw-r--r--src/s/ms-w32.h81
1 files changed, 65 insertions, 16 deletions
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index faa19d8e104..8d02140b13c 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -85,7 +85,7 @@ Boston, MA 02111-1307, USA. */
to read the input and send it to the true Emacs process
through a pipe. */
-#define INTERRUPT_INPUT
+/* #define INTERRUPT_INPUT */
/* Letter to use in finding device name of first pty,
if system supports pty's. 'a' means it is /dev/ptya0 */
@@ -140,9 +140,14 @@ Boston, MA 02111-1307, USA. */
#define BSTRING
#define bzero(b, l) memset(b, 0, l)
-#define bcopy(s, d, l) memcpy(d, s, l)
+#define bcopy(s, d, l) memmove(d, s, l)
#define bcmp(a, b, l) memcmp(a, b, l)
+/* bcopy (aka memmove aka memcpy at least on x86) under MSVC is quite safe */
+#define GAP_USE_BCOPY
+#define BCOPY_UPWARD_SAFE 1
+#define BCOPY_DOWNWARD_SAFE 1
+
/* subprocesses should be defined if you want to
have code for asynchronous subprocesses
(as used in M-x compile and M-x shell).
@@ -293,42 +298,40 @@ Boston, MA 02111-1307, USA. */
/* get some redefinitions in place */
/* IO calls that are emulated or shadowed */
+#undef access
#define access sys_access
+#undef chdir
#define chdir sys_chdir
+#undef chmod
#define chmod sys_chmod
+#undef close
#define close sys_close
+#undef creat
#define creat sys_creat
#define ctime sys_ctime
+#undef dup
#define dup sys_dup
+#undef dup2
#define dup2 sys_dup2
#define fopen sys_fopen
#define link sys_link
#define mkdir sys_mkdir
+#undef mktemp
#define mktemp sys_mktemp
+#undef open
#define open sys_open
#define pipe sys_pipe
+#undef read
#define read sys_read
#define rename sys_rename
#define rmdir sys_rmdir
#define select sys_select
#define sleep sys_sleep
+#undef unlink
#define unlink sys_unlink
+#undef write
#define write sys_write
-/* this is hacky, but is necessary to avoid warnings about macro
- redefinitions using the SDK compilers */
-#ifndef __STDC__
-#define __STDC__ 1
-#define MUST_UNDEF__STDC__
-#endif
-#include <direct.h>
-#include <io.h>
-#include <stdio.h>
-#ifdef MUST_UNDEF__STDC__
-#undef __STDC__
-#undef MUST_UNDEF__STDC__
-#endif
-
/* subprocess calls that are emulated */
#define spawnve sys_spawnve
#define wait sys_wait
@@ -344,6 +347,7 @@ Boston, MA 02111-1307, USA. */
#define fileno _fileno
#define flushall _flushall
#define fputchar _fputchar
+#define getcwd _getcwd
#define getw _getw
#define getpid _getpid
#define isatty _isatty
@@ -362,6 +366,20 @@ Boston, MA 02111-1307, USA. */
#define abort w32_abort
#endif
+/* this is hacky, but is necessary to avoid warnings about macro
+ redefinitions using the SDK compilers */
+#ifndef __STDC__
+#define __STDC__ 1
+#define MUST_UNDEF__STDC__
+#endif
+#include <direct.h>
+#include <io.h>
+#include <stdio.h>
+#ifdef MUST_UNDEF__STDC__
+#undef __STDC__
+#undef MUST_UNDEF__STDC__
+#endif
+
/* Defines that we need that aren't in the standard signal.h */
#define SIGHUP 1 /* Hang up */
#define SIGQUIT 3 /* Quit process */
@@ -411,4 +429,35 @@ Boston, MA 02111-1307, USA. */
/* We need a little extra space, see ../../lisp/loadup.el */
#define SYSTEM_PURESIZE_EXTRA 25000
+/* For unexec to work on Alpha systems, we need to put Emacs'
+ initialized data into a separate section from the CRT initialized
+ data (because the Alpha linker freely reorders data variables, even
+ across libraries, so our data and the CRT data get intermingled).
+
+ Starting with MSVC 5.0, we must also place the uninitialized data
+ into its own section. VC5 intermingles uninitialized data from the CRT
+ between Emacs' static uninitialized data and its public uninitialized
+ data. A separate .bss section for Emacs groups both static and
+ public uninitalized together.
+
+ Note that unexnt.c relies on this fact, and must be modified
+ accordingly if this section name is changed, or if this pragma is
+ removed. Also, obviously, all files that define initialized data
+ must include config.h to pick up this pragma. */
+
+/* Names must be < 8 bytes */
+#pragma data_seg("EMDATA")
+#pragma bss_seg("EMBSS")
+
+/* #define FULL_DEBUG */
+/* #define EMACSDEBUG */
+
+#ifdef EMACSDEBUG
+extern void _DebPrint (const char *fmt, ...);
+#define DebPrint(stuff) _DebPrint stuff
+#else
+#define DebPrint(stuff)
+#endif
+
+
/* ============================================================ */