From 15736aeec37aa5d4acb0fb596ebf31989baa3b09 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Wed, 19 Aug 2015 11:16:47 -0700 Subject: [PATCH] Visual Studio Projects: Added support for building under Visual Studio Community (2015) Release build binaries built under Visual Studio Community DO NOT run on Windows XP. Fix: #233 --- PDP18B/pdp18b_fpp.c | 1 + Visual Studio Projects/Pre-Build-Event.cmd | 2 ++ sigma/sigma_cpu.c | 2 +- sim_timer.h | 10 ++++++++-- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/PDP18B/pdp18b_fpp.c b/PDP18B/pdp18b_fpp.c index 0f2f8a04..b7b5109c 100644 --- a/PDP18B/pdp18b_fpp.c +++ b/PDP18B/pdp18b_fpp.c @@ -139,6 +139,7 @@ static int32 fir; /* instruction */ static int32 jea; /* exc address */ static int32 fguard; /* guard bit */ static int32 stop_fpp = STOP_RSRV; /* stop if fp dis */ +#define fma fma_X /* Avoid name conflict with math.h defined fma() routine */ static UFP fma; /* FMA */ static UFP fmb; /* FMB */ static UFP fmq; /* FMQ - hi,lo only */ diff --git a/Visual Studio Projects/Pre-Build-Event.cmd b/Visual Studio Projects/Pre-Build-Event.cmd index 7768c6b0..ca21c424 100644 --- a/Visual Studio Projects/Pre-Build-Event.cmd +++ b/Visual Studio Projects/Pre-Build-Event.cmd @@ -88,6 +88,8 @@ if exist ../../windows-build-windows-build goto _notice3 :_check_files if not exist ../../windows-build/winpcap/Wpdpack/Include/pcap.h goto _notice1 if not exist ../../windows-build/pthreads/pthread.h goto _notice1 +findstr "/c:_MSC_VER >= 1900" ..\..\windows-build\pthreads\pthread.h >NUL +if ERRORLEVEL 1 goto _notice2 if "%_X_LIBSDL%" == "" goto _done_libsdl if not exist ../../windows-build/libSDL/SDL2-2.0.3/include/SDL.h goto _notice2 if not exist "../../windows-build/libSDL/Microsoft DirectX SDK (June 2010)/Lib/x86/dxguid.lib" goto _notice2 diff --git a/sigma/sigma_cpu.c b/sigma/sigma_cpu.c index eb242d93..0b3fc9e6 100644 --- a/sigma/sigma_cpu.c +++ b/sigma/sigma_cpu.c @@ -2724,7 +2724,7 @@ if (cptr) { else dlnt = 2; bpa = ad << val; if (virt && map_reloc (bpa, VNT, &bpa)) - fprintf (of, "Virtual address %-X: memory management error\n"); + fprintf (of, "Virtual address %-X: memory management error\n", ad); else fprintf (of, "%s %s %-X: physical %s %-X\n", ((virt)? "Virtual": "Physical"), lnt_str[val], ad, lnt_str[dlnt], bpa >> dlnt); return SCPE_OK; diff --git a/sim_timer.h b/sim_timer.h index a3b4b101..57508b69 100644 --- a/sim_timer.h +++ b/sim_timer.h @@ -45,6 +45,12 @@ #if !defined(CLOCK_REALTIME) && !defined(__hpux) #define CLOCK_REALTIME 1 #define NEED_CLOCK_GETTIME 1 +#if defined(_MSC_VER) /* Visual Studio/Visual C++ */ +#if _MSC_VER >= 1900 /* Visual Studio Community (2015) */ +#define HAVE_STRUCT_TIMESPEC 1 +#define _TIMESPEC_DEFINED 1 +#endif /* _MSC_VER >= 1900 */ +#endif /* defined(_MSC_VER) */ #if !defined(HAVE_STRUCT_TIMESPEC) #define HAVE_STRUCT_TIMESPEC 1 #if !defined(_TIMESPEC_DEFINED) @@ -53,8 +59,8 @@ struct timespec { long tv_sec; long tv_nsec; }; -#endif /* _TIMESPEC_DEFINED */ -#endif /* HAVE_STRUCT_TIMESPEC */ +#endif /* !defined(_TIMESPEC_DEFINED) */ +#endif /* !defined(HAVE_STRUCT_TIMESPEC) */ int clock_gettime(int clock_id, struct timespec *tp); #endif