Skip to content

Commit 5e8fadb

Browse files
committed
remove point_conversion_form_t special case
1 parent 77c19d3 commit 5e8fadb

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

cmd/mkcgo/generate.go

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,11 @@ package main
22

33
import (
44
"fmt"
5+
"go/token"
56
"io"
67
"slices"
78
"strconv"
89
"strings"
9-
"unicode"
10-
"unicode/utf8"
1110

1211
"github.com/golang-fips/openssl/v2/internal/mkcgo"
1312
)
@@ -655,8 +654,7 @@ func goSymName(name string) string {
655654
// Strip the 'go_' prefix commonly used in shims so Go symbols are nicer.
656655
name = strings.TrimPrefix(name, "go_")
657656

658-
ch, _ := utf8.DecodeRuneInString(name)
659-
isPrivate := !unicode.IsUpper(ch)
657+
isPrivate := !token.IsExported(name)
660658
if *private == isPrivate {
661659
// Same access level, no need to change.
662660
return name
@@ -811,8 +809,7 @@ func generateNocgoAliases(typedefs []*mkcgo.TypeDef, w io.Writer) {
811809
for _, typedef := range typedefs {
812810
// For basic types, make it an alias to the appropriate Go type
813811
goType, _ := cTypeToGo(typedef.Type, false)
814-
name := strings.TrimPrefix(typedef.Name, "_")
815-
name = strings.ToUpper(name[:1]) + name[1:]
812+
name := goSymName(typedef.Name)
816813
if goType != "" && goType != "unsafe.Pointer" {
817814
fmt.Fprintf(w, "type %s = %s\n", name, goType)
818815
seenTypes[name] = true

0 commit comments

Comments
 (0)