Merge branch 'ab/merge-file-prefix'
[gitweb.git] / git-compat-util.h
index eb9b0ff32829ef62bf2d1af432742841b9720906..68c07af9d465ce92d78b11d347ae0396299a1855 100644 (file)
@@ -678,6 +678,11 @@ extern char *xgetcwd(void);
 
 #define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x)))
 
+static inline char *xstrdup_or_null(const char *str)
+{
+       return str ? xstrdup(str) : NULL;
+}
+
 static inline size_t xsize_t(off_t len)
 {
        if (len > (size_t) len)
@@ -870,4 +875,8 @@ struct tm *git_gmtime_r(const time_t *, struct tm *);
 #define gmtime_r git_gmtime_r
 #endif
 
+#if !defined(USE_PARENS_AROUND_GETTEXT_N) && defined(__GNUC__)
+#define USE_PARENS_AROUND_GETTEXT_N 1
+#endif
+
 #endif