forked from l-vitaly/cryptopro
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommon.go
More file actions
25 lines (22 loc) · 721 Bytes
/
common.go
File metadata and controls
25 lines (22 loc) · 721 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
package cryptopro
//#cgo linux CFLAGS: -I/opt/cprocsp/include/cpcsp/
//#cgo linux,386 darwin CFLAGS: -I/opt/cprocsp/include/cpcsp/
//#cgo linux,amd64 CFLAGS: -I/opt/cprocsp/include/cpcsp/
//#cgo 386 darwin LDFLAGS: -L/opt/cprocsp/lib/ -lcapi10 -lcapi20 -lrdrsup -lssp
//#cgo linux,amd64 LDFLAGS: -L/opt/cprocsp/lib/amd64 -lcapi10 -lcapi20 -lrdrsup -lssp
//#cgo linux,386 LDFLAGS: -L/opt/cprocsp/lib/ia32/ -lcapi10 -lcapi20 -lrdrsup -lssp
//#cgo windows LDFLAGS: -lcrypt32 -lpthread
//#include "common.h"
import "C"
import "unsafe"
func charPtr(s string) *C.CHAR {
if s != "" {
return (*C.CHAR)(unsafe.Pointer(C.CString(s)))
}
return nil
}
func freePtr(s *C.CHAR) {
if s != nil {
C.free(unsafe.Pointer(s))
}
}