@@ -683,34 +683,34 @@ func isOpenSSLErrorCheckFunction(fn *mkcgo.Func) bool {
683
683
// Most OpenSSL functions that return int follow the pattern:
684
684
// 1 = success, 0 = failure for boolean-style functions
685
685
// > 0 = success, <= 0 = failure for size/count functions
686
-
686
+
687
687
// Skip functions that don't return integers
688
688
goRetType , _ := cTypeToGo (fn .Ret , false )
689
689
if strings .HasPrefix (goRetType , "*" ) {
690
690
// Pointer return functions typically return NULL on failure
691
691
return true
692
692
}
693
-
693
+
694
694
// Check if it's an integer type that could be an error code
695
695
if goRetType == "int32" || goRetType == "int" || goRetType == "uint32" {
696
696
// Skip functions that are clearly not error-returning
697
697
name := fn .Name
698
-
698
+
699
699
// Functions that return version numbers, sizes, or other values should not be error-checked
700
- if strings .Contains (name , "version" ) ||
701
- strings .Contains (name , "size" ) ||
702
- strings .Contains (name , "get_bits" ) ||
703
- strings .Contains (name , "num_" ) ||
704
- strings .HasSuffix (name , "_id" ) ||
705
- strings .Contains (name , "nid2" ) ||
706
- name == "ERR_get_error_line" ||
707
- name == "ERR_get_error_all" {
700
+ if strings .Contains (name , "version" ) ||
701
+ strings .Contains (name , "size" ) ||
702
+ strings .Contains (name , "get_bits" ) ||
703
+ strings .Contains (name , "num_" ) ||
704
+ strings .HasSuffix (name , "_id" ) ||
705
+ strings .Contains (name , "nid2" ) ||
706
+ name == "ERR_get_error_line" ||
707
+ name == "ERR_get_error_all" {
708
708
return false
709
709
}
710
-
710
+
711
711
return true
712
712
}
713
-
713
+
714
714
return false
715
715
}
716
716
@@ -786,7 +786,7 @@ func needsAssembly(src *mkcgo.Source) bool {
786
786
func generateNocgoGo (src * mkcgo.Source , w io.Writer ) {
787
787
// Output header notice and package declaration.
788
788
printHeader (w )
789
- fmt .Fprintf (w , "//go:build !cgo && darwin \n \n " )
789
+ fmt .Fprintf (w , "//go:build !cgo\n \n " )
790
790
fmt .Fprintf (w , "package %s\n \n " , * packageName )
791
791
792
792
needsRuntime := false
0 commit comments