Guard __gnuc_va_list typedef.

Differential Revision: http://reviews.llvm.org/D28620

llvm-svn: 292819
This commit is contained in:
Paul Robinson 2017-01-23 19:09:21 +00:00
parent 7b49ad74ed
commit a363d14538
2 changed files with 11 additions and 2 deletions

View File

@ -43,10 +43,9 @@ typedef __builtin_va_list va_list;
#define va_copy(dest, src) __builtin_va_copy(dest, src)
#endif
/* Hack required to make standard headers work, at least on Ubuntu */
#ifndef __GNUC_VA_LIST
#define __GNUC_VA_LIST 1
#endif
typedef __builtin_va_list __gnuc_va_list;
#endif
#endif /* __STDARG_H */

View File

@ -0,0 +1,10 @@
// RUN: %clang_cc1 -fsyntax-only -verify -Wsystem-headers -std=c99 %s
// expected-no-diagnostics
// Check that no warnings are emitted from stdarg.h if __gnuc_va_list has
// previously been defined in another header file.
typedef __builtin_va_list __va_list;
typedef __va_list __gnuc_va_list;
#define __GNUC_VA_LIST
#include <stdarg.h>