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
4d249acd
Commit
4d249acd
authored
Dec 19, 2019
by
David Reid
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Try fixing some compilation errors when compiling with MinGW.
Public issue #114.
parent
3bee97a9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
10 deletions
+23
-10
miniaudio.h
miniaudio.h
+23
-10
No files found.
miniaudio.h
View file @
4d249acd
...
@@ -3342,8 +3342,11 @@ IMPLEMENTATION
...
@@ -3342,8 +3342,11 @@ IMPLEMENTATION
#include <limits.h> /* For INT_MAX */
#include <limits.h> /* For INT_MAX */
#include <math.h> /* sin(), etc. */
#include <math.h> /* sin(), etc. */
#if defined(MA_DEBUG_OUTPUT)
#if !defined(MA_NO_STDIO) || defined(MA_DEBUG_OUTPUT)
#include <stdio.h> /* for printf() for debug output */
#include <stdio.h>
#if !defined(_MSC_VER) && !defined(__DMC__)
#include <strings.h> /* For strcasecmp(). */
#include <wchar.h> /* For wcslen(), wcsrtombs() */
#endif
#endif
#ifdef MA_WIN32
#ifdef MA_WIN32
...
@@ -34862,13 +34865,6 @@ ma_result ma_decoder_init_memory_raw(const void* pData, size_t dataSize, const m
...
@@ -34862,13 +34865,6 @@ ma_result ma_decoder_init_memory_raw(const void* pData, size_t dataSize, const m
return ma_decoder_init_raw__internal(pConfigIn, &config, pDecoder);
return ma_decoder_init_raw__internal(pConfigIn, &config, pDecoder);
}
}
#ifndef MA_NO_STDIO
#include <stdio.h>
#if !defined(_MSC_VER) && !defined(__DMC__)
#include <strings.h> /* For strcasecmp(). */
#include <wchar.h> /* For wcsrtombs() */
#endif
const char* ma_path_file_name(const char* path)
const char* ma_path_file_name(const char* path)
{
{
const char* fileName;
const char* fileName;
...
@@ -35079,6 +35075,23 @@ ma_result ma_decoder__preinit_file(const char* pFilePath, const ma_decoder_confi
...
@@ -35079,6 +35075,23 @@ ma_result ma_decoder__preinit_file(const char* pFilePath, const ma_decoder_confi
return MA_SUCCESS;
return MA_SUCCESS;
}
}
/*
_wfopen() isn't always available in all compilation environments.
* Windows only.
* MSVC seems to support it universally as far back as VC6 from what I can tell (haven't checked further back).
* MinGW-64 (both 32- and 64-bit) seems to support it.
* MinGW wraps it in !defined(__STRICT_ANSI__).
This can be reviewed as compatibility issues arise. The preference is to use _wfopen_s() and _wfopen() as opposed to the wcsrtombs()
fallback, so if you notice your compiler not detecting this properly I'm happy to look at adding support.
*/
#if defined(_WIN32)
#if defined(_MSC_VER) || defined(__MINGW64__) || !defined(__STRICT_ANSI__)
#define MA_HAS_WFOPEN
#endif
#endif
ma_result ma_decoder__preinit_file_w(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder)
ma_result ma_decoder__preinit_file_w(const wchar_t* pFilePath, const ma_decoder_config* pConfig, ma_decoder* pDecoder)
{
{
FILE* pFile;
FILE* pFile;
...
@@ -35093,7 +35106,7 @@ ma_result ma_decoder__preinit_file_w(const wchar_t* pFilePath, const ma_decoder_
...
@@ -35093,7 +35106,7 @@ ma_result ma_decoder__preinit_file_w(const wchar_t* pFilePath, const ma_decoder_
return MA_INVALID_ARGS;
return MA_INVALID_ARGS;
}
}
#if defined(
_WIN32
)
#if defined(
MA_HAS_WFOPEN
)
/* Use _wfopen() on Windows. */
/* Use _wfopen() on Windows. */
#if defined(_MSC_VER) && _MSC_VER >= 1400
#if defined(_MSC_VER) && _MSC_VER >= 1400
if (_wfopen_s(&pFile, pFilePath, L"rb") != 0) {
if (_wfopen_s(&pFile, pFilePath, L"rb") != 0) {
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