diff options
Diffstat (limited to 'include/llvm/Support')
-rw-r--r-- | include/llvm/Support/CommandLine.h | 3 | ||||
-rw-r--r-- | include/llvm/Support/DataTypes.h.in | 6 |
2 files changed, 8 insertions, 1 deletions
diff --git a/include/llvm/Support/CommandLine.h b/include/llvm/Support/CommandLine.h index 10a2f6c..1d499de 100644 --- a/include/llvm/Support/CommandLine.h +++ b/include/llvm/Support/CommandLine.h @@ -21,6 +21,7 @@ #define LLVM_SUPPORT_COMMANDLINE_H #include "llvm/Support/type_traits.h" +#include "llvm/Support/DataTypes.h" #include <string> #include <vector> #include <utility> @@ -335,7 +336,7 @@ public: template<class DataType> ValuesClass<DataType> values(const char *Arg, DataType Val, const char *Desc, - ...) { + ...) END_WITH_NULL { va_list ValueArgs; va_start(ValueArgs, Desc); ValuesClass<DataType> Vals(Arg, Val, Desc, ValueArgs); diff --git a/include/llvm/Support/DataTypes.h.in b/include/llvm/Support/DataTypes.h.in index b99739dc..cfec5f3 100644 --- a/include/llvm/Support/DataTypes.h.in +++ b/include/llvm/Support/DataTypes.h.in @@ -98,4 +98,10 @@ typedef signed int ssize_t; # define UINT64_MAX 0xffffffffffffffffULL #endif +#if __GNUC__ > 3 +#define END_WITH_NULL __attribute__((sentinel)) +#else +#define END_WITH_NULL +#endif + #endif /* SUPPORT_DATATYPES_H */ |