Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
M
miniaudio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyCard
miniaudio
Commits
89f8cd70
Commit
89f8cd70
authored
Jul 03, 2018
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix some compilation errors on compilers without __has_include.
parent
4d954419
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
9 deletions
+20
-9
mini_al.h
mini_al.h
+20
-9
No files found.
mini_al.h
View file @
89f8cd70
...
...
@@ -357,6 +357,10 @@ extern "C" {
#endif
#endif
#if !defined(MAL_HAS_STDINT) && (defined(__GNUC__) || defined(__clang__)) // Assume support for stdint.h on GCC and Clang.
#define MAL_HAS_STDINT
#endif
#ifndef MAL_HAS_STDINT
typedef signed char mal_int8;
typedef unsigned char mal_uint8;
...
...
@@ -419,6 +423,13 @@ typedef mal_uint16 wchar_t;
#define NULL 0
#endif
#if defined(SIZE_MAX)
#define MAL_SIZE_MAX SIZE_MAX
#else
#define MAL_SIZE_MAX 0xFFFFFFFF /* When SIZE_MAX is not defined by the standard library just default to the maximum 32-bit unsigned integer. */
#endif
#ifdef _MSC_VER
#define MAL_INLINE __forceinline
#else
...
...
@@ -3581,8 +3592,8 @@ double mal_timer_get_time_in_seconds(mal_timer* pTimer)
struct timespec newTime;
clock_gettime(MAL_CLOCK_ID, &newTime);
uint64_t
newTimeCounter = (newTime.tv_sec * 1000000000) + newTime.tv_nsec;
uint64_t
oldTimeCounter = pTimer->counter;
mal_uint64
newTimeCounter = (newTime.tv_sec * 1000000000) + newTime.tv_nsec;
mal_uint64
oldTimeCounter = pTimer->counter;
return (newTimeCounter - oldTimeCounter) / 1000000000.0;
}
...
...
@@ -19168,13 +19179,13 @@ mal_bool32 mal_channel_map_contains_channel_position(mal_uint32 channels, const
void mal_copy_memory_64(void* dst, const void* src, mal_uint64 sizeInBytes)
{
#if 0xFFFFFFFFFFFFFFFF <= SIZE_MAX
#if 0xFFFFFFFFFFFFFFFF <=
MAL_
SIZE_MAX
mal_copy_memory(dst, src, (size_t)sizeInBytes);
#else
while (sizeInBytes > 0) {
mal_uint64 bytesToCopyNow = sizeInBytes;
if (bytesToCopyNow > SIZE_MAX) {
bytesToCopyNow = SIZE_MAX;
if (bytesToCopyNow >
MAL_
SIZE_MAX) {
bytesToCopyNow =
MAL_
SIZE_MAX;
}
mal_copy_memory(dst, src, (size_t)bytesToCopyNow); // Safe cast to size_t.
...
...
@@ -19188,13 +19199,13 @@ void mal_copy_memory_64(void* dst, const void* src, mal_uint64 sizeInBytes)
void mal_zero_memory_64(void* dst, mal_uint64 sizeInBytes)
{
#if 0xFFFFFFFFFFFFFFFF <= SIZE_MAX
#if 0xFFFFFFFFFFFFFFFF <=
MAL_
SIZE_MAX
mal_zero_memory(dst, (size_t)sizeInBytes);
#else
while (sizeInBytes > 0) {
mal_uint64 bytesToZeroNow = sizeInBytes;
if (bytesToZeroNow > SIZE_MAX) {
bytesToZeroNow = SIZE_MAX;
if (bytesToZeroNow >
MAL_
SIZE_MAX) {
bytesToZeroNow =
MAL_
SIZE_MAX;
}
mal_zero_memory(dst, (size_t)bytesToZeroNow); // Safe cast to size_t.
...
...
@@ -25617,7 +25628,7 @@ mal_result mal_decoder__full_decode_and_uninit(mal_decoder* pDecoder, mal_decode
newDataCapInFrames = 4096;
}
if ((newDataCapInFrames * bpf) > SIZE_MAX) {
if ((newDataCapInFrames * bpf) >
MAL_
SIZE_MAX) {
mal_free(pDataOut);
return MAL_TOO_LARGE;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment