X-Git-Url: https://code.delx.au/gnu-emacs/blobdiff_plain/5d611e04506c5d34c823ea06fc4b27ff715a493e..3e93bafb95608467e438ba7f725fd1f020669f8c:/nt/inc/ms-w32.h diff --git a/nt/inc/ms-w32.h b/nt/inc/ms-w32.h index 6cbec2bdaa..dca3476b2b 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-2013 Free Software Foundation, Inc. +Copyright (C) 1993-1995, 2001-2014 Free Software Foundation, Inc. This file is part of GNU Emacs. @@ -24,6 +24,8 @@ along with GNU Emacs. If not, see . */ #define WINDOWSNT #endif +#include + /* #undef const */ /* Number of chars of output in the buffer of a stdio stream. */ @@ -67,7 +69,9 @@ along with GNU Emacs. If not, see . */ #endif #if (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)) -#define HAVE___BUILTIN_UNWIND_INIT 1 +# ifndef HAVE___BUILTIN_UNWIND_INIT +# define HAVE___BUILTIN_UNWIND_INIT 1 +# endif #endif /* This isn't perfect, as some systems might have the page file in @@ -142,18 +146,19 @@ extern char *getenv (); /* Make a leaner executable. */ #define WIN32_LEAN_AND_MEAN 1 -#ifdef HAVE_STRINGS_H -#include "strings.h" -#endif #include #ifndef MAXPATHLEN #define MAXPATHLEN _MAX_PATH #endif +/* This is used to hold UTF-8 encoded file names. */ +#define MAX_UTF8_PATH (MAXPATHLEN * 4) + #ifdef HAVE_NTGUI -#define HAVE_WINDOW_SYSTEM 1 -#define HAVE_MENUS 1 +# ifndef HAVE_WINDOW_SYSTEM +# define HAVE_WINDOW_SYSTEM 1 +# endif #endif /* Get some redefinitions in place. */ @@ -171,7 +176,7 @@ extern char *getenv (); extern struct tm * sys_localtime (const time_t *); /* MinGW64 uses a 2-argument _setjmp, and setjmp is a macro defined to supply the 2nd arg correctly, so don't use _setjmp directly in that - case. */ + case. */ #undef HAVE__SETJMP #endif @@ -204,11 +209,8 @@ extern struct tm * sys_localtime (const time_t *); #define link sys_link #define localtime sys_localtime #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 @@ -219,12 +221,23 @@ extern struct tm * sys_localtime (const time_t *); #define strerror sys_strerror #undef unlink #define unlink sys_unlink +#undef opendir +#define opendir sys_opendir +#undef closedir +#define closedir sys_closedir +#undef readdir +#define readdir sys_readdir +#undef seekdir +#define seekdir sys_seekdir /* This prototype is needed because some files include config.h _after_ the standard headers, so sys_unlink gets no prototype from stdio.h or io.h. */ extern int sys_unlink (const char *); #undef write #define write sys_write +#undef umask +#define umask sys_umask +extern int sys_umask (int); /* Subprocess calls that are emulated. */ #define spawnve sys_spawnve @@ -252,9 +265,6 @@ extern int sys_unlink (const char *); #define execvp _execvp #define fdatasync _commit #define fdopen _fdopen -#ifndef fileno -#define fileno _fileno -#endif #define fsync _commit #define ftruncate _chsize #define getpid _getpid @@ -262,16 +272,13 @@ extern int sys_unlink (const char *); typedef int pid_t; #define snprintf _snprintf #define strtoll _strtoi64 +#define copysign _copysign #endif #define isatty _isatty #define _longjmp longjmp #define lseek _lseek #define popen _popen #define pclose _pclose -#define umask _umask -#ifndef _MSC_VER -#define utimbuf _utimbuf -#endif #define strdup _strdup #define strupr _strupr #define strnicmp _strnicmp @@ -288,10 +295,6 @@ int _getpid (void); array, and triggers an error message. */ #include #define tzname _tzname -#if !defined (_MSC_VER) || (_MSC_VER < 1400) -#undef utime -#define utime _utime -#endif /* 'struct timespec' is used by time-related functions in lib/ and elsewhere, but we don't use lib/time.h where the structure is @@ -330,6 +333,9 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #include #include #endif /* !_MSC_VER */ +#ifndef fileno +#define fileno _fileno +#endif /* Defines that we need that aren't in the standard signal.h. */ #define SIGHUP 1 /* Hang up */ @@ -349,14 +355,21 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict); #define ENOTSUP ENOSYS #endif +/* In case lib/errno.h is not used. */ +#ifndef EOPNOTSUPP +#define EOPNOTSUPP 130 +#endif + #ifdef _MSC_VER typedef int sigset_t; typedef int ssize_t; #endif -#ifndef _POSIX /* MinGW64 */ +#ifdef _W64 /* MinGW64 */ +#ifndef _POSIX typedef _sigset_t sigset_t; #endif +#endif typedef void (_CALLBACK_ *signal_handler) (int); extern signal_handler sys_signal (int, signal_handler); @@ -375,13 +388,18 @@ extern int sigemptyset (sigset_t *); extern int sigaddset (sigset_t *, int); extern int sigfillset (sigset_t *); extern int sigprocmask (int, const sigset_t *, sigset_t *); +/* MinGW64 defines pthread_sigmask as zero in its pthread_signal.h + header, but we have an implementation for that function in w32proc.c. */ +#ifdef pthread_sigmask +#undef pthread_sigmask +#endif extern int pthread_sigmask (int, const sigset_t *, sigset_t *); extern int sigismember (const sigset_t *, int); extern int setpgrp (int, int); extern int sigaction (int, const struct sigaction *, struct sigaction *); extern int alarm (int); -extern int sys_kill (int, int); +extern int sys_kill (pid_t, int); /* For integration with MSDOS support. */ @@ -392,10 +410,12 @@ extern int sys_kill (int, int); #define getdefdir(_drv, _buf) _getdcwd (_drv, _buf, MAXPATHLEN) #endif +#ifndef EMACS_CONFIGURATION extern char *get_emacs_configuration (void); extern char *get_emacs_configuration_options (void); #define EMACS_CONFIGURATION get_emacs_configuration () #define EMACS_CONFIG_OPTIONS get_emacs_configuration_options () +#endif /* Define this so that winsock.h definitions don't get included with windows.h. For this to have proper effect, config.h must always be @@ -445,14 +465,20 @@ extern int getpagesize (void); extern void * memrchr (void const *, int, size_t); +extern int mkostemp (char *, int); + #if defined (__MINGW32__) /* Define to 1 if the system has the type `long long int'. */ -# define HAVE_LONG_LONG_INT 1 +# ifndef HAVE_LONG_LONG_INT +# define HAVE_LONG_LONG_INT 1 +# endif /* Define to 1 if the system has the type `unsigned long long int'. */ -# define HAVE_UNSIGNED_LONG_LONG_INT 1 +# ifndef HAVE_UNSIGNED_LONG_LONG_INT +# define HAVE_UNSIGNED_LONG_LONG_INT 1 +# endif #endif @@ -540,7 +566,6 @@ extern void _DebPrint (const char *fmt, ...); #pragma warning(disable:4308) #endif #endif -#define TERM_HEADER "w32term.h" /* ============================================================ */