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
This commit is contained in:
David Reid
2020-03-08 11:36:45 +10:00
parent a0fd38e020
commit a5ee74ed91
+17 -14
View File
@@ -5499,25 +5499,11 @@ IMPLEMENTATION
#ifdef MA_WIN32
#include <windows.h>
#include <objbase.h>
#include <mmreg.h>
#include <mmsystem.h>
#else
#include <stdlib.h> /* For malloc(), free(), wcstombs(). */
#include <string.h> /* For memset() */
#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
#include <emscripten/emscripten.h>
#endif
@@ -7446,6 +7432,23 @@ DEVICE I/O
*************************************************************************************************************************************************************
************************************************************************************************************************************************************/
#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
using runtime linking, deadlocks can occur (for me it happens when loading data from fread()). It turns out that doing