aboutsummaryrefslogtreecommitdiffstats
path: root/wsutil
diff options
context:
space:
mode:
authorAndersBroman <anders.broman@ericsson.com>2015-08-05 14:30:27 +0200
committerAnders Broman <a.broman58@gmail.com>2015-08-05 12:34:11 +0000
commit5de487aa78aa6ae4fe1af991f6ce536d2ff5b5f6 (patch)
tree6faa475359cba7d591654ab04fc8f186b0b309b6 /wsutil
parent8bf1237c1f5010674942dc941dca78ced9f224f9 (diff)
[MSVC 2015] Compiler and visual studio version are off by 5 not 6 in MSVC
2015. Change-Id: I5476656789893af2c8aeb5dfe5cf06972fd8bd4b Reviewed-on: https://code.wireshark.org/review/9873 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'wsutil')
-rw-r--r--wsutil/ws_version_info.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/wsutil/ws_version_info.c b/wsutil/ws_version_info.c
index f8a266260b..b1df7aa383 100644
--- a/wsutil/ws_version_info.c
+++ b/wsutil/ws_version_info.c
@@ -223,8 +223,23 @@ get_compiler_info(GString *str)
g_string_append_printf(str, "\n");
#elif defined(_MSC_FULL_VER)
# if _MSC_FULL_VER > 99999999
- g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
- (_MSC_FULL_VER / 10000000) - 6,
+ /* Quote from the web:
+ * Bakersfield: DevDiv's upper management determines the scheduling of new major versions.
+ * They also decided to increment the product version from 12 (for VS 2013) to 14 (for VS 2015).
+ * However, the C++ compiler's version incremented normally, from 18 to 19.
+ * (It's larger because the C++ compiler predates the "Visual" in Visual C++.)
+ * XXX? Should we just output the compiler version?
+ */
+ int compiler_major_version = (_MSC_FULL_VER / 10000000), visual_studio_ver;
+
+ if (compiler_major_version < 19) {
+ visual_studio_ver = compiler_major_version - 6;
+ }else{
+ visual_studio_ver = compiler_major_version - 5;
+ }
+
+ g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d",
+ visual_studio_ver,
(_MSC_FULL_VER / 100000) % 100);
# if (_MSC_FULL_VER % 100000) != 0
g_string_append_printf(str, " build %d",