Commit f630a015 authored by David Reid's avatar David Reid

Fix C++ build for MSVC and DirectSound.

parent 3c4e46bc
...@@ -494,7 +494,7 @@ mal_uint32 mal_get_sample_size_in_bytes(mal_format format); ...@@ -494,7 +494,7 @@ mal_uint32 mal_get_sample_size_in_bytes(mal_format format);
#ifdef MAL_WIN32 #ifdef MAL_WIN32
#define MAL_THREADCALL WINAPI #define MAL_THREADCALL WINAPI
typedef mal_uint32 mal_thread_result; typedef unsigned long mal_thread_result;
#else #else
#define MAL_THREADCALL #define MAL_THREADCALL
typedef void* mal_thread_result; typedef void* mal_thread_result;
...@@ -1182,7 +1182,7 @@ mal_result mal_device_init__dsound(mal_device* pDevice, mal_device_type type, ma ...@@ -1182,7 +1182,7 @@ mal_result mal_device_init__dsound(mal_device* pDevice, mal_device_type type, ma
// Unfortunately DirectSound uses different APIs and data structures for playback and catpure devices :( // Unfortunately DirectSound uses different APIs and data structures for playback and catpure devices :(
if (type == mal_device_type_playback) { if (type == mal_device_type_playback) {
mal_DirectSoundCreate8Proc pDirectSoundCreate8 = (mal_DirectSoundCreate8Proc)GetProcAddress(pDevice->dsound.hDSoundDLL, "DirectSoundCreate8"); mal_DirectSoundCreate8Proc pDirectSoundCreate8 = (mal_DirectSoundCreate8Proc)GetProcAddress((HMODULE)pDevice->dsound.hDSoundDLL, "DirectSoundCreate8");
if (pDirectSoundCreate8 == NULL) { if (pDirectSoundCreate8 == NULL) {
mal_device_uninit__dsound(pDevice); mal_device_uninit__dsound(pDevice);
return mal_post_error(pDevice, "[DirectSound] Could not find DirectSoundCreate8().", MAL_API_NOT_FOUND); return mal_post_error(pDevice, "[DirectSound] Could not find DirectSoundCreate8().", MAL_API_NOT_FOUND);
...@@ -1269,7 +1269,7 @@ mal_result mal_device_init__dsound(mal_device* pDevice, mal_device_type type, ma ...@@ -1269,7 +1269,7 @@ mal_result mal_device_init__dsound(mal_device* pDevice, mal_device_type type, ma
return mal_post_error(pDevice, "[DirectSound] IDirectSoundBuffer8_QueryInterface() failed for playback device's IDirectSoundNotify object.", MAL_DSOUND_FAILED_TO_QUERY_INTERFACE); return mal_post_error(pDevice, "[DirectSound] IDirectSoundBuffer8_QueryInterface() failed for playback device's IDirectSoundNotify object.", MAL_DSOUND_FAILED_TO_QUERY_INTERFACE);
} }
} else { } else {
mal_DirectSoundCaptureCreate8Proc pDirectSoundCaptureCreate8 = (mal_DirectSoundCaptureCreate8Proc)GetProcAddress(pDevice->dsound.hDSoundDLL, "DirectSoundCaptureCreate8"); mal_DirectSoundCaptureCreate8Proc pDirectSoundCaptureCreate8 = (mal_DirectSoundCaptureCreate8Proc)GetProcAddress((HMODULE)pDevice->dsound.hDSoundDLL, "DirectSoundCaptureCreate8");
if (pDirectSoundCaptureCreate8 == NULL) { if (pDirectSoundCaptureCreate8 == NULL) {
mal_device_uninit__dsound(pDevice); mal_device_uninit__dsound(pDevice);
return mal_post_error(pDevice, "[DirectSound] Could not find DirectSoundCreate8().", MAL_API_NOT_FOUND); return mal_post_error(pDevice, "[DirectSound] Could not find DirectSoundCreate8().", MAL_API_NOT_FOUND);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment