Annotation of pkgsrc/lang/python310/patches/patch-Modules_posixmodule.c, revision 1.1

1.1     ! nia         1: $NetBSD$
        !             2: 
        !             3: posix.copyfile does not exist on Tiger. 
        !             4: 
        !             5: Python 3.8's posix._fcopyfile implementation unconditionally uses <copyfile.h>, 
        !             6: which only exists on Leopard ane newer. This patch removes posix._fcopyfile 
        !             7: on Tiger - this is okay because the rest of the stdlib uses posix._fcopyfile 
        !             8: only conditionally after checking that the function exists 
        !             9: (non-Apple systems don't have posix._fcopyfile either).
        !            10: 
        !            11: 
        !            12: thanks to @dgelessus
        !            13: https://github.com/macports/macports-ports/pull/5987
        !            14: 
        !            15: --- Modules/posixmodule.c.orig 2023-08-24 12:46:25.000000000 +0000
        !            16: +++ Modules/posixmodule.c
        !            17: @@ -66,6 +66,8 @@
        !            18:   */
        !            19:  #if defined(__APPLE__)
        !            20:  
        !            21: +#include <AvailabilityMacros.h>
        !            22: +
        !            23:  #if defined(__has_builtin)
        !            24:  #if __has_builtin(__builtin_available)
        !            25:  #define HAVE_BUILTIN_AVAILABLE 1
        !            26: @@ -238,7 +240,7 @@ corresponding Unix manual entries for mo
        !            27:  #  include <sys/sendfile.h>
        !            28:  #endif
        !            29:  
        !            30: -#if defined(__APPLE__)
        !            31: +#if defined(__APPLE__) && MAC_OS_X_VERSION_MAX_ALLOWED >= 1050
        !            32:  #  include <copyfile.h>
        !            33:  #endif
        !            34:  
        !            35: @@ -9997,7 +9999,7 @@ done:
        !            36:  #endif /* HAVE_SENDFILE */
        !            37:  
        !            38:  
        !            39: -#if defined(__APPLE__)
        !            40: +#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
        !            41:  /*[clinic input]
        !            42:  os._fcopyfile
        !            43:  
        !            44: @@ -15440,7 +15442,7 @@ all_ins(PyObject *m)
        !            45:  #endif
        !            46:  #endif  /* HAVE_EVENTFD && EFD_CLOEXEC */
        !            47:  
        !            48: -#if defined(__APPLE__)
        !            49: +#if defined(__APPLE__) && MAC_OS_X_VERSION_MIN_REQUIRED >= 1050
        !            50:      if (PyModule_AddIntConstant(m, "_COPYFILE_DATA", COPYFILE_DATA)) return -1;
        !            51:  #endif
        !            52:  

CVSweb <webmaster@jp.NetBSD.org>