]> gitweb.factorcode.org Git - factor.git/blobdiff - vm/os-windows-nt.hpp
vm: Tweak Factor VM to compile with Microsoft Visual Studio on Windows, in addition...
[factor.git] / vm / os-windows-nt.hpp
index f8407aeee55954972f5eeb209214cc1a9dbf8119..1559d1147db1d3f7c97afdbbaf6dcddb1bbdf708 100755 (executable)
@@ -8,18 +8,27 @@
 #include <windows.h>
 #include <shellapi.h>
 
+#ifdef _MSC_VER
+       #undef min
+       #undef max
+#endif
+
 namespace factor
 {
 
 typedef char symbol_char;
 
 #define FACTOR_OS_STRING "winnt"
-#define FACTOR_DLL L"factor.dll"
-#define FACTOR_DLL_NAME "factor.dll"
 
-#define FACTOR_STDCALL __attribute__((stdcall))
+#ifdef _MSC_VER
+       #define FACTOR_DLL NULL
+       #define FACTOR_STDCALL(return_type) return_type __stdcall
+#else
+       #define FACTOR_DLL L"factor.dll"
+       #define FACTOR_STDCALL(return_type) __attribute__((stdcall)) return_type
+#endif
 
-FACTOR_STDCALL LONG exception_handler(PEXCEPTION_POINTERS pe);
+FACTOR_STDCALL(LONG) exception_handler(PEXCEPTION_POINTERS pe);
 
 // SSE traps raise these exception codes, which are defined in internal NT headers
 // but not winbase.h