Skip to content

Commit

Permalink
An attempt to fix building, pt. 2
Browse files Browse the repository at this point in the history
  • Loading branch information
xaionaro committed Apr 17, 2021
1 parent 2c398e8 commit 871361b
Show file tree
Hide file tree
Showing 9 changed files with 8,037 additions and 18,744 deletions.
11 changes: 9 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
all:
all: generate hacks fmt

generate:
c-for-go --ccincl go-tpm2-tss.yaml
sed -e 's/Unsafe\.Pointer/UnsafePointer/' -i go_tpm2_tss/cgo_helpers.go

hacks:
sed -r -e 's/Unsafe\.Pointer/UnsafePointer/' -e 's/chandles C\.TSS2_TCTI_POLL_HANDLE/chandles *C.TSS2_TCTI_POLL_HANDLE/g' -i go_tpm2_tss/cgo_helpers.go
sed -r -e 's/TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9\(TSS2_TCTI_CONTEXT\* tctiContext, void\* handles, unsigned long int\* num_handles\)/TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9(TSS2_TCTI_CONTEXT* tctiContext, TSS2_TCTI_POLL_HANDLE* handles, unsigned long int* num_handles)/g' -i go_tpm2_tss/cgo_helpers.[ch]

fmt:
go fmt ./go_tpm2_tss/...
8 changes: 6 additions & 2 deletions go-tpm2-tss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,12 @@ TRANSLATOR:
ConstRules:
defines: eval
PtrTips:
function:
- {target: ".*", tips: [ref]}
struct:
- {target: ".*", tips: [arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr, arr]}
global:
- {target: ".*", tips: [ref, arr, arr, arr, arr]}
MemTips:
- {target: ".*", self: raw}
Rules:
global:
- {transform: lower}
Expand Down
6 changes: 5 additions & 1 deletion go_tpm2_tss/cgo_helpers.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// License: CC-0

// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 00:39:05 IST.
// WARNING: This file has automatically been generated on Sat, 17 Apr 2021 18:18:20 IST.
// Code generated by https://git.io/c-for-go. DO NOT EDIT.

#include "_cgo_export.h"
Expand All @@ -22,6 +22,10 @@ unsigned int TSS2_TCTI_CANCEL_FCN_900241eb(TSS2_TCTI_CONTEXT* tctiContext) {
return tss2TctiCancelFcn900241EB(tctiContext);
}

unsigned int TSS2_TCTI_GET_POLL_HANDLES_FCN_d9753da9(TSS2_TCTI_CONTEXT* tctiContext, TSS2_TCTI_POLL_HANDLE* handles, unsigned long int* num_handles) {
return tss2TctiGetPollHandlesFcnD9753DA9(tctiContext, handles, num_handles);
}

unsigned int TSS2_TCTI_SET_LOCALITY_FCN_47c1ecda(TSS2_TCTI_CONTEXT* tctiContext, unsigned char locality) {
return tss2TctiSetLocalityFcn47C1ECDA(tctiContext, locality);
}
Expand Down
Loading

0 comments on commit 871361b

Please sign in to comment.