From: Junio C Hamano Date: Sun, 22 Feb 2015 20:28:30 +0000 (-0800) Subject: Merge branch 'es/squelch-openssl-warnings-on-macosx' X-Git-Tag: v2.4.0-rc0~97 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/744ea70c7acaa74249ede91d71de9535c1db1431?ds=inline;hp=-c Merge branch 'es/squelch-openssl-warnings-on-macosx' An earlier workaround to squelch unhelpful deprecation warnings from the complier on Mac OSX unnecessarily set minimum required version of the OS, which the user might want to raise (or lower) for other reasons. * es/squelch-openssl-warnings-on-macosx: git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED --- 744ea70c7acaa74249ede91d71de9535c1db1431 diff --combined git-compat-util.h index 68c07af9d4,46563326f0..3455c5ece6 --- a/git-compat-util.h +++ b/git-compat-util.h @@@ -75,8 -75,7 +75,8 @@@ # endif #elif !defined(__APPLE__) && !defined(__FreeBSD__) && !defined(__USLC__) && \ !defined(_M_UNIX) && !defined(__sgi) && !defined(__DragonFly__) && \ - !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) + !defined(__TANDEM) && !defined(__QNX__) && !defined(__MirBSD__) && \ + !defined(__CYGWIN__) #define _XOPEN_SOURCE 600 /* glibc2 and AIX 5.3L need 500, OpenBSD needs 600 for S_ISLNK() */ #define _XOPEN_SOURCE_EXTENDED 1 /* AIX 5.3L needs this */ #endif @@@ -212,15 -211,15 +212,18 @@@ extern char *gitbasename(char *) #endif #ifndef NO_OPENSSL + #ifdef __APPLE__ #define __AVAILABILITY_MACROS_USES_AVAILABILITY 0 - #define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6 + #include + #undef DEPRECATED_ATTRIBUTE + #define DEPRECATED_ATTRIBUTE + #undef __AVAILABILITY_MACROS_USES_AVAILABILITY + #endif #include #include - #undef MAC_OS_X_VERSION_MIN_REQUIRED - #undef __AVAILABILITY_MACROS_USES_AVAILABILITY +#ifdef NO_HMAC_CTX_CLEANUP +#define HMAC_CTX_cleanup HMAC_cleanup +#endif #endif /* On most systems would have given us this, but @@@ -482,40 -481,6 +485,40 @@@ extern int git_munmap(void *start, size #define on_disk_bytes(st) ((st).st_blocks * 512) #endif +#ifdef NEEDS_MODE_TRANSLATION +#undef S_IFMT +#undef S_IFREG +#undef S_IFDIR +#undef S_IFLNK +#undef S_IFBLK +#undef S_IFCHR +#undef S_IFIFO +#undef S_IFSOCK +#define S_IFMT 0170000 +#define S_IFREG 0100000 +#define S_IFDIR 0040000 +#define S_IFLNK 0120000 +#define S_IFBLK 0060000 +#define S_IFCHR 0020000 +#define S_IFIFO 0010000 +#define S_IFSOCK 0140000 +#ifdef stat +#undef stat +#endif +#define stat(path, buf) git_stat(path, buf) +extern int git_stat(const char *, struct stat *); +#ifdef fstat +#undef fstat +#endif +#define fstat(fd, buf) git_fstat(fd, buf) +extern int git_fstat(int, struct stat *); +#ifdef lstat +#undef lstat +#endif +#define lstat(path, buf) git_lstat(path, buf) +extern int git_lstat(const char *, struct stat *); +#endif + #define DEFAULT_PACKED_GIT_LIMIT \ ((1024L * 1024L) * (sizeof(void*) >= 8 ? 8192 : 256)) @@@ -678,11 -643,6 +681,11 @@@ extern char *xgetcwd(void) #define REALLOC_ARRAY(x, alloc) (x) = xrealloc((x), (alloc) * sizeof(*(x))) +static inline char *xstrdup_or_null(const char *str) +{ + return str ? xstrdup(str) : NULL; +} + static inline size_t xsize_t(off_t len) { if (len > (size_t) len) @@@ -875,8 -835,4 +878,8 @@@ struct tm *git_gmtime_r(const time_t * #define gmtime_r git_gmtime_r #endif +#if !defined(USE_PARENS_AROUND_GETTEXT_N) && defined(__GNUC__) +#define USE_PARENS_AROUND_GETTEXT_N 1 +#endif + #endif