File: unshare_unsupported_cgo.go

package info (click to toggle)
golang-github-containers-storage 1.43.0%2Bds1-8
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 3,820 kB
  • sloc: sh: 581; ansic: 388; makefile: 164; awk: 12
file content (11 lines) | stat: -rw-r--r-- 412 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
//go:build cgo && !(linux || freebsd)
// +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"