Ticket #59808: patch-cmake-3-16-tiger.diff

File patch-cmake-3-16-tiger.diff, 3.2 KB (added by kencu (Ken), 5 years ago)

Ken's cmake 3.16.1 Tiger/Leopard patch

  • Source/cmMachO.h

    diff --git Source/cmMachO.h Source/cmMachO.h
    index 0c44b55..06c39db 100644
     
    77
    88#include <iosfwd>
    99#include <string>
     10#include <memory>
    1011
    1112#if !defined(CMAKE_USE_MACH_PARSER)
    1213#  error "This file may be included only if CMAKE_USE_MACH_PARSER is enabled."
  • Utilities/cmlibuv/src/unix/core.c

    diff --git Utilities/cmlibuv/src/unix/core.c Utilities/cmlibuv/src/unix/core.c
    index cf7dea0..b48ca73 100644
    skip: 
    525525 * will unwind the thread when it's in the cancel state. Work around that
    526526 * by making the system call directly. Musl libc is unaffected.
    527527 */
     528
     529#if defined(__GNUC__)
     530#define GCC_VERSION \
     531        (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
     532#endif
     533#if defined(__clang__) || (defined(GCC_VERSION) && (GCC_VERSION >= 40500))
     534/* gcc diagnostic pragmas available */
     535# define GCC_DIAGNOSTIC_AVAILABLE
     536#endif
     537
    528538int uv__close_nocancel(int fd) {
    529 #if defined(__APPLE__)
     539#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
     540
     541#if defined(GCC_DIAGNOSTIC_AVAILABLE)
    530542#pragma GCC diagnostic push
    531543#pragma GCC diagnostic ignored "-Wdollar-in-identifier-extension"
     544#endif
     545
    532546#if defined(__LP64__)
    533547  extern int close$NOCANCEL(int);
    534548  return close$NOCANCEL(fd);
    int uv__close_nocancel(int fd) { 
    536550  extern int close$NOCANCEL$UNIX2003(int);
    537551  return close$NOCANCEL$UNIX2003(fd);
    538552#endif
     553
     554#if defined(GCC_DIAGNOSTIC_AVAILABLE)
    539555#pragma GCC diagnostic pop
     556#endif
     557
    540558#elif defined(__linux__)
    541559  return syscall(SYS_close, fd);
    542560#else
    int uv_os_unsetenv(const char* name) { 
    13061324  if (name == NULL)
    13071325    return UV_EINVAL;
    13081326
     1327#if ( defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED < 1050)
     1328    unsetenv(name);
     1329#else
    13091330  if (unsetenv(name) != 0)
    13101331    return UV__ERR(errno);
     1332#endif
    13111333
    13121334  return 0;
    13131335}
  • Utilities/cmlibuv/src/unix/fs.c

    diff --git Utilities/cmlibuv/src/unix/fs.c Utilities/cmlibuv/src/unix/fs.c
    index 5fb34f1..7453980 100644
    static ssize_t uv__fs_sendfile(uv_fs_t* req) { 
    743743
    744744    return -1;
    745745  }
    746 #elif defined(__APPLE__)           || \
     746#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050 || \
    747747      defined(__DragonFly__)       || \
    748748      defined(__FreeBSD__)         || \
    749749      defined(__FreeBSD_kernel__)
    static void uv__to_stat(struct stat* src, uv_stat_t* dst) { 
    10551055  dst->st_blksize = src->st_blksize;
    10561056  dst->st_blocks = src->st_blocks;
    10571057
    1058 #if defined(__APPLE__)
     1058#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
    10591059  dst->st_atim.tv_sec = src->st_atimespec.tv_sec;
    10601060  dst->st_atim.tv_nsec = src->st_atimespec.tv_nsec;
    10611061  dst->st_mtim.tv_sec = src->st_mtimespec.tv_sec;
  • Utilities/cmlibuv/src/unix/tty.c

    diff --git Utilities/cmlibuv/src/unix/tty.c Utilities/cmlibuv/src/unix/tty.c
    index db479d6..5a7a86b 100644
    static int uv__tty_is_slave(const int fd) { 
    4444  int dummy;
    4545
    4646  result = ioctl(fd, TIOCGPTN, &dummy) != 0;
    47 #elif defined(__APPLE__)
     47#elif defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
    4848  char dummy[256];
    4949
    5050  result = ioctl(fd, TIOCPTYGNAME, &dummy) != 0;