diff --git a/git-compat-util.h b/git-compat-util.h
index f23d934f667cc2b10ee668a3bfef8492aadbbe7d..7b29d1b905c618a50704a7b2c38041f71c942e71 100644 (file)
--- a/git-compat-util.h
+++ b/git-compat-util.h
extern int gitsetenv(const char *, const char *, int);
#endif
extern int gitsetenv(const char *, const char *, int);
#endif
+#ifdef NO_MKDTEMP
+#define mkdtemp gitmkdtemp
+extern char *gitmkdtemp(char *);
+#endif
+
#ifdef NO_UNSETENV
#define unsetenv gitunsetenv
extern void gitunsetenv(const char *);
#ifdef NO_UNSETENV
#define unsetenv gitunsetenv
extern void gitunsetenv(const char *);
return 0;
}
return 0;
}
+static inline int strtol_i(char const *s, int base, int *result)
+{
+ long ul;
+ char *p;
+
+ errno = 0;
+ ul = strtol(s, &p, base);
+ if (errno || *p || p == s || (int) ul != ul)
+ return -1;
+ *result = ul;
+ return 0;
+}
+
#endif
#endif