X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-compat-util.h;h=db2836fbdee6c1e069e6f5955031087d778cddf5;hb=fdfb4cfadcfdfe4ebafd0545b5ebb661433ea66c;hp=cf89cdf4598b3796724a85aa707f740245155cdc;hpb=65360346309a550185363ef5b846a1202175a4e6;p=git.git diff --git a/git-compat-util.h b/git-compat-util.h index cf89cdf45..db2836fbd 100644 --- a/git-compat-util.h +++ b/git-compat-util.h @@ -99,6 +99,11 @@ #include #endif +#ifndef NO_OPENSSL +#include +#include +#endif + /* On most systems would have given us this, but * not on some systems (e.g. GNU/Hurd). */ @@ -192,6 +197,12 @@ extern int git_munmap(void *start, size_t length); #endif /* NO_MMAP */ +#ifdef NO_ST_BLOCKS_IN_STRUCT_STAT +#define on_disk_bytes(st) ((st).st_size) +#else +#define on_disk_bytes(st) ((st).st_blocks * 512) +#endif + #define DEFAULT_PACKED_GIT_LIMIT \ ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256)) @@ -318,11 +329,13 @@ extern unsigned char sane_ctype[256]; #define GIT_SPACE 0x01 #define GIT_DIGIT 0x02 #define GIT_ALPHA 0x04 +#define GIT_SPECIAL 0x08 #define sane_istest(x,mask) ((sane_ctype[(unsigned char)(x)] & (mask)) != 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) #define isalnum(x) sane_istest(x,GIT_ALPHA | GIT_DIGIT) +#define isspecial(x) sane_istest(x,GIT_SPECIAL) #define tolower(x) sane_case((unsigned char)(x), 0x20) #define toupper(x) sane_case((unsigned char)(x), 0)