1
0
mirror of https://github.com/git/git.git synced 2024-09-25 09:51:00 +02:00

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>
This commit is contained in:
Ramsay Jones 2013-05-30 00:53:28 +01:00 committed by Junio C Hamano
parent edca415256
commit 2f0aaaf9da

View File

@ -127,6 +127,9 @@
#else #else
#include <poll.h> #include <poll.h>
#endif #endif
extern int get_st_mode_bits(const char *path, int *mode);
#if defined(__MINGW32__) #if defined(__MINGW32__)
/* pull in Windows compatibility stuff */ /* pull in Windows compatibility stuff */
#include "compat/mingw.h" #include "compat/mingw.h"
@ -163,7 +166,6 @@
typedef long intptr_t; typedef long intptr_t;
typedef unsigned long uintptr_t; typedef unsigned long uintptr_t;
#endif #endif
int get_st_mode_bits(const char *path, int *mode);
#if defined(__CYGWIN__) #if defined(__CYGWIN__)
#undef _XOPEN_SOURCE #undef _XOPEN_SOURCE
#include <grp.h> #include <grp.h>