File: unshare_unsupported_cgo.go

package info (click to toggle)
golang-github-containers-storage 1.57.2%2Bds1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,072 kB
  • sloc: sh: 637; ansic: 389; makefile: 143; awk: 12
file content (10 lines) | stat: -rw-r--r-- 382 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
//go:build cgo && !(linux || freebsd)

package unshare

// Go refuses to compile a subpackage with CGO_ENABLED=1 if there is a *.c file but no 'import "C"'.
// OTOH if we did have an 'import "C"', the Linux-only code would fail to compile.
// So, satisfy the Go compiler by using import "C" but #ifdef-ing out all of the code.

// #cgo CPPFLAGS: -DUNSHARE_NO_CODE_AT_ALL
import "C"