Skip to content

Commit 44a953a

Browse files
committed
add option to disable aliases
1 parent 523e0a5 commit 44a953a

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

gen/cheader.tmpl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,10 @@
2525
# define WGPU_EXPORT
2626
#endif // defined(WGPU_SHARED_LIBRARY)
2727

28+
#if !defined(WGPU_DISABLE_DEPRECATED_ALIASES)
29+
#define WGPU_DISABLE_DEPRECATED_ALIASES 0
30+
#endif
31+
2832
#if !defined(WGPU_OBJECT_ATTRIBUTE)
2933
#define WGPU_OBJECT_ATTRIBUTE
3034
#endif
@@ -111,6 +115,7 @@
111115
*
112116
* @{
113117
*/
118+
#if !WGPU_DISABLE_DEPRECATED_ALIASES
114119

115120
/** @deprecated alias for the new, more specific enum name. */
116121
#define WGPUFeatureName WGPUDeviceFeatureName
@@ -159,6 +164,7 @@
159164
/** @deprecated alias for the new, more specific struct init macro name. */
160165
#define WGPU_SUPPORTED_FEATURES_INIT WGPU_SUPPORTED_DEVICE_FEATURES_INIT
161166

167+
#endif // !WGPU_DISABLE_DEPRECATED_ALIASES
162168
/** @} */
163169

164170
{{ end -}}

tests/compile/main.inl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,4 +153,12 @@ int main(void) {
153153
{ WGPUVertexState x = WGPU_VERTEX_STATE_INIT; }
154154
{ WGPUFragmentState x = WGPU_FRAGMENT_STATE_INIT; }
155155
{ WGPURenderPipelineDescriptor x = WGPU_RENDER_PIPELINE_DESCRIPTOR_INIT; }
156+
157+
// Tests for deprecations
158+
{ WGPUFeatureName x = WGPUDeviceFeatureName_ShaderF16; }
159+
{ WGPUDeviceFeatureName x = WGPUFeatureName_ShaderF16; }
160+
{ WGPULimits x = WGPU_DEVICE_LIMITS_INIT; }
161+
{ WGPUDeviceLimits x = WGPU_LIMITS_INIT; }
162+
{ WGPUSupportedFeatures x = WGPU_SUPPORTED_DEVICE_FEATURES_INIT; }
163+
{ WGPUSupportedDeviceFeatures x = WGPU_SUPPORTED_FEATURES_INIT; }
156164
}

webgpu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@
4545
# define WGPU_EXPORT
4646
#endif // defined(WGPU_SHARED_LIBRARY)
4747

48+
#if !defined(WGPU_DISABLE_DEPRECATED_ALIASES)
49+
#define WGPU_DISABLE_DEPRECATED_ALIASES 0
50+
#endif
51+
4852
#if !defined(WGPU_OBJECT_ATTRIBUTE)
4953
#define WGPU_OBJECT_ATTRIBUTE
5054
#endif
@@ -164,6 +168,7 @@
164168
*
165169
* @{
166170
*/
171+
#if !WGPU_DISABLE_DEPRECATED_ALIASES
167172

168173
/** @deprecated alias for the new, more specific enum name. */
169174
#define WGPUFeatureName WGPUDeviceFeatureName
@@ -212,6 +217,7 @@
212217
/** @deprecated alias for the new, more specific struct init macro name. */
213218
#define WGPU_SUPPORTED_FEATURES_INIT WGPU_SUPPORTED_DEVICE_FEATURES_INIT
214219

220+
#endif // !WGPU_DISABLE_DEPRECATED_ALIASES
215221
/** @} */
216222

217223
/**

0 commit comments

Comments
 (0)