nilref_nil_darwin.go 689 B

123456789101112131415161718192021222324252627
  1. // Copyright 2018 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. // +build cgo,!arm,!arm64,!ios,!go1.10
  5. package x509
  6. /*
  7. #cgo CFLAGS: -mmacosx-version-min=10.6 -D__MAC_OS_X_VERSION_MAX_ALLOWED=1080
  8. #cgo LDFLAGS: -framework CoreFoundation -framework Security
  9. #include <CoreFoundation/CoreFoundation.h>
  10. */
  11. import "C"
  12. // For Go versions before 1.10, nil values for Apple's CoreFoundation
  13. // CF*Ref types were represented by nil. See:
  14. // https://github.com/golang/go/commit/b868616b63a8
  15. func setNilCFRef(v *C.CFDataRef) {
  16. *v = nil
  17. }
  18. func isNilCFRef(v C.CFDataRef) bool {
  19. return v == nil
  20. }