summaryrefslogtreecommitdiffstats
path: root/googletest/include/gtest/internal/gtest-port.h
diff options
context:
space:
mode:
authorDavid Benjamin <davidben@google.com>2018-01-03 19:55:52 (GMT)
committerDavid Benjamin <davidben@google.com>2018-01-03 19:55:52 (GMT)
commit1acf8c752ee8e20888e5ae887846f034b09c5ca9 (patch)
treeada13a416941590ee2c5881bd3a1096167b5cb24 /googletest/include/gtest/internal/gtest-port.h
parentba6ecedede74521490f36b6aea08f91fdad6d201 (diff)
downloadgoogletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.zip
googletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.tar.gz
googletest-1acf8c752ee8e20888e5ae887846f034b09c5ca9.tar.bz2
Also define GTEST_ATTRIBUTE_PRINTF_ in clang-cl.refs/pull/1377/head
clang-cl is clang for Windows running in MSVC mode. Chromium uses it for Windows builds. clang-cl is weird in that it defines __clang__ and _MSC_VER, but *NOT* __GNUC__. This is vaguely analogous to how normal clang defines __clang__ (what it is) and __GNUC__ (what it is compatible with). However, clang-cl still implements most GCC extensions, being clang. Notably, the way to control -Wformat-literal is still with __attribute__((__format__)). For better error-checking and strict -Wformatl-literal compatibility (see 53c478d639b8eebd2942e88266610ebc79c541f6), define GTEST_ATTRIBUTE_PRINTF_ in clang-cl too.
Diffstat (limited to 'googletest/include/gtest/internal/gtest-port.h')
-rw-r--r--googletest/include/gtest/internal/gtest-port.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/googletest/include/gtest/internal/gtest-port.h b/googletest/include/gtest/internal/gtest-port.h
index 8778bdd..58ab7fd 100644
--- a/googletest/include/gtest/internal/gtest-port.h
+++ b/googletest/include/gtest/internal/gtest-port.h
@@ -879,7 +879,7 @@ using ::std::tuple_size;
#endif
// Use this annotation before a function that takes a printf format string.
-#if defined(__GNUC__) && !defined(COMPILER_ICC)
+#if (defined(__GNUC__) || defined(__clang__)) && !defined(COMPILER_ICC)
# if defined(__MINGW_PRINTF_FORMAT)
// MinGW has two different printf implementations. Ensure the format macro
// matches the selected implementation. See