33 lines
1.3 KiB
Diff
33 lines
1.3 KiB
Diff
From 6034012a6645830a453a48561480f3e8c2291fec Mon Sep 17 00:00:00 2001
|
|
From: q66 <q66@chimera-linux.org>
|
|
Date: Sat, 4 Nov 2023 09:20:52 +0100
|
|
Subject: [PATCH 25/29] Get rid of spurious trailing space in __clang_version__
|
|
|
|
---
|
|
clang/lib/Frontend/InitPreprocessor.cpp | 10 +++++++---
|
|
1 file changed, 7 insertions(+), 3 deletions(-)
|
|
|
|
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
|
|
index c239342fa..3ee01ac9a 100644
|
|
--- a/clang/lib/Frontend/InitPreprocessor.cpp
|
|
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
|
|
@@ -866,9 +866,13 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
|
|
Builder.defineMacro("__clang_patchlevel__", TOSTR(CLANG_VERSION_PATCHLEVEL));
|
|
#undef TOSTR
|
|
#undef TOSTR2
|
|
- Builder.defineMacro("__clang_version__",
|
|
- "\"" CLANG_VERSION_STRING " "
|
|
- + getClangFullRepositoryVersion() + "\"");
|
|
+ auto fullver = getClangFullRepositoryVersion();
|
|
+ if (!fullver.empty()) {
|
|
+ Builder.defineMacro("__clang_version__",
|
|
+ "\"" CLANG_VERSION_STRING " " + fullver + "\"");
|
|
+ } else {
|
|
+ Builder.defineMacro("__clang_version__", "\"" CLANG_VERSION_STRING "\"");
|
|
+ }
|
|
|
|
if (LangOpts.GNUCVersion != 0) {
|
|
// Major, minor, patch, are given two decimal places each, so 4.2.1 becomes
|
|
--
|
|
2.49.0
|
|
|