Skip to content

Commit 44e4a4c

Browse files
committed
scripts: Guard extension prototypes by default with an additional define.
1 parent 0b409b1 commit 44e4a4c

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
- issue.174.gh.OpenXR-SDK-Source
3+
- issue.1554.gl
4+
- issue.1338.gl
5+
---
6+
Hide prototypes for extension functions unless explicitly requested by defining `XR_EXTENSION_PROTOTYPES`. These functions are not exported from the loader, so having their prototypes available is confusing and leads to link errors, etc.

specification/scripts/genxr.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,8 @@ def makeGenOpts(args):
148148
protectFeature = False,
149149
protectProto = '#ifndef',
150150
protectProtoStr = 'XR_NO_PROTOTYPES',
151+
protectExtensionProto = '#ifdef',
152+
protectExtensionProtoStr = 'XR_EXTENSION_PROTOTYPES',
151153
apicall = 'XRAPI_ATTR ',
152154
apientry = 'XRAPI_CALL ',
153155
apientryp = 'XRAPI_PTR *',
@@ -177,6 +179,8 @@ def makeGenOpts(args):
177179
protectFeature = False,
178180
protectProto = '#ifndef',
179181
protectProtoStr = 'XR_NO_PROTOTYPES',
182+
protectExtensionProto = '#ifdef',
183+
protectExtensionProtoStr = 'XR_EXTENSION_PROTOTYPES',
180184
apicall = 'XRAPI_ATTR ',
181185
apientry = 'XRAPI_CALL ',
182186
apientryp = 'XRAPI_PTR *',

0 commit comments

Comments
 (0)