Commit a5ee74ed authored by David Reid's avatar David Reid

Rearrange some includes.

Some headers are only required for the device IO API. This commit moves
these headers to the device IO section that they're excluded when
MA_NO_DEVICE_IO is set.

Public issue https://github.com/dr-soft/miniaudio/issues/138
parent a0fd38e0
...@@ -5499,25 +5499,11 @@ IMPLEMENTATION ...@@ -5499,25 +5499,11 @@ IMPLEMENTATION
#ifdef MA_WIN32 #ifdef MA_WIN32
#include <windows.h> #include <windows.h>
#include <objbase.h>
#include <mmreg.h>
#include <mmsystem.h>
#else #else
#include <stdlib.h> /* For malloc(), free(), wcstombs(). */ #include <stdlib.h> /* For malloc(), free(), wcstombs(). */
#include <string.h> /* For memset() */ #include <string.h> /* For memset() */
#endif #endif
#if defined(MA_APPLE) && (__MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
#include <mach/mach_time.h> /* For mach_absolute_time() */
#endif
#ifdef MA_POSIX
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <dlfcn.h>
#endif
#ifdef MA_EMSCRIPTEN #ifdef MA_EMSCRIPTEN
#include <emscripten/emscripten.h> #include <emscripten/emscripten.h>
#endif #endif
...@@ -7446,6 +7432,23 @@ DEVICE I/O ...@@ -7446,6 +7432,23 @@ DEVICE I/O
************************************************************************************************************************************************************* *************************************************************************************************************************************************************
************************************************************************************************************************************************************/ ************************************************************************************************************************************************************/
#ifndef MA_NO_DEVICE_IO #ifndef MA_NO_DEVICE_IO
#ifdef MA_WIN32
#include <objbase.h>
#include <mmreg.h>
#include <mmsystem.h>
#endif
#if defined(MA_APPLE) && (__MAC_OS_X_VERSION_MIN_REQUIRED < 101200)
#include <mach/mach_time.h> /* For mach_absolute_time() */
#endif
#ifdef MA_POSIX
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
#include <dlfcn.h>
#endif
/* /*
Unfortunately using runtime linking for pthreads causes problems. This has occurred for me when testing on FreeBSD. When Unfortunately using runtime linking for pthreads causes problems. This has occurred for me when testing on FreeBSD. When
using runtime linking, deadlocks can occur (for me it happens when loading data from fread()). It turns out that doing using runtime linking, deadlocks can occur (for me it happens when loading data from fread()). It turns out that doing
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