From 9388844acb6aeb33efcbc00354d7fd5d6c791f1d Mon Sep 17 00:00:00 2001 From: onyx-and-iris Date: Thu, 25 Jul 2024 22:14:06 +0100 Subject: [PATCH] add IS_64_BIT macro to interface.h --- include/interface.h | 2 ++ src/interface.c | 2 +- src/vmrcli.c | 6 +++--- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/interface.h b/include/interface.h index 44376f0..81873fd 100644 --- a/include/interface.h +++ b/include/interface.h @@ -10,6 +10,8 @@ #include "VoicemeeterRemote.h" +#define IS_64_BIT sizeof(void *) == 8 + PT_VMR create_interface(); #endif /* __IVMR_H__ */ \ No newline at end of file diff --git a/src/interface.c b/src/interface.c index 2f325f0..5b97678 100644 --- a/src/interface.c +++ b/src/interface.c @@ -81,7 +81,7 @@ static long initialize_dll_interfaces(PT_VMR vmr) return -100; } // 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); else strncat(dll_fullpath, DLL32_NAME, DLL_FULLPATH_SZ - strlen(DLL32_NAME) - 1); diff --git a/src/vmrcli.c b/src/vmrcli.c index f2ea80e..71cc50b 100644 --- a/src/vmrcli.c +++ b/src/vmrcli.c @@ -240,11 +240,11 @@ static void usage() static enum kind set_kind(char *kval) { if (strcmp(kval, "basic") == 0) - return sizeof(void *) == 8 ? BASICX64 : BASIC; + return IS_64_BIT ? BASICX64 : BASIC; else if (strcmp(kval, "banana") == 0) - return sizeof(void *) == 8 ? BANANAX64 : BANANA; + return IS_64_BIT ? BANANAX64 : BANANA; else if (strcmp(kval, "potato") == 0) - return sizeof(void *) == 8 ? POTATOX64 : POTATO; + return IS_64_BIT ? POTATOX64 : POTATO; else return UNKNOWN; }