]> code.delx.au - gnu-emacs/blobdiff - nt/inc/ms-w32.h
Merge from trunk, configury not fixed yet.
[gnu-emacs] / nt / inc / ms-w32.h
index 9ff03994be2e46789261e19149ab8a1efb79ba4b..24078f9a3443d37586dae34c3893c12ee8aebdcc 100644 (file)
@@ -67,7 +67,9 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #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
@@ -99,8 +101,12 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #endif
 
 #ifdef __GNUC__
-# define restrict __restrict__
+/* config.h may have defined already.  */
+# ifndef restrict
+#  define restrict __restrict__
+# endif
 #else
+  /* FIXME: should we define to __restrict, which MSVC supports? */
 # define restrict
 #endif
 
@@ -138,9 +144,6 @@ extern char *getenv ();
 /* Make a leaner executable.  */
 #define WIN32_LEAN_AND_MEAN 1
 
-#ifdef HAVE_STRINGS_H
-#include "strings.h"
-#endif
 #include <sys/types.h>
 
 #ifndef MAXPATHLEN
@@ -148,8 +151,12 @@ extern char *getenv ();
 #endif
 
 #ifdef HAVE_NTGUI
-#define HAVE_WINDOW_SYSTEM 1
-#define HAVE_MENUS 1
+# ifndef HAVE_WINDOW_SYSTEM
+#  define HAVE_WINDOW_SYSTEM 1
+# endif
+# ifndef HAVE_MENUS
+#  define HAVE_MENUS 1
+# endif
 #endif
 
 /* Get some redefinitions in place.  */
@@ -248,9 +255,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
@@ -266,9 +270,6 @@ typedef int pid_t;
 #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
@@ -285,10 +286,6 @@ int _getpid (void);
    array, and triggers an error message.  */
 #include <time.h>
 #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
@@ -327,6 +324,9 @@ extern struct tm *localtime_r (time_t const * restrict, struct tm * restrict);
 #include <io.h>
 #include <stdio.h>
 #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 */
@@ -357,9 +357,11 @@ 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);
@@ -395,10 +397,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
@@ -452,10 +456,14 @@ extern void * memrchr (void const *, int, size_t);
 #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