Skip to content

Commit

Permalink
[native] Add a DECLARE_INTERFACE define for !CONST_VTABLE.
Browse files Browse the repository at this point in the history
This helps avoid some compiler warnings on GCC in particular.
  • Loading branch information
flibitijibibo authored and misyltoad committed Jan 26, 2024
1 parent 7d9864c commit 2334bbc
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions include/native/windows/windows_base.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 2334bbc

Please sign in to comment.