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:
Johannes Sixt
2008-03-13 13:10:54 +01:00
parent 70aa4faf57
commit 1881ab8876
2 changed files with 5 additions and 16 deletions

View File

@@ -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"

View File

@@ -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