# HG changeset patch # User Geoff Voelker # Date 873249280 0 # Node ID 524abb12cbf578a8470ab579c295d031f09617f7 # Parent 639881f2750df195b2ff1b66aff90e4c2da019ca (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. diff -r 639881f2750d -r 524abb12cbf5 src/s/ms-w32.h --- a/src/s/ms-w32.h Wed Sep 03 01:14:17 1997 +0000 +++ b/src/s/ms-w32.h Wed Sep 03 01:14:40 1997 +0000 @@ -85,7 +85,7 @@ 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 @@ #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 @@ /* 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 -#include -#include -#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 @@ #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 @@ #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 +#include +#include +#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 @@ /* 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 + + /* ============================================================ */