add IS_64_BIT macro to interface.h

This commit is contained in:
onyx-and-iris 2024-07-25 22:14:06 +01:00
parent 955edb781c
commit 9388844acb
3 changed files with 6 additions and 4 deletions

View File

@ -10,6 +10,8 @@
#include "VoicemeeterRemote.h" #include "VoicemeeterRemote.h"
#define IS_64_BIT sizeof(void *) == 8
PT_VMR create_interface(); PT_VMR create_interface();
#endif /* __IVMR_H__ */ #endif /* __IVMR_H__ */

View File

@ -81,7 +81,7 @@ static long initialize_dll_interfaces(PT_VMR vmr)
return -100; return -100;
} }
// use right dll according to O/S type // use right dll according to O/S type
if (sizeof(void *) == 8) if (IS_64_BIT)
strncat(dll_fullpath, DLL64_NAME, DLL_FULLPATH_SZ - strlen(DLL64_NAME) - 1); strncat(dll_fullpath, DLL64_NAME, DLL_FULLPATH_SZ - strlen(DLL64_NAME) - 1);
else else
strncat(dll_fullpath, DLL32_NAME, DLL_FULLPATH_SZ - strlen(DLL32_NAME) - 1); strncat(dll_fullpath, DLL32_NAME, DLL_FULLPATH_SZ - strlen(DLL32_NAME) - 1);

View File

@ -240,11 +240,11 @@ static void usage()
static enum kind set_kind(char *kval) static enum kind set_kind(char *kval)
{ {
if (strcmp(kval, "basic") == 0) if (strcmp(kval, "basic") == 0)
return sizeof(void *) == 8 ? BASICX64 : BASIC; return IS_64_BIT ? BASICX64 : BASIC;
else if (strcmp(kval, "banana") == 0) else if (strcmp(kval, "banana") == 0)
return sizeof(void *) == 8 ? BANANAX64 : BANANA; return IS_64_BIT ? BANANAX64 : BANANA;
else if (strcmp(kval, "potato") == 0) else if (strcmp(kval, "potato") == 0)
return sizeof(void *) == 8 ? POTATOX64 : POTATO; return IS_64_BIT ? POTATOX64 : POTATO;
else else
return UNKNOWN; return UNKNOWN;
} }