path: Fix a sparse warning

On MinGW, sparse issues an "'get_st_mode_bits' not declared. Should it be static?" warning. The MinGW and MSVC builds do not see the declaration of this function, within git-compat-util.h, due to its placement within an preprocessor conditional. In order to suppress the warning, we simply move the declaration to the top level of the header. Signed-off-by: Ramsay Jones <ramsay@ramsay1.demon.co.uk> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Ramsay Jones committed May 30, 2013 at 00:53 UTC 2f0aaaf9dabd846061a759b53ff4759ec886df62
1 file changed +3 -1
git-compat-util.h
+3 -1
@@ -127,6 +127,9 @@
127 #else
128 #include <poll.h>
129 #endif
130 +
131 +extern int get_st_mode_bits(const char *path, int *mode);
132 +
133 #if defined(__MINGW32__)
134 /* pull in Windows compatibility stuff */
135 #include "compat/mingw.h"
@@ -163,7 +166,6 @@
166 typedef long intptr_t;
167 typedef unsigned long uintptr_t;
168 #endif
166 -int get_st_mode_bits(const char *path, int *mode);
169 #if defined(__CYGWIN__)
170 #undef _XOPEN_SOURCE
171 #include <grp.h>