github.com/ebitengine/purego@v0.8.0-alpha.2.0.20240512170805-6cd12240d332/internal/fakecgo/iscgo.go (about)

     1  // Copyright 2010 The Go Authors. All rights reserved.
     2  // Use of this source code is governed by a BSD-style
     3  // license that can be found in the LICENSE file.
     4  
     5  //go:build !cgo && (darwin || freebsd || linux)
     6  
     7  // The runtime package contains an uninitialized definition
     8  // for runtime·iscgo. Override it to tell the runtime we're here.
     9  // There are various function pointers that should be set too,
    10  // but those depend on dynamic linker magic to get initialized
    11  // correctly, and sometimes they break. This variable is a
    12  // backup: it depends only on old C style static linking rules.
    13  
    14  package fakecgo
    15  
    16  import _ "unsafe" // for go:linkname
    17  
    18  //go:linkname _iscgo runtime.iscgo
    19  var _iscgo bool = true