add pragma macros,

silences -Wcast-function-type
This commit is contained in:
onyx-and-iris 2024-07-09 15:57:38 +01:00
parent af98dead75
commit 39540e9c3e
2 changed files with 12 additions and 1 deletions

View File

@ -33,6 +33,6 @@ $(BIN_DIR) $(OBJ_DIR):
pwsh -Command New-Item -Path $@ -ItemType Directory pwsh -Command New-Item -Path $@ -ItemType Directory
clean: clean:
pwsh -Command Remove-Item -Recurse $(EXE), $(OBJ_DIR) pwsh -Command Remove-Item -Recurse $(EXE), $(OBJ_DIR) -force
-include $(OBJ:.o=.d) -include $(OBJ:.o=.d)

View File

@ -20,6 +20,13 @@
#include "util.h" #include "util.h"
#include "log.h" #include "log.h"
#define PRAGMA_IgnoreWCastIncompatibleFuncTypes \
_Pragma("GCC diagnostic push") \
_Pragma("GCC diagnostic ignored \"-Wcast-function-type\"")
#define PRAGMA_Pop \
_Pragma("GCC diagnostic pop")
static T_VBVMR_INTERFACE iVMR; static T_VBVMR_INTERFACE iVMR;
static long initialize_dll_interfaces(PT_VMR vmr); static long initialize_dll_interfaces(PT_VMR vmr);
@ -79,6 +86,8 @@ static long initialize_dll_interfaces(PT_VMR vmr)
if (G_H_Module == NULL) if (G_H_Module == NULL)
return -101; return -101;
PRAGMA_IgnoreWCastIncompatibleFuncTypes;
// Get function pointers // Get function pointers
vmr->VBVMR_Login = (T_VBVMR_Login)GetProcAddress(G_H_Module, "VBVMR_Login"); vmr->VBVMR_Login = (T_VBVMR_Login)GetProcAddress(G_H_Module, "VBVMR_Login");
vmr->VBVMR_Logout = (T_VBVMR_Logout)GetProcAddress(G_H_Module, "VBVMR_Logout"); vmr->VBVMR_Logout = (T_VBVMR_Logout)GetProcAddress(G_H_Module, "VBVMR_Logout");
@ -110,6 +119,8 @@ static long initialize_dll_interfaces(PT_VMR vmr)
vmr->VBVMR_MacroButton_GetStatus = (T_VBVMR_MacroButton_GetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_GetStatus"); vmr->VBVMR_MacroButton_GetStatus = (T_VBVMR_MacroButton_GetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_GetStatus");
vmr->VBVMR_MacroButton_SetStatus = (T_VBVMR_MacroButton_SetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_SetStatus"); vmr->VBVMR_MacroButton_SetStatus = (T_VBVMR_MacroButton_SetStatus)GetProcAddress(G_H_Module, "VBVMR_MacroButton_SetStatus");
PRAGMA_Pop;
// check pointers are valid // check pointers are valid
if (vmr->VBVMR_Login == NULL) if (vmr->VBVMR_Login == NULL)
return -1; return -1;