mirror of
https://github.com/git/git.git
synced 2026-03-13 18:33:25 +01:00
Move the definition of has_dos_drive_prefix to compat/mingw.c
This cannot easily be an inline function because it uses isalpha(), which is not yet declared when compat/mingw.c is parsed and so would give a compiler warning. Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
This commit is contained in:
@@ -192,6 +192,7 @@ sig_handler_t mingw_signal(int sig, sig_handler_t handler);
|
||||
* git specific compatibility
|
||||
*/
|
||||
|
||||
#define has_dos_drive_prefix(path) (isalpha(*(path)) && (path)[1] == ':')
|
||||
#define PATH_SEP ';'
|
||||
#define PRIuMAX "I64u"
|
||||
|
||||
|
||||
@@ -113,6 +113,10 @@
|
||||
#define PATH_SEP ':'
|
||||
#endif
|
||||
|
||||
#ifndef has_dos_drive_prefix
|
||||
#define has_dos_drive_prefix(path) 0
|
||||
#endif
|
||||
|
||||
#ifdef __GNUC__
|
||||
#define NORETURN __attribute__((__noreturn__))
|
||||
#else
|
||||
@@ -467,20 +471,4 @@ void git_qsort(void *base, size_t nmemb, size_t size,
|
||||
# define FORCE_DIR_SET_GID 0
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
|
||||
static inline int has_dos_drive_prefix(const char *path)
|
||||
{
|
||||
return isalpha(*path) && path[1] == ':';
|
||||
}
|
||||
|
||||
#else /* __MINGW32__ */
|
||||
|
||||
static inline int has_dos_drive_prefix(const char *path)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* __MINGW32__ */
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user