main.go 918 B

1234567891011121314151617181920212223242526272829
  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 darwin
  5. package issue24161e0
  6. /*
  7. #cgo CFLAGS: -x objective-c
  8. #cgo LDFLAGS: -framework CoreFoundation -framework Security
  9. #include <TargetConditionals.h>
  10. #include <CoreFoundation/CoreFoundation.h>
  11. #include <Security/Security.h>
  12. #if TARGET_OS_IPHONE == 0 && __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
  13. typedef CFStringRef SecKeyAlgorithm;
  14. static CFDataRef SecKeyCreateSignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef dataToSign, CFErrorRef *error){return NULL;}
  15. #define kSecKeyAlgorithmECDSASignatureDigestX962SHA1 foo()
  16. static SecKeyAlgorithm foo(void){return NULL;}
  17. #endif
  18. */
  19. import "C"
  20. import "testing"
  21. func f1() {
  22. C.SecKeyCreateSignature(0, C.kSecKeyAlgorithmECDSASignatureDigestX962SHA1, 0, nil)
  23. }
  24. func Test(t *testing.T) {}