[native] Add a DECLARE_INTERFACE define for !CONST_VTABLE.

This helps avoid some compiler warnings on GCC in particular.
This commit is contained in:
Ethan Lee 2023-12-12 09:51:38 -05:00 committed by Joshie
parent 7d9864c077
commit 2334bbccb0
1 changed files with 9 additions and 0 deletions

View File

@ -333,12 +333,21 @@ typedef struct RGNDATA {
#define DECLARE_INTERFACE(x) struct x
#define DECLARE_INTERFACE_(x, y) struct x : public y
#else
#ifdef CONST_VTABLE
#define DECLARE_INTERFACE(x) \
typedef interface x { \
const struct x##Vtbl *lpVtbl; \
} x; \
typedef const struct x##Vtbl x##Vtbl; \
const struct x##Vtbl
#else
#define DECLARE_INTERFACE(x) \
typedef interface x { \
struct x##Vtbl *lpVtbl; \
} x; \
typedef struct x##Vtbl x##Vtbl; \
struct x##Vtbl
#endif // CONST_VTABLE
#define DECLARE_INTERFACE_(x, y) DECLARE_INTERFACE(x)
#endif // __cplusplus