Skip to content

Commit

Permalink
Reduce the number of visible fields, as Windows has a limit of 64k pu…
Browse files Browse the repository at this point in the history
…blic symbols and we were blowing those out
  • Loading branch information
migueldeicaza committed Oct 6, 2023
1 parent 743ad1a commit 95a8ab2
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Generator/Generator/MethodGen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -90,16 +90,17 @@ func methodGen (_ p: Printer, method: MethodDefinition, className: String, cdef:
let instanceOrStatic = method.isStatic || asSingleton ? " static" : ""
var inline = ""
if let methodHash = method.hash {
let staticVarVisibility = if bindName != "method_get_class" { "fileprivate " } else { "" }
assert (!method.isVirtual)
switch kind {
case .class:
p ("static var \(bindName): GDExtensionMethodBindPtr =", suffix: "()") {
p ("\(staticVarVisibility)static var \(bindName): GDExtensionMethodBindPtr =", suffix: "()") {
p ("let methodName = StringName (\"\(method.name)\")")

p ("return gi.classdb_get_method_bind (UnsafeRawPointer (&\(className).className.content), UnsafeRawPointer (&methodName.content), \(methodHash))!")
}
case .utility:
p ("static var \(bindName): GDExtensionPtrUtilityFunction =", suffix: "()") {
p ("\(staticVarVisibility)static var \(bindName): GDExtensionPtrUtilityFunction =", suffix: "()") {
p ("let methodName = StringName (\"\(method.name)\")")

p ("return gi.variant_get_ptr_utility_function (UnsafeRawPointer (&methodName.content), \(methodHash))!")
Expand Down

0 comments on commit 95a8ab2

Please sign in to comment.