Source file src/runtime/cgo/cgo.go

     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  /*
     6  Package cgo contains runtime support for code generated
     7  by the cgo tool.  See the documentation for the cgo command
     8  for details on using cgo.
     9  */
    10  package cgo
    11  
    12  /*
    13  
    14  #cgo darwin,!arm64 LDFLAGS: -lpthread
    15  #cgo dragonfly LDFLAGS: -lpthread
    16  #cgo freebsd LDFLAGS: -lpthread
    17  #cgo android LDFLAGS: -llog
    18  #cgo !android,linux LDFLAGS: -lpthread
    19  #cgo netbsd LDFLAGS: -lpthread
    20  #cgo openbsd LDFLAGS: -lpthread
    21  #cgo aix LDFLAGS: -Wl,-berok
    22  
    23  // Use -fno-stack-protector to avoid problems locating the
    24  // proper support functions. See issues #52919, #54313, #58385.
    25  // Use -Wdeclaration-after-statement because some CI builds use it.
    26  #cgo CFLAGS: -Wall -Werror -fno-stack-protector -Wdeclaration-after-statement
    27  
    28  // Use -std=gnu90 to maintain portability;
    29  // we don't use c90 because that doesn't permit C++ line comments,
    30  // which is just too painful.
    31  // We don't do it on windows-386 because it causes test failures.
    32  #cgo (!windows||!386) CFLAGS: -std=gnu90
    33  
    34  #cgo solaris CPPFLAGS: -D_POSIX_PTHREAD_SEMANTICS
    35  
    36  */
    37  import "C"
    38  
    39  import "internal/runtime/sys"
    40  
    41  // Incomplete is used specifically for the semantics of incomplete C types.
    42  type Incomplete struct {
    43  	_ sys.NotInHeap
    44  }
    45  

View as plain text