mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-24 09:14:04 +02:00
Merge branch 'dev' into dev-0.12
This commit is contained in:
Vendored
+26
-11
@@ -3,6 +3,16 @@
|
|||||||
|
|
||||||
#include "fs.h"
|
#include "fs.h"
|
||||||
|
|
||||||
|
/* TODO: Remove this. To replicate errors, Just comment out this _XOPEN_SOURCE section and compile with `-std=c89` on GCC. */
|
||||||
|
/* This is for `-std=c89` compatibility. Without this there will be a few pthread related issues as well as some stdio functions being unavailable. They will need workarounds. */
|
||||||
|
#ifndef _XOPEN_SOURCE
|
||||||
|
#define _XOPEN_SOURCE 700
|
||||||
|
#else
|
||||||
|
#if _XOPEN_SOURCE < 500
|
||||||
|
#error _XOPEN_SOURCE must be >= 500. fs is not usable.
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
/* BEG fs_common_macros.c */
|
/* BEG fs_common_macros.c */
|
||||||
@@ -14,8 +24,12 @@
|
|||||||
/* BEG fs_va_copy.c */
|
/* BEG fs_va_copy.c */
|
||||||
#ifndef fs_va_copy
|
#ifndef fs_va_copy
|
||||||
#if !defined(_MSC_VER) || _MSC_VER >= 1800
|
#if !defined(_MSC_VER) || _MSC_VER >= 1800
|
||||||
#if (defined(__GNUC__) && __GNUC__ < 3)
|
#if !defined(__STDC_VERSION__) || (defined(__GNUC__) && __GNUC__ < 3) /* <-- va_copy() is not available when using `-std=c89`. The `!defined(__STDC_VERSION__)` parts is what checks for this. */
|
||||||
#define fs_va_copy(dst, src) ((dst) = (src)) /* This is untested. Not sure if this is correct for old GCC. */
|
#if defined(__va_copy)
|
||||||
|
#define fs_va_copy(dst, src) __va_copy(dst, src)
|
||||||
|
#else
|
||||||
|
#define fs_va_copy(dst, src) ((dst) = (src)) /* This is untested. Not sure if this is correct for old GCC. */
|
||||||
|
#endif
|
||||||
#else
|
#else
|
||||||
#define fs_va_copy(dst, src) va_copy((dst), (src))
|
#define fs_va_copy(dst, src) va_copy((dst), (src))
|
||||||
#endif
|
#endif
|
||||||
@@ -495,14 +509,6 @@ Parameter ordering is the same as c89thread to make amalgamation easier.
|
|||||||
#if defined(_WIN32) && !defined(FS_USE_PTHREAD)
|
#if defined(_WIN32) && !defined(FS_USE_PTHREAD)
|
||||||
/* Win32. Don't include windows.h here. */
|
/* Win32. Don't include windows.h here. */
|
||||||
#else
|
#else
|
||||||
#ifndef _XOPEN_SOURCE
|
|
||||||
#define _XOPEN_SOURCE 700
|
|
||||||
#else
|
|
||||||
#if _XOPEN_SOURCE < 500
|
|
||||||
#error _XOPEN_SOURCE must be >= 500. c89thread is not usable.
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <pthread.h>
|
#include <pthread.h>
|
||||||
typedef pthread_t fs_pthread;
|
typedef pthread_t fs_pthread;
|
||||||
typedef pthread_mutex_t fs_pthread_mutex;
|
typedef pthread_mutex_t fs_pthread_mutex;
|
||||||
@@ -7320,6 +7326,12 @@ logic in stb_sprintf() which we might be able to do via the amalgamator.
|
|||||||
#define FS_SPRINTF_NOUNALIGNED
|
#define FS_SPRINTF_NOUNALIGNED
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/* We'll get -Wlong-long warnings when forcing C89. Just force disable them. */
|
||||||
|
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wlong-long"
|
||||||
|
#endif
|
||||||
|
|
||||||
/* We need to disable the implicit-fallthrough warning on GCC. */
|
/* We need to disable the implicit-fallthrough warning on GCC. */
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 7 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))
|
#if defined(__GNUC__) && (__GNUC__ >= 7 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))
|
||||||
#pragma GCC diagnostic push
|
#pragma GCC diagnostic push
|
||||||
@@ -8982,7 +8994,10 @@ static fs_int32 fs_real_to_str(char const* *start, fs_uint32 *len, char* out, fs
|
|||||||
/* END stb_sprintf.c */
|
/* END stb_sprintf.c */
|
||||||
|
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 7 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))
|
#if defined(__GNUC__) && (__GNUC__ >= 7 || (__GNUC__ == 6 && __GNUC_MINOR__ >= 1))
|
||||||
#pragma GCC diagnostic pop
|
#pragma GCC diagnostic pop /* Fallthrough warnings. */
|
||||||
|
#endif
|
||||||
|
#if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6)))
|
||||||
|
#pragma GCC diagnostic pop /* -Wlong-long */
|
||||||
#endif
|
#endif
|
||||||
/* END fs_snprintf.c */
|
/* END fs_snprintf.c */
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
|
#include "../../external/fs/fs.c" /* <-- Must come first due to some (hopefully temporary) hacks to work around some `-std=c89` errors. */
|
||||||
#include "../../miniaudio.c"
|
#include "../../miniaudio.c"
|
||||||
#include "../../external/fs/fs.c"
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user