File: unshare_unsupported_cgo.go

package info (click to toggle)
golang-github-containers-storage 1.24.8%2Bdfsg1-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,324 kB
  • sloc: sh: 812; ansic: 319; makefile: 175; awk: 12
file content (10 lines) | stat: -rw-r--r-- 365 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
// +build !linux,cgo

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"