Port config package

This commit is contained in:
2026-01-31 21:04:19 -05:00
parent 5ae7b41d76
commit 4ea47594ae
3 changed files with 22 additions and 5 deletions
+16
View File
@@ -47,3 +47,19 @@ func FreeArray(items *C.PascalString, count C.int) {
}
C.free(unsafe.Pointer(items))
}
// safeStringDeref safely dereferences a string pointer, returning empty string if nil.
func safeStringDeref(s *string) string {
if s == nil {
return ""
}
return *s
}
// safeBoolDeref safely dereferences a bool pointer, returning false if nil.
func safeBoolDeref(b *bool) bool {
if b == nil {
return false
}
return *b
}