sylvestre.ledru created this revision. sylvestre.ledru added a reviewer: rnk. Herald added a subscriber: fedor.sergeev. Herald added a project: clang.
Just like in https://reviews.llvm.org/D56803 for -dumpversion Repository: rC Clang https://reviews.llvm.org/D63048 Files: lib/Frontend/InitPreprocessor.cpp test/Preprocessor/init.c Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -8169,7 +8169,7 @@ // SPARC:#define __UINT_LEAST8_MAX__ 255 // SPARC:#define __UINT_LEAST8_TYPE__ unsigned char // SPARC:#define __USER_LABEL_PREFIX__ -// SPARC:#define __VERSION__ "4.2.1 Compatible{{.*}} +// SPARC:#define __VERSION__ "{{[0-9]+\.[0-9.]+}} Compatible{{.*}} // SPARC:#define __WCHAR_MAX__ 2147483647 // SPARC:#define __WCHAR_TYPE__ int // SPARC:#define __WCHAR_WIDTH__ 32 @@ -9041,7 +9041,7 @@ // X86_64-CLOUDABI:#define __UINT_LEAST8_MAX__ 255 // X86_64-CLOUDABI:#define __UINT_LEAST8_TYPE__ unsigned char // X86_64-CLOUDABI:#define __USER_LABEL_PREFIX__ -// X86_64-CLOUDABI:#define __VERSION__ "4.2.1 Compatible{{.*}} +// X86_64-CLOUDABI:#define __VERSION__ "{{[0-9]+\.[0-9.]+}} Compatible{{.*}} // X86_64-CLOUDABI:#define __WCHAR_MAX__ 2147483647 // X86_64-CLOUDABI:#define __WCHAR_TYPE__ int // X86_64-CLOUDABI:#define __WCHAR_WIDTH__ 32 Index: lib/Frontend/InitPreprocessor.cpp =================================================================== --- lib/Frontend/InitPreprocessor.cpp +++ lib/Frontend/InitPreprocessor.cpp @@ -604,11 +604,11 @@ // Support for #pragma redefine_extname (Sun compatibility) Builder.defineMacro("__PRAGMA_REDEFINE_EXTNAME", "1"); - // As sad as it is, enough software depends on the __VERSION__ for version - // checks that it is necessary to report 4.2.1 (the base GCC version we claim - // compatibility with) first. - Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " + - Twine(getClangFullCPPVersion()) + "\""); + // We used to report 4.2.1 as compatibility with gcc + // Now, we returns the clang version. + Builder.defineMacro("__VERSION__", "\"" CLANG_VERSION_STRING + " Compatible " + Twine(getClangFullCPPVersion()) + + "\""); // Initialize language-specific preprocessor defines.
Index: test/Preprocessor/init.c =================================================================== --- test/Preprocessor/init.c +++ test/Preprocessor/init.c @@ -8169,7 +8169,7 @@ // SPARC:#define __UINT_LEAST8_MAX__ 255 // SPARC:#define __UINT_LEAST8_TYPE__ unsigned char // SPARC:#define __USER_LABEL_PREFIX__ -// SPARC:#define __VERSION__ "4.2.1 Compatible{{.*}} +// SPARC:#define __VERSION__ "{{[0-9]+\.[0-9.]+}} Compatible{{.*}} // SPARC:#define __WCHAR_MAX__ 2147483647 // SPARC:#define __WCHAR_TYPE__ int // SPARC:#define __WCHAR_WIDTH__ 32 @@ -9041,7 +9041,7 @@ // X86_64-CLOUDABI:#define __UINT_LEAST8_MAX__ 255 // X86_64-CLOUDABI:#define __UINT_LEAST8_TYPE__ unsigned char // X86_64-CLOUDABI:#define __USER_LABEL_PREFIX__ -// X86_64-CLOUDABI:#define __VERSION__ "4.2.1 Compatible{{.*}} +// X86_64-CLOUDABI:#define __VERSION__ "{{[0-9]+\.[0-9.]+}} Compatible{{.*}} // X86_64-CLOUDABI:#define __WCHAR_MAX__ 2147483647 // X86_64-CLOUDABI:#define __WCHAR_TYPE__ int // X86_64-CLOUDABI:#define __WCHAR_WIDTH__ 32 Index: lib/Frontend/InitPreprocessor.cpp =================================================================== --- lib/Frontend/InitPreprocessor.cpp +++ lib/Frontend/InitPreprocessor.cpp @@ -604,11 +604,11 @@ // Support for #pragma redefine_extname (Sun compatibility) Builder.defineMacro("__PRAGMA_REDEFINE_EXTNAME", "1"); - // As sad as it is, enough software depends on the __VERSION__ for version - // checks that it is necessary to report 4.2.1 (the base GCC version we claim - // compatibility with) first. - Builder.defineMacro("__VERSION__", "\"4.2.1 Compatible " + - Twine(getClangFullCPPVersion()) + "\""); + // We used to report 4.2.1 as compatibility with gcc + // Now, we returns the clang version. + Builder.defineMacro("__VERSION__", "\"" CLANG_VERSION_STRING + " Compatible " + Twine(getClangFullCPPVersion()) + + "\""); // Initialize language-specific preprocessor defines.
_______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits