Commit aa75d5f8 authored by David Reid's avatar David Reid

Don't include pthread.h if threading is disabled.

parent 0ac5c891
...@@ -3874,22 +3874,24 @@ typedef ma_uint16 wchar_t; ...@@ -3874,22 +3874,24 @@ typedef ma_uint16 wchar_t;
#if !defined(_WIN32) /* If it's not Win32, assume POSIX. */ #if !defined(_WIN32) /* If it's not Win32, assume POSIX. */
#define MA_POSIX #define MA_POSIX
/* #if !defined(MA_NO_THREADING)
Use the MA_NO_PTHREAD_IN_HEADER option at your own risk. This is intentionally undocumented. /*
You can use this to avoid including pthread.h in the header section. The downside is that it Use the MA_NO_PTHREAD_IN_HEADER option at your own risk. This is intentionally undocumented.
results in some fixed sized structures being declared for the various types that are used in You can use this to avoid including pthread.h in the header section. The downside is that it
miniaudio. The risk here is that these types might be too small for a given platform. This results in some fixed sized structures being declared for the various types that are used in
risk is yours to take and no support will be offered if you enable this option. miniaudio. The risk here is that these types might be too small for a given platform. This
*/ risk is yours to take and no support will be offered if you enable this option.
#ifndef MA_NO_PTHREAD_IN_HEADER */
#include <pthread.h> /* Unfortunate #include, but needed for pthread_t, pthread_mutex_t and pthread_cond_t types. */ #ifndef MA_NO_PTHREAD_IN_HEADER
typedef pthread_t ma_pthread_t; #include <pthread.h> /* Unfortunate #include, but needed for pthread_t, pthread_mutex_t and pthread_cond_t types. */
typedef pthread_mutex_t ma_pthread_mutex_t; typedef pthread_t ma_pthread_t;
typedef pthread_cond_t ma_pthread_cond_t; typedef pthread_mutex_t ma_pthread_mutex_t;
#else typedef pthread_cond_t ma_pthread_cond_t;
typedef ma_uintptr ma_pthread_t; #else
typedef union ma_pthread_mutex_t { char __data[40]; ma_uint64 __alignment; } ma_pthread_mutex_t; typedef ma_uintptr ma_pthread_t;
typedef union ma_pthread_cond_t { char __data[48]; ma_uint64 __alignment; } ma_pthread_cond_t; typedef union ma_pthread_mutex_t { char __data[40]; ma_uint64 __alignment; } ma_pthread_mutex_t;
typedef union ma_pthread_cond_t { char __data[48]; ma_uint64 __alignment; } ma_pthread_cond_t;
#endif
#endif #endif
#if defined(__unix__) #if defined(__unix__)
...@@ -11547,14 +11549,14 @@ IMPLEMENTATION ...@@ -11547,14 +11549,14 @@ IMPLEMENTATION
#endif #endif
#if !defined(MA_WIN32) #if !defined(MA_WIN32)
#include <sched.h> #if !defined(MA_NO_THREADING)
#include <sys/time.h> /* select() (used for ma_sleep()). */ #include <sched.h>
#include <unistd.h> #include <pthread.h> /* For pthreads. */
#include <pthread.h> #endif
#endif
#ifdef MA_NX #include <sys/time.h> /* select() (used for ma_sleep()). */
#include <time.h> /* For nanosleep() */ #include <time.h> /* For nanosleep() */
#include <unistd.h>
#endif #endif
#include <sys/stat.h> /* For fstat(), etc. */ #include <sys/stat.h> /* For fstat(), etc. */
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