X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/4fc35edd5fcdfe258c04cfed707753fdd8795a72..69e03ddccf47fc29126317dd3317313ecd92b797:/nt/inc/ms-w32.h diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index adac2e3b4a..9de3b12a80 100644 --- a/nt/inc/ms-w32.h +++ b/nt/inc/ms-w32.h @@ -1,6 +1,6 @@ /* System description file for Windows NT. -Copyright (C) 1993-1995, 2001-2015 Free Software Foundation, Inc. +Copyright (C) 1993-1995, 2001-2016 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -58,10 +58,6 @@ along with GNU Emacs. If not, see . */ Look in for a timeval structure. */ #define HAVE_TIMEVAL 1 -/* But our select implementation doesn't allow us to make non-blocking - connects. So until that is fixed, this is necessary: */ -#define BROKEN_NON_BLOCKING_CONNECT 1 - /* And the select implementation does 1-byte read-ahead waiting for received packets, so datagrams are broken too. */ #define BROKEN_DATAGRAM_SOCKETS 1 @@ -189,7 +185,28 @@ extern struct tm * sys_localtime (const time_t *); supply the 2nd arg correctly, so don't use _setjmp directly in that case. */ #undef HAVE__SETJMP + +/* Unlike MS and mingw.org, MinGW64 doesn't define gai_strerror as an + inline function in a system header file, and instead seems to + require to link against ws2_32.a. But we don't want to link with + -lws2_32, as that would make Emacs dependent on the respective DLL. + So MinGW64 is amply punished here by the following: */ +#undef HAVE_GAI_STRERROR +#endif + +/* The following is needed for recovery from C stack overflows. */ +#include +typedef jmp_buf sigjmp_buf; +#ifdef MINGW_W64 +/* Evidently, MinGW64's longjmp crashes when invoked from an exception + handler, see https://sourceforge.net/p/mingw-w64/mailman/message/32421953/. + This seems to be an unsolved problem in the MinGW64 runtime. So we + use the GCC intrinsics instead. FIXME. */ +#define sigsetjmp(j,m) __builtin_setjmp(j) +#else +#define sigsetjmp(j,m) setjmp(j) #endif +extern void w32_reset_stack_overflow_guard (void); #ifdef _MSC_VER #include @@ -310,18 +327,6 @@ int _getpid (void); #include #define tzname _tzname -/* 'struct timespec' is used by time-related functions in lib/ and - elsewhere, but we don't use lib/time.h where the structure is - defined. */ -/* MinGW64 defines 'struct timespec' and _TIMESPEC_DEFINED in sys/types.h. */ -#ifndef _TIMESPEC_DEFINED -struct timespec -{ - time_t tv_sec; /* seconds */ - long int tv_nsec; /* nanoseconds */ -}; -#endif - /* Required for functions in lib/time_r.c, since we don't use lib/time.h. */ extern struct tm *gmtime_r (time_t const * restrict, struct tm * restrict); extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); @@ -459,6 +464,10 @@ extern void *malloc_after_dump(size_t); extern void *realloc_after_dump(void *, size_t); extern void free_after_dump(void *); +extern void *malloc_after_dump_9x(size_t); +extern void *realloc_after_dump_9x(void *, size_t); +extern void free_after_dump_9x(void *); + extern malloc_fn the_malloc_fn; extern realloc_fn the_realloc_fn; extern free_fn the_free_fn; @@ -597,5 +606,7 @@ extern void _DebPrint (const char *fmt, ...); #endif #endif +/* Event name for when emacsclient starts the Emacs daemon on Windows. */ +#define W32_DAEMON_EVENT "EmacsServerEvent" /* ============================================================ */