Skip to content

Commit 88c03eb

Browse files
mackylegitster
authored andcommitted
git-compat-util: do not step on MAC_OS_X_VERSION_MIN_REQUIRED
MAC_OS_X_VERSION_MIN_REQUIRED may be defined by the builder to a specific version in order to produce compatible binaries for a particular system. Blindly defining it to MAC_OS_X_VERSION_10_6 is bad. Additionally MAC_OS_X_VERSION_10_6 will not be defined on older systems and should AvailabilityMacros.h be included on such as system an error will result. However, using the explicit value of 1060 (which is what MAC_OS_X_VERSION_10_6 is defined to) does not solve the problem. The changes that introduced stepping on MAC_OS_X_VERSION_MIN were made in b195aa0 (git-compat-util: suppress unavoidable Apple-specific deprecation warnings) to avoid deprecation warnings. Instead of blindly setting MAC_OS_X_VERSION_MIN to 1060 change the definition of DEPRECATED_ATTRIBUTE to empty to avoid the warnings. This preserves any MAC_OS_X_VERSION_MIN_REQUIRED setting while avoiding the warnings as intended by b195aa0. Signed-off-by: Kyle J. McKay <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b195aa0 commit 88c03eb

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

git-compat-util.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -211,12 +211,15 @@ extern char *gitbasename(char *);
211211
#endif
212212

213213
#ifndef NO_OPENSSL
214+
#ifdef __APPLE__
214215
#define __AVAILABILITY_MACROS_USES_AVAILABILITY 0
215-
#define MAC_OS_X_VERSION_MIN_REQUIRED MAC_OS_X_VERSION_10_6
216+
#include <AvailabilityMacros.h>
217+
#undef DEPRECATED_ATTRIBUTE
218+
#define DEPRECATED_ATTRIBUTE
219+
#undef __AVAILABILITY_MACROS_USES_AVAILABILITY
220+
#endif
216221
#include <openssl/ssl.h>
217222
#include <openssl/err.h>
218-
#undef MAC_OS_X_VERSION_MIN_REQUIRED
219-
#undef __AVAILABILITY_MACROS_USES_AVAILABILITY
220223
#endif
221224

222225
/* On most systems <netdb.h> would have given us this, but

0 commit comments

Comments
 (0)