From bc89b98acb9032759cf2771b050c6e247243d789 Mon Sep 17 00:00:00 2001 From: Glenn Strauss Date: Thu, 6 Feb 2020 23:52:14 -0500 Subject: [PATCH] [build] fix build on MacOS X Tiger See: https://trac.macports.org/ticket/58550 fixes for Tiger build, but can be applied generally to all builds also requires legacysupport PortGroup for *at functions kencu@macports.org x-ref: https://trac.macports.org/ticket/58550 https://github.com/macports/macports-ports/pull/4760 --- src/base.h | 6 ++++++ src/mod_webdav.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/src/base.h b/src/base.h index 7c54eba9..dd5a37fe 100644 --- a/src/base.h +++ b/src/base.h @@ -5,6 +5,12 @@ #include #include +#if defined(__APPLE__) && defined(__MACH__) +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ < 1050 +#include +#endif +#endif + #include "base_decls.h" #include "buffer.h" #include "array.h" diff --git a/src/mod_webdav.c b/src/mod_webdav.c index 85828be0..554e20ff 100644 --- a/src/mod_webdav.c +++ b/src/mod_webdav.c @@ -2035,8 +2035,10 @@ webdav_prop_select_propnames (const plugin_config * const pconf, #if defined(__APPLE__) && defined(__MACH__) +#if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 #include /* fcopyfile() *//* OS X 10.5+ */ #endif +#endif #ifdef HAVE_ELFTC_COPYFILE/* __FreeBSD__ */ #include /* elftc_copyfile() */ #endif @@ -2068,12 +2070,14 @@ webdav_fcopyfile_sz (int ifd, int ofd, off_t isz) #endif #if defined(__APPLE__) && defined(__MACH__) + #if __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 1050 if (0 == fcopyfile(ifd, ofd, NULL, COPYFILE_ALL)) return 0; if (0 != lseek(ifd, 0, SEEK_SET)) return -1; if (0 != lseek(ofd, 0, SEEK_SET)) return -1; #endif + #endif #ifdef HAVE_ELFTC_COPYFILE /* __FreeBSD__ */ if (0 == elftc_copyfile(ifd, ofd))