mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 01:04:02 +02:00
Fix C++ build for MSVC and DirectSound.
This commit is contained in:
@@ -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
|
|||||||
|
|
||||||
// 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
|
|||||||
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);
|
||||||
|
|||||||
Reference in New Issue
Block a user