posix: Fix undeclared prototype
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
diff --git a/src/posix.h b/src/posix.h
index 622bf83..f1424f8 100644
--- a/src/posix.h
+++ b/src/posix.h
@@ -8,12 +8,6 @@
#include <fcntl.h>
#include <time.h>
-#ifdef GIT_WIN32
-# include "win32/posix.h"
-#else
-# include "unix/posix.h"
-#endif
-
#define S_IFGITLINK 0160000
#define S_ISGITLINK(m) (((m) & S_IFMT) == S_IFGITLINK)
@@ -23,7 +17,6 @@
typedef int git_file;
-
/**
* Standard POSIX Methods
*
@@ -51,4 +44,13 @@ extern int p_getcwd(char *buffer_out, size_t size);
#define p_chmod(p,m) chmod(p, m)
#define p_close(fd) close(fd)
+/**
+ * Platform-dependent methods
+ */
+#ifdef GIT_WIN32
+# include "win32/posix.h"
+#else
+# include "unix/posix.h"
+#endif
+
#endif
diff --git a/src/win32/posix.c b/src/win32/posix.c
index aac56ce..2d7b839 100644
--- a/src/win32/posix.c
+++ b/src/win32/posix.c
@@ -232,6 +232,8 @@ int p_snprintf(char *buffer, size_t count, const char *format, ...)
return r;
}
+extern int p_creat(const char *path, int mode);
+
int p_mkstemp(char *tmp_path)
{
int r;