Skip to content

Map GLintptr IDL type to Swift Int32 #42

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
May 12, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion Sources/WebAPIKit/Generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21238,7 +21238,6 @@ public typealias GLbyte = Int8
public typealias GLshort = Int16
public typealias GLint = Int32
public typealias GLsizei = Int32
public typealias GLintptr = Int64
public typealias GLsizeiptr = Int64
public typealias GLubyte = UInt8
public typealias GLushort = UInt16
Expand Down
3 changes: 2 additions & 1 deletion Sources/WebAPIKit/Support.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import JavaScriptKit
@_exported import ECMAScript
import JavaScriptKit

/* TODO: fix this */
public typealias __UNSUPPORTED_BIGINT__ = JSValue
Expand All @@ -22,3 +22,4 @@ public typealias HTMLOrSVGImageElement = HTMLImageElement
public typealias HTMLOrSVGScriptElement = HTMLScriptElement
public typealias BodyInit = XMLHttpRequestBodyInit
public typealias CustomElementConstructor = JSFunction
public typealias GLintptr = Int32
3 changes: 3 additions & 0 deletions Sources/WebIDLToSwift/MergeDeclarations.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ enum DeclarationMerger {
"CustomElementConstructor",
"ArrayBufferView",
"RotationMatrixType",
// Mapped to `Int32` manually. This can't be represented as `Int64` due to `BigInt` representation on JS side,
// but as a pointer it can't be represented as floating point number either.
"GLintptr",
]
static let validExposures: Set<String> = ["Window"]

Expand Down
1 change: 1 addition & 0 deletions Sources/WebIDLToSwift/WebIDL+SwiftRepresentation.swift
Original file line number Diff line number Diff line change
Expand Up @@ -541,6 +541,7 @@ extension IDLType: SwiftRepresentable {
"byte": "Int8",
"short": "Int16",
"long": "Int32",
// FIXME: this maps to BigInt when bridged to JS, which most probably leads to issues.
"long long": "Int64",
"Function": "JSFunction",
"bigint": "__UNSUPPORTED_BIGINT__",
Expand Down