X-Git-Url: http://git.hcoop.net/bpt/emacs.git/blobdiff_plain/4f8a4547454e24304b4182fbf4ae4b34a7bdc92b..a6fc3b5c539c0a35e4447a12cc395294952d7561:/src/s/ms-w32.h
diff --git a/src/s/ms-w32.h b/src/s/ms-w32.h
index 813c3cef11..519f6e7bc6 100644
--- a/src/s/ms-w32.h
+++ b/src/s/ms-w32.h
@@ -86,6 +86,12 @@ along with GNU Emacs. If not, see . */
#define IS_ANY_SEP(_c_) (IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))
#include
+
+#ifdef _MSC_VER
+typedef unsigned long sigset_t;
+typedef int ssize_t;
+#endif
+
struct sigaction {
int sa_flags;
void (*sa_handler)(int);
@@ -181,6 +187,12 @@ struct sigaction {
#ifdef emacs
+#ifdef _MSC_VER
+#include
+#include
+#include
+#endif
+
/* Calls that are emulated or shadowed. */
#undef access
#define access sys_access
@@ -270,6 +282,15 @@ typedef int pid_t;
#define utime _utime
#endif
+#ifdef _MSC_VER
+/* MSVC gets link-time errors without these redirections. */
+#define fstat(a, b) sys_fstat(a, b)
+#define stat(a, b) sys_stat(a, b)
+#if _MSC_VER >= 1400
+#define utime sys_utime
+#endif
+#endif
+
/* This is hacky, but is necessary to avoid warnings about macro
redefinitions using the SDK compilers. */
#ifndef __STDC__
@@ -317,13 +338,17 @@ extern char *get_emacs_configuration_options (void);
#define _WINSOCK_H
/* Defines size_t and alloca (). */
-#ifdef USE_CRT_DLL
+#if (defined(_MSC_VER) && defined(emacs)) || defined(USE_CRT_DLL)
#define malloc e_malloc
#define free e_free
#define realloc e_realloc
#define calloc e_calloc
#endif
+#ifdef _MSC_VER
+#define alloca _alloca
+#else
#include
+#endif
#include