From c3b8a4b92f38a659ad6e6b017ef230bf57ae7a2f Mon Sep 17 00:00:00 2001 From: mjbudd77 Date: Mon, 7 Feb 2022 18:14:55 -0500 Subject: [PATCH] Updated compiler strings for Qt/SDL GUI. Added more detail for msvc and added clang check. --- src/drivers/Qt/fceuWrapper.cpp | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/src/drivers/Qt/fceuWrapper.cpp b/src/drivers/Qt/fceuWrapper.cpp index ebe19e61..d701fcfb 100644 --- a/src/drivers/Qt/fceuWrapper.cpp +++ b/src/drivers/Qt/fceuWrapper.cpp @@ -148,11 +148,31 @@ EMUFILE_FILE* FCEUD_UTF8_fstream(const char *fn, const char *m) //return new std::fstream(fn,mode); } -#ifdef _MSC_VER -static const char *s_CompilerString = "MSVC"; +#if defined(MSVC) + #ifdef _M_X64 + #define _MSVC_ARCH "x64" + #else + #define _MSVC_ARCH "x86" + #endif + #ifdef _DEBUG + #define _MSVC_BUILD "debug" + #else + #define _MSVC_BUILD "release" + #endif + #define __COMPILER__STRING__ "msvc " _Py_STRINGIZE(_MSC_VER) " " _MSVC_ARCH " " _MSVC_BUILD + #define _Py_STRINGIZE(X) _Py_STRINGIZE1((X)) + #define _Py_STRINGIZE1(X) _Py_STRINGIZE2 ## X + #define _Py_STRINGIZE2(X) #X + //re: http://72.14.203.104/search?q=cache:HG-okth5NGkJ:mail.python.org/pipermail/python-checkins/2002-November/030704.html+_msc_ver+compiler+version+string&hl=en&gl=us&ct=clnk&cd=5 +#elif defined(__GNUC__) + #define __COMPILER__STRING__ "gcc " __VERSION__ +#elif defined(__clang__) + #define __COMPILER__STRING__ "clang " __VERSION__ #else -static const char *s_CompilerString = "g++ " __VERSION__; + #define __COMPILER__STRING__ "unknown" #endif + +static const char *s_CompilerString = __COMPILER__STRING__; /** * Returns the compiler string. */