From d4f38d5358b13fb6c5f8a14c08f053a47476c323 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 1 Oct 2016 07:38:42 -0700 Subject: [PATCH] SCP: Add compiled architecture and release/debug info to SHOW VERSION --- scp.c | 39 +++++++++++++++++++++++++++++------- slirp_glue/glib_qemu_stubs.c | 12 +++++------ 2 files changed, 38 insertions(+), 13 deletions(-) diff --git a/scp.c b/scp.c index 8adb2057..96dc48af 100644 --- a/scp.c +++ b/scp.c @@ -4358,13 +4358,10 @@ return; t_stat show_version (FILE *st, DEVICE *dptr, UNIT *uptr, int32 flag, CONST char *cptr) { int32 vmaj = SIM_MAJOR, vmin = SIM_MINOR, vpat = SIM_PATCH, vdelt = SIM_DELTA; -const char *cpp; +const char *cpp = ""; +const char *build = ""; +const char *arch = ""; -#ifdef __cplusplus -cpp = "C++"; -#else -cpp = "C"; -#endif if (cptr && (*cptr != 0)) return SCPE_2MARG; fprintf (st, "%s simulator V%d.%d-%d", sim_name, vmaj, vmin, vpat); @@ -4406,6 +4403,11 @@ if (flag) { fprintf (st, "\n\t\tCompiler: clang %s", __clang_version__); #elif defined (_MSC_FULL_VER) && defined (_MSC_BUILD) fprintf (st, "\n\t\tCompiler: Microsoft Visual C++ %d.%02d.%05d.%02d", _MSC_FULL_VER/10000000, (_MSC_FULL_VER/100000)%100, _MSC_FULL_VER%100000, _MSC_BUILD); +#if defined(_DEBUG) + build = " (Debug Build)"; +#else + build = " (Release Build)"; +#endif #elif defined (__DECC_VER) fprintf (st, "\n\t\tCompiler: DEC C %c%d.%d-%03d", ("T SV")[((__DECC_VER/10000)%10)-6], __DECC_VER/10000000, (__DECC_VER/100000)%100, __DECC_VER%10000); #elif defined (SIM_COMPILER) @@ -4415,8 +4417,31 @@ if (flag) { #undef S_str #undef S_xstr #endif +#if defined(__GNUC__) +#if defined(__OPTIMIZE__) + build = " (Release Build)"; +#else + build = " (Debug Build)"; +#endif +#endif +#if defined(_M_X64) || defined(_M_AMD64) || defined(__amd64__) || defined(__x86_64__) + arch = " arch: x64"; +#elif defined(_M_IX86) || defined(__i386) + arch = " arch: x86"; +#elif defined(_M_ARM64) || defined(__aarch64_) + arch = " arch: ARM64"; +#elif defined(_M_ARM) || defined(__arm__) + arch = " arch: ARM"; +#elif defined(__ia64__) || defined(_M_IA64) || defined(__itanium__) + arch = " arch: IA-64"; +#endif #if defined (__DATE__) && defined (__TIME__) - fprintf (st, "\n\t\tSimulator Compiled as %s: %s at %s", cpp, __DATE__, __TIME__); +#ifdef __cplusplus + cpp = "C++"; +#else + cpp = "C"; +#endif + fprintf (st, "\n\t\tSimulator Compiled as %s%s%s on %s at %s", cpp, arch, build, __DATE__, __TIME__); #endif fprintf (st, "\n\t\tMemory Access: %s Endian", sim_end ? "Little" : "Big"); fprintf (st, "\n\t\tMemory Pointer Size: %d bits", (int)sizeof(dptr)*8); diff --git a/slirp_glue/glib_qemu_stubs.c b/slirp_glue/glib_qemu_stubs.c index ab1e5a32..fd6030c8 100644 --- a/slirp_glue/glib_qemu_stubs.c +++ b/slirp_glue/glib_qemu_stubs.c @@ -165,9 +165,9 @@ int socket_set_fast_reuse(int fd) return ret; } -#if defined(__cplusplus) -extern "C" { -#endif +#if defined(__cplusplus) +extern "C" { +#endif #include #ifdef _WIN32 int64_t qemu_clock_get_ns(int type) @@ -196,9 +196,9 @@ int64_t qemu_clock_get_ns(int type) return tv.tv_sec * 1000000000LL + tv.tv_nsec; } #endif -#if defined(__cplusplus) -} -#endif +#if defined(__cplusplus) +} +#endif void monitor_printf(Monitor *mon, const char *fmt, ...) {