Add ma_device_id_equal().

This commit is contained in:
David Reid
2024-08-06 12:07:55 +10:00
parent d726e85313
commit a611cf5f26
+20
View File
@@ -7020,6 +7020,8 @@ typedef union
int nullbackend; /* The null backend uses an integer for device IDs. */
} ma_device_id;
MA_API ma_bool32 ma_device_id_equal(const ma_device_id* pA, const ma_device_id* pB);
typedef struct ma_context_config ma_context_config;
typedef struct ma_device_config ma_device_config;
@@ -41416,6 +41418,24 @@ MA_API ma_result ma_device_job_thread_next(ma_device_job_thread* pJobThread, ma_
}
MA_API ma_bool32 ma_device_id_equal(const ma_device_id* pA, const ma_device_id* pB)
{
size_t i;
if (pA == NULL || pB == NULL) {
return MA_FALSE;
}
for (i = 0; i < sizeof(ma_device_id); i += 1) {
if (((const char*)pA)[i] != ((const char*)pB)[i]) {
return MA_FALSE;
}
}
return MA_TRUE;
}
MA_API ma_context_config ma_context_config_init(void)
{