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
ff6592be
Commit
ff6592be
authored
Mar 18, 2023
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove the Windows-specific default memcpy(), malloc(), etc.
parent
ba58c9bf
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
48 deletions
+18
-48
CHANGES.md
CHANGES.md
+1
-0
miniaudio.h
miniaudio.h
+17
-48
No files found.
CHANGES.md
View file @
ff6592be
...
...
@@ -14,6 +14,7 @@ v0.11.12 - TBD
*
Optimizations to the high level API.
*
Remove the old runtime linking system for pthread. The
`MA_USE_RUNTIME_LINKING_FOR_PTHREAD`
option is no longer used.
*
WASAPI: Fix a crash when starting a device while it's in the process of rerouting.
*
Windows: Remove the Windows-specific default memcpy(), malloc(), etc.
v0.11.11 - 2022-11-04
...
...
miniaudio.h
View file @
ff6592be
...
...
@@ -12149,36 +12149,18 @@ Standard Library Stuff
******************************************************************************/
#ifndef MA_ASSERT
#ifdef MA_WIN32
#define MA_ASSERT(condition) assert(condition)
#else
#define MA_ASSERT(condition) assert(condition)
#endif
#endif
#ifndef MA_MALLOC
#ifdef MA_WIN32
#define MA_MALLOC(sz) HeapAlloc(GetProcessHeap(), 0, (sz))
#else
#define MA_MALLOC(sz) malloc((sz))
#endif
#endif
#ifndef MA_REALLOC
#ifdef MA_WIN32
#define MA_REALLOC(p, sz) (((sz) > 0) ? ((p) ? HeapReAlloc(GetProcessHeap(), 0, (p), (sz)) : HeapAlloc(GetProcessHeap(), 0, (sz))) : ((void*)(size_t)(HeapFree(GetProcessHeap(), 0, (p)) & 0)))
#else
#define MA_REALLOC(p, sz) realloc((p), (sz))
#endif
#endif
#ifndef MA_FREE
#ifdef MA_WIN32
#define MA_FREE(p) HeapFree(GetProcessHeap(), 0, (p))
#else
#define MA_FREE(p) free((p))
#endif
#endif
static MA_INLINE void ma_zero_memory_default(void* p, size_t sz)
{
...
...
@@ -12187,34 +12169,21 @@ static MA_INLINE void ma_zero_memory_default(void* p, size_t sz)
return;
}
#ifdef MA_WIN32
ZeroMemory(p, sz);
#else
if (sz > 0) {
memset(p, 0, sz);
}
#endif
}
#ifndef MA_ZERO_MEMORY
#define MA_ZERO_MEMORY(p, sz) ma_zero_memory_default((p), (sz))
#endif
#ifndef MA_COPY_MEMORY
#ifdef MA_WIN32
#define MA_COPY_MEMORY(dst, src, sz) CopyMemory((dst), (src), (sz))
#else
#define MA_COPY_MEMORY(dst, src, sz) memcpy((dst), (src), (sz))
#endif
#endif
#ifndef MA_MOVE_MEMORY
#ifdef MA_WIN32
#define MA_MOVE_MEMORY(dst, src, sz) MoveMemory((dst), (src), (sz))
#else
#define MA_MOVE_MEMORY(dst, src, sz) memmove((dst), (src), (sz))
#endif
#endif
#define MA_ZERO_OBJECT(p) MA_ZERO_MEMORY((p), sizeof(*(p)))
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