Browse Source

sokol_app/gfx.h: fix _*_CLEAR_ARC_STRUCT macros for C++98 (fixes #685)

Andre Weissflog 3 years ago
parent
commit
fdd9a15ec2
2 changed files with 2 additions and 2 deletions
  1. 1 1
      sokol_app.h
  2. 1 1
      sokol_gfx.h

+ 1 - 1
sokol_app.h

@@ -2511,7 +2511,7 @@ typedef struct {
 #if defined(_SAPP_MACOS) || defined(_SAPP_IOS)
     // this is ARC compatible
     #if defined(__cplusplus)
-        #define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = { }; }
+        #define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = type(); }
     #else
         #define _SAPP_CLEAR_ARC_STRUCT(type, item) { item = (type) { 0 }; }
     #endif

+ 1 - 1
sokol_gfx.h

@@ -4278,7 +4278,7 @@ static _sg_state_t _sg;
 // a helper macro to clear a struct with potentially ARC'ed ObjC references
 #if defined(SOKOL_METAL)
     #if defined(__cplusplus)
-        #define _SG_CLEAR_ARC_STRUCT(type, item) { item = { }; }
+        #define _SG_CLEAR_ARC_STRUCT(type, item) { item = type(); }
     #else
         #define _SG_CLEAR_ARC_STRUCT(type, item) { item = (type) { 0 }; }
     #endif