Annotation of pkgsrc/lang/python39/patches/patch-Mac_Tools_pythonw.c, revision 1.1

1.1     ! sjmulder    1: $NetBSD$
        !             2: 
        !             3: Support for macOS 11 and Apple Silicon (ARM). Backported from:
        !             4: https://github.com/python/cpython/pull/22855
        !             5: 
        !             6: --- Mac/Tools/pythonw.c.orig   2020-10-05 15:07:58.000000000 +0000
        !             7: +++ Mac/Tools/pythonw.c
        !             8: @@ -95,9 +95,6 @@ setup_spawnattr(posix_spawnattr_t* spawn
        !             9:      size_t count;
        !            10:      cpu_type_t cpu_types[1];
        !            11:      short flags = 0;
        !            12: -#ifdef __LP64__
        !            13: -    int   ch;
        !            14: -#endif
        !            15:  
        !            16:      if ((errno = posix_spawnattr_init(spawnattr)) != 0) {
        !            17:          err(2, "posix_spawnattr_int");
        !            18: @@ -119,10 +116,16 @@ setup_spawnattr(posix_spawnattr_t* spawn
        !            19:  
        !            20:  #elif defined(__ppc__)
        !            21:      cpu_types[0] = CPU_TYPE_POWERPC;
        !            22: +
        !            23:  #elif defined(__i386__)
        !            24:      cpu_types[0] = CPU_TYPE_X86;
        !            25: +
        !            26: +#elif defined(__arm64__)
        !            27: +    cpu_types[0] = CPU_TYPE_ARM64;
        !            28: +
        !            29:  #else
        !            30:  #       error "Unknown CPU"
        !            31: +
        !            32:  #endif
        !            33:  
        !            34:      if (posix_spawnattr_setbinpref_np(spawnattr, count,
        !            35: @@ -220,7 +223,8 @@ main(int argc, char **argv) {
        !            36:      /* We're weak-linking to posix-spawnv to ensure that
        !            37:       * an executable build on 10.5 can work on 10.4.
        !            38:       */
        !            39: -    if (posix_spawn != NULL) {
        !            40: +
        !            41: +    if (&posix_spawn != NULL) {
        !            42:          posix_spawnattr_t spawnattr = NULL;
        !            43:  
        !            44:          setup_spawnattr(&spawnattr);

CVSweb <webmaster@jp.NetBSD.org>