diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-03-20 00:31:57 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-03-20 07:32:41 +0000 |
commit | 5f739fb83746d7a1cf68325db765b73f568526a1 (patch) | |
tree | 52a856a8b0c43d3c29a9353dedfa7c6a9b1e1bc3 /version_info.c | |
parent | 6401440932006465004650d3ac3722670174d0ac (diff) |
Handle Clang/C2.
Microsoft have a C/C++ compiler with a Clang front end and their code
generator:
https://blogs.msdn.microsoft.com/vcblog/tag/clang/
Try to detect it. (It's not too late.)
Change-Id: I574e3f985f376727df77081b429cad7f3d1f5d70
Reviewed-on: https://code.wireshark.org/review/26563
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'version_info.c')
-rw-r--r-- | version_info.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/version_info.c b/version_info.c index 37601cf7e7..6c80bd9174 100644 --- a/version_info.c +++ b/version_info.c @@ -184,7 +184,18 @@ get_compiler_info(GString *str) * distinguish between them. */ #if defined(__clang__) + /* + * Microsoft have a version of their compiler that has Clang + * as the front end and their code generator as the back end. + * + * My head asplode. + */ + #if defined(__MSC_VER) + g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d.%d clang/C2 %s and -fno-ms-compatibility.\n", + (_MSC_VER / 100) - 6, _MSC_VER % 100, __VERSION__); + #else g_string_append_printf(str, "\n\nBuilt using clang %s.\n", __VERSION__); + #endif /* defined(__MSC_VER) */ #elif defined(__llvm__) g_string_append_printf(str, "\n\nBuilt using llvm-gcc %s.\n", __VERSION__); #else /* boring old GCC */ @@ -248,6 +259,13 @@ get_compiler_info(GString *str) g_string_append_printf(str, "\n"); #elif defined(_MSC_VER) /* _MSC_FULL_VER not defined, but _MSC_VER defined */ + #if defined(__clang__) + /* More head asplosion; see above. */ + g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d.%d clang/C2 %s.\n", + (_MSC_VER / 100) - 6, _MSC_VER % 100, __VERSION__); + #else + g_string_append_printf(str, "\n\nBuilt using clang %s.\n", __VERSION__); + #endif /* defined(__MSC_VER) */ g_string_append_printf(str, "\n\nBuilt using Microsoft Visual C++ %d.%d\n", (_MSC_VER / 100) - 6, _MSC_VER % 100); #elif defined(__SUNPRO_C) |