macports-legacy-support

MacPorts support for missing functions in legacy macOS versions


License
MIT
Install
conda install -c conda-forge macports-legacy-support

Documentation

MacPorts Support for Legacy OSX Versions

Installs wrapper headers and library functions that add common functions missing in various older OSX releases to bring them approximately up to current expected standards.

Three different libraries are provided

  • libMacportsLegacySupport.a - A static library with the missing functions for the given OS.
  • libMacportsLegacySupport.dylib - A dynamic library with the missing functions for the given OS.
  • libMacportsLegacySystem.B.dylib - Similar to libMacportsLegacySupport.dylib but in addition re-exports the symbols from libSystem.B.dylib.

To use this library within MacPorts add the legacysupport PortGroup to the Portfile. This will add the required include paths and libraries to allow the library to do it's magic with most build systems.

Wrapped headers and replaced functions are:

Header File Feature Max Version Needing Feature
cmath Adds the same functions as those provided by the herein math.h, in namespace std::. see math.h
copyfile.h Wraps copyfile_state_get to support COPYFILE_STATE_COPIED OSX10.5
dirent.h Adds fdopendir function OSX10.9
math.h Adds declaration of various long long methods (OSX10.6) and __sincos (macOS10.8) OSX10.6(8), GCC 8
netdb.h Adds declaration of AI_NUMERICSERV OSX10.5
pthread.h Adds PTHREAD_RWLOCK_INITIALIZER OSX10.4
Adds pthread_setname_np function OSX10.5
stdio.h Adds dprintf, getline, and getdelim functions OSX10.6
stdlib.h Adds posix_memalign functional replacement, and wraps realpath to accept a NULL buffer argument OSX10.5
Adds arc4random_uniform and arc4random_buf functions OSX10.6
string.h Adds strnlen, strndup and memmem functions OSX10.6
strings.h Adds fls,flsl,ffsl(OSX10.4) and flsll,ffsll(macOS10.8) functions OSX10.4(8)
time.h Adds functions clock_gettime(macOS10.11) and timespec_get(macOS10.14). Defines TIME_UTC (macOS10.14). Declares asctime_r, ctime_r, gmtime_r, and localtime_r functions that are otherwise hidden in the presence of _ANSI_SOURCE, _POSIX_C_SOURCE, or _XOPEN_SOURCE (OSX10.4) OSX10.4(11,14)
wchar.h Adds wcsdup, wcsnlen, wcpcpy, wcpncpy, wcscasecmp, and wcsncasecmp functions OSX10.6
mach/machine.h Adds missing machine definitions OSX10.13
net/if.h Adds include sys/socket.h, expected on current macOS systems OSX10.8
xlocale/_wchar.h Adds wcscasecmp_l, wcsncasecmp_l functions OSX10.6
sys/aio.h Adjusts includes and defines to match SDK 10.5+ OSX10.4
sys/fcntl.h Adds missing O_CLOEXEC, AT_FDCWD, AT_EACCESS, AT_SYMLINK_NOFOLLOW, AT_SYMLINK_FOLLOW, and AT_REMOVEDIR definitions as required (?)
Adds openat function OSX10.9
sys/fsgetpath.h Adds missing utimensat, fsgetpath and setattrlistat functions OSX10.12
sys/mman.h Adds missing MAP_ANONYMOUS definition OSX10.10
sys/stdio.h Adds renameat function OSX10.9
sys/stat.h Adds fchmodat, fstatat, fstatat64 (if required, and on 10.5+), and mkdirat functions OSX10.9
Adds lchmod function OSX10.4
sys/random.h Adds getentropy function OSX10.11
sys/time.h Adds lutimes function OSX10.4
sys/types.h Adds definitions for u_char, u_short, u_int, u_long, ushort, and uint types that can be exposed via _DARWIN_C_SOURCE OSX10.4
sys/unistd.h Adds getattrlistat, readlinkat, faccessat, fchownat, linkat, symlinkat, and unlinkat functions OSX10.9
Wraps sysconf to support _SC_NPROCESSORS_CONF and _SC_NPROCESSORS_ONLN OSX10.4
Wraps sysconf to support _SC_PHYS_PAGES OSX10.10
uuid/uuid.h Adds typedef of uuid_string_t OSX10.5
CoreFoundation/CoreFoundation.h Adds CFPropertyListCreateWithStream function OSX10.5
OpenGL/gliDispatch.h Wraps gliDispatch.h to prevent including glext.h and thereby match behaviour of newer systems. OSX10.6
TargetConditionals.h Adds definitions for TARGET_CPU_ARM, TARGET_CPU_ARM64, TARGET_OS_SIMULATOR, TARGET_OS_IOS, TARGET_OS_TV, TARGET_OS_WATCH and TARGET_OS_OSX if needed. OSX10.10

For information on building this library outside MacPorts, see BUILDING.txt.