github.com/Seikaijyu/gio@v0.0.1/internal/cocoainit/cocoa_darwin.go (about)

     1  // SPDX-License-Identifier: Unlicense OR MIT
     2  
     3  // Package cocoainit initializes support for multithreaded
     4  // programs in Cocoa.
     5  package cocoainit
     6  
     7  /*
     8  #cgo CFLAGS: -xobjective-c -fobjc-arc
     9  #cgo LDFLAGS: -framework Foundation
    10  #import <Foundation/Foundation.h>
    11  
    12  static inline void activate_cocoa_multithreading() {
    13      [[NSThread new] start];
    14  }
    15  #pragma GCC visibility push(hidden)
    16  */
    17  import "C"
    18  
    19  func init() {
    20  	C.activate_cocoa_multithreading()
    21  }