| Summary: | music_wav.c SamplerChunk struct | ||
|---|---|---|---|
| Product: | SDL_mixer | Reporter: | Ozkan Sezer <sezeroz> |
| Component: | misc | Assignee: | Sam Lantinga <slouken> |
| Status: | RESOLVED FIXED | QA Contact: | Sam Lantinga <slouken> |
| Severity: | normal | ||
| Priority: | P2 | ||
| Version: | unspecified | ||
| Hardware: | All | ||
| OS: | All | ||
|
Description
Ozkan Sezer
2017-10-21 19:04:41 UTC
Fixed, thanks! https://hg.libsdl.org/SDL_mixer/rev/4bf887d61097 It seems Watcom supports arr[] or arr[1] but not arr[0]. I suggest changing it to [1]. Or, one can define something like SDL_FLEXARRAY in SDL_stdinc.h and use it in music_wav.c. Something like this maybe???? #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) #define SDL_FLEXARRAY #elif defined(__GNUC__) && (__GNUC__ < 3) #define SDL_FLEXARRAY 0 #elif defined(__WATCOMC__) #define SDL_FLEXARRAY #else #define SDL_FLEXARRAY 1 #endif Well, arr[1] is guaranteed to work with pretty much every compiler,
so I suggest simply doing that:
diff --git a/music_wav.c b/music_wav.c
--- a/music_wav.c
+++ b/music_wav.c
@@ -105,7 +105,7 @@
Uint32 SMTPE_offset;
Uint32 sample_loops;
Uint32 sampler_data;
- SampleLoop loops[0];
+ SampleLoop loops[1];
} SamplerChunk;
/*********************************************/
Reopening so this doesn't get lost. Fixed, thanks! https://hg.libsdl.org/SDL_mixer/rev/2b5e37881cba |