mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Get jar_mod and jar_xm compiling with MSVC.
This commit is contained in:
+6
-1
@@ -1524,7 +1524,12 @@ mulong jar_mod_load_file(jar_mod_context_t * modctx, const char* filename)
|
||||
modctx->modfile = 0;
|
||||
}
|
||||
|
||||
FILE *f = fopen(filename, "rb");
|
||||
FILE *f = NULL;
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
fopen_s(&f, filename, "rb");
|
||||
#else
|
||||
f = fopen(filename, "rb");
|
||||
#endif
|
||||
if(f)
|
||||
{
|
||||
fseek(f,0,SEEK_END);
|
||||
|
||||
+6
-1
@@ -1439,7 +1439,7 @@ static void jar_xm_volume_slide(jar_xm_channel_context_t* ch, uint8_t rawval) {
|
||||
}
|
||||
}
|
||||
|
||||
static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* restrict a, jar_xm_envelope_point_t* restrict b, uint16_t pos) {
|
||||
static float jar_xm_envelope_lerp(jar_xm_envelope_point_t* a, jar_xm_envelope_point_t* b, uint16_t pos) {
|
||||
/* Linear interpolation between two envelope points */
|
||||
if(pos <= a->frame) return a->value;
|
||||
else if(pos >= b->frame) return b->value;
|
||||
@@ -2606,7 +2606,12 @@ int jar_xm_create_context_from_file(jar_xm_context_t** ctx, uint32_t rate, const
|
||||
FILE* xmf;
|
||||
int size;
|
||||
|
||||
#if defined(_MSC_VER) && _MSC_VER >= 1500
|
||||
xmf = NULL;
|
||||
fopen_s(&xmf, filename, "rb");
|
||||
#else
|
||||
xmf = fopen(filename, "rb");
|
||||
#endif
|
||||
if(xmf == NULL) {
|
||||
DEBUG_ERR("Could not open input file");
|
||||
*ctx = NULL;
|
||||
|
||||
Reference in New Issue
Block a user