mirror of
https://github.com/encounter/SDL.git
synced 2025-12-09 05:27:48 +00:00
Fixed ISO C99 compatibility
SDL now builds with gcc 7.2 with the following command line options: -Wall -pedantic-errors -Wno-deprecated-declarations -Wno-overlength-strings --std=c99
This commit is contained in:
@@ -151,11 +151,11 @@ LoadLibSampleRate(void)
|
||||
return SDL_FALSE;
|
||||
}
|
||||
|
||||
SRC_src_new = (SRC_STATE* (*)(int converter_type, int channels, int *error))SDL_LoadFunction(SRC_lib, "src_new");
|
||||
SRC_src_process = (int (*)(SRC_STATE *state, SRC_DATA *data))SDL_LoadFunction(SRC_lib, "src_process");
|
||||
SRC_src_reset = (int(*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_reset");
|
||||
SRC_src_delete = (SRC_STATE* (*)(SRC_STATE *state))SDL_LoadFunction(SRC_lib, "src_delete");
|
||||
SRC_src_strerror = (const char* (*)(int error))SDL_LoadFunction(SRC_lib, "src_strerror");
|
||||
*(void **)&SRC_src_new = SDL_LoadFunction(SRC_lib, "src_new");
|
||||
*(void **)&SRC_src_process = SDL_LoadFunction(SRC_lib, "src_process");
|
||||
*(void **)&SRC_src_reset = SDL_LoadFunction(SRC_lib, "src_reset");
|
||||
*(void **)&SRC_src_delete = SDL_LoadFunction(SRC_lib, "src_delete");
|
||||
*(void **)&SRC_src_strerror = SDL_LoadFunction(SRC_lib, "src_strerror");
|
||||
|
||||
if (!SRC_src_new || !SRC_src_process || !SRC_src_reset || !SRC_src_delete || !SRC_src_strerror) {
|
||||
SDL_UnloadObject(SRC_lib);
|
||||
|
||||
@@ -74,7 +74,7 @@ DSOUND_Load(void)
|
||||
} else {
|
||||
/* Now make sure we have DirectX 8 or better... */
|
||||
#define DSOUNDLOAD(f) { \
|
||||
p##f = (fn##f) SDL_LoadFunction(DSoundDLL, #f); \
|
||||
*(void**)&p##f = SDL_LoadFunction(DSoundDLL, #f); \
|
||||
if (!p##f) loaded = 0; \
|
||||
}
|
||||
loaded = 1; /* will reset if necessary. */
|
||||
|
||||
@@ -256,8 +256,8 @@ WASAPI_PlatformInit(void)
|
||||
|
||||
libavrt = LoadLibraryW(L"avrt.dll"); /* this library is available in Vista and later. No WinXP, so have to LoadLibrary to use it for now! */
|
||||
if (libavrt) {
|
||||
pAvSetMmThreadCharacteristicsW = (pfnAvSetMmThreadCharacteristicsW) GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
|
||||
pAvRevertMmThreadCharacteristics = (pfnAvRevertMmThreadCharacteristics) GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
|
||||
*(void **)&pAvSetMmThreadCharacteristicsW = GetProcAddress(libavrt, "AvSetMmThreadCharacteristicsW");
|
||||
*(void **)&pAvRevertMmThreadCharacteristics = GetProcAddress(libavrt, "AvRevertMmThreadCharacteristics");
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user