X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=19062534a1d8c8e46e77045cb9e67f437f619133;hb=a9bfe813094cf2c8ea0e30c3196070c868fb294c;hp=dcf41277502f5fb8fc99b310ebdaf63b6781b3ea;hpb=2fb9c421e156b40a40bf65479179f9fb9a63fb1e;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index dcf412775..19062534a 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -319,6 +319,7 @@ static inline int has_extension(const char *filename, const char *ext) } /* Sane ctype - no locale, and works with signed chars */ +#undef isascii #undef isspace #undef isdigit #undef isalpha @@ -332,6 +333,7 @@ extern unsigned char sane_ctype[256]; #define GIT_GLOB_SPECIAL 0x08 #define GIT_REGEX_SPECIAL 0x10 #define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 0) +#define isascii(x) (((x) & ~0x7f) == 0) #define isspace(x) sane_istest(x,GIT_SPACE) #define isdigit(x) sane_istest(x,GIT_DIGIT) #define isalpha(x) sane_istest(x,GIT_ALPHA) @@ -386,4 +388,18 @@ void git_qsort(void *base, size_t nmemb, size_t size, # define FORCE_DIR_SET_GID 0 #endif +#ifdef NO_NSEC +#undef USE_NSEC +#define ST_CTIME_NSEC(st) 0 +#define ST_MTIME_NSEC(st) 0 +#else +#ifdef USE_ST_TIMESPEC +#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctimespec.tv_nsec)) +#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtimespec.tv_nsec)) +#else +#define ST_CTIME_NSEC(st) ((unsigned int)((st).st_ctim.tv_nsec)) +#define ST_MTIME_NSEC(st) ((unsigned int)((st).st_mtim.tv_nsec)) +#endif +#endif + #endif