external/liblangtag: -Werror,-Wundef (__GNUC__ vs. clang-cl)

Change-Id: I4213eb841d7eb3627ae64cc242b81b8e7f09cc79
This commit is contained in:
Stephan Bergmann
2016-03-04 10:00:44 +01:00
parent 6b68df5763
commit 61b541e9ef
2 changed files with 25 additions and 0 deletions

View File

@@ -30,4 +30,9 @@ $(eval $(call gb_UnpackedTarball_add_patches,langtag,\
))
endif
endif
$(eval $(call gb_UnpackedTarball_add_patches,langtag, \
external/liblangtag/clang-cl.patch.0 \
))
# vim: set noet sw=4 ts=4:

20
external/liblangtag/clang-cl.patch.0 vendored Executable file
View File

@@ -0,0 +1,20 @@
--- liblangtag/lt-macros.h
+++ liblangtag/lt-macros.h
@@ -120,7 +120,7 @@
* It allows the compiler to type-check the arguments passed to the function.
* See the GNU C documentation for details.
*/
-#if __GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4)
+#if (defined __GNUC__ && (__GNUC__ > 2 || (__GNUC__ == 2 && __GNUC_MINOR__ > 4))) || defined __clang__
# define LT_GNUC_PRINTF(format_idx, arg_idx) \
__attribute__((__format__ (__printf__, format_idx, arg_idx)))
#else /* !__GNUC__ */
@@ -136,7 +136,7 @@
* explicit %NULL.
* See the GNU C documentation for details.
*/
-#if __GNUC__ >= 4
+#if (defined __GNUC__ &&__GNUC__ >= 4) || defined __clang__
# define LT_GNUC_NULL_TERMINATED \
__attribute__((__sentinel__))
#else /* !__GNUC__ */