diff options
author | Ramsay Jones <ramsay@ramsay1.demon.co.uk> | 2013-05-30 03:53:28 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-05-30 04:03:14 +0400 |
commit | 2f0aaaf9dabd846061a759b53ff4759ec886df62 (patch) | |
tree | bc342718f16a420041edd4ec2d6f6bd44d66912c | |
parent | edca4152560522a431a51fc0a06147fc680b5b18 (diff) |
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>
-rw-r--r-- | git-compat-util.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/git-compat-util.h b/git-compat-util.h index e955bb5e8b..bdc1f436b4 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -127,6 +127,9 @@ #else #include <poll.h> #endif + +extern int get_st_mode_bits(const char *path, int *mode); + #if defined(__MINGW32__) /* pull in Windows compatibility stuff */ #include "compat/mingw.h" @@ -163,7 +166,6 @@ typedef long intptr_t; typedef unsigned long uintptr_t; #endif -int get_st_mode_bits(const char *path, int *mode); #if defined(__CYGWIN__) #undef _XOPEN_SOURCE #include <grp.h> |