]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-compat-util.h
Add the LAST_ARG_MUST_BE_NULL macro
[thirdparty/git.git] / git-compat-util.h
index e955bb5e8b3101cc8c753cf541beabf5cd037b39..10e3ba6bc87b8427ccf1eccb31c0bcbc532a669c 100644 (file)
@@ -295,6 +295,13 @@ extern char *gitbasename(char *);
 #endif
 #endif
 
+/* The sentinel attribute is valid from gcc version 4.0 */
+#if defined(__GNUC__) && (__GNUC__ >= 4)
+#define LAST_ARG_MUST_BE_NULL __attribute__((sentinel))
+#else
+#define LAST_ARG_MUST_BE_NULL
+#endif
+
 #include "compat/bswap.h"
 
 #ifdef USE_WILDMATCH