]> Cypherpunks.ru repositories - gostls13.git/blob - misc/cgo/test/issue24161e0/main.go
4b139552e2c107be31872c39331ac6345ecd015b
[gostls13.git] / misc / cgo / test / issue24161e0 / main.go
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
5 //go:build darwin
6 // +build darwin
7
8 package issue24161e0
9
10 /*
11 #cgo CFLAGS: -x objective-c
12 #cgo LDFLAGS: -framework CoreFoundation -framework Security
13 #include <TargetConditionals.h>
14 #include <CoreFoundation/CoreFoundation.h>
15 #include <Security/Security.h>
16 #if TARGET_OS_IPHONE == 0 && __MAC_OS_X_VERSION_MAX_ALLOWED < 101200
17   typedef CFStringRef SecKeyAlgorithm;
18   static CFDataRef SecKeyCreateSignature(SecKeyRef key, SecKeyAlgorithm algorithm, CFDataRef dataToSign, CFErrorRef *error){return NULL;}
19   #define kSecKeyAlgorithmECDSASignatureDigestX962SHA1 foo()
20   static SecKeyAlgorithm foo(void){return NULL;}
21 #endif
22 */
23 import "C"
24 import "testing"
25
26 func f1() {
27         C.SecKeyCreateSignature(0, C.kSecKeyAlgorithmECDSASignatureDigestX962SHA1, 0, nil)
28 }
29
30 func Test(t *testing.T) {}