(Android) C90 build fixes

This commit is contained in:
twinaphex 2014-11-12 14:32:08 +01:00
parent 7fde71b2ee
commit 4d5c7a05d1
2 changed files with 22 additions and 14 deletions

View File

@ -58,7 +58,7 @@ else
endif
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_LAKKA -DHAVE_GLUI -DHAVE_XMB
LOCAL_CFLAGS += -Wall -pthread -Wno-unused-function -fno-stack-protector -funroll-loops -DNDEBUG -DRARCH_MOBILE -DHAVE_GRIFFIN -DANDROID -DHAVE_DYNAMIC -DHAVE_OPENGL -DHAVE_FBO -DHAVE_OVERLAY -DHAVE_OPENGLES -DHAVE_OPENGLES2 -DGLSL_DEBUG -DHAVE_DYLIB -DHAVE_GLSL -DHAVE_MENU -DHAVE_RGUI -DHAVE_ZLIB -DINLINE=inline -DLSB_FIRST -DHAVE_THREADS -D__LIBRETRO__ -DHAVE_RSOUND -DHAVE_NETPLAY -DRARCH_INTERNAL -DHAVE_FILTERS_BUILTIN -DHAVE_LAKKA -DHAVE_GLUI -DHAVE_XMB -std=gnu99
LOCAL_CFLAGS += -DHAVE_7ZIP
LOCAL_CFLAGS += -O2

View File

@ -191,22 +191,30 @@ static const input_driver_t *input_drivers[] = {
// JM: This is a very painful function to write, especially because
// we'll have to do it to all the drivers.
const char* config_get_input_driver_options(void) {
const char* config_get_input_driver_options(void)
{
char *input_options;
int i;
int input_option_k = 0;
int input_options_len = 0;
while (input_drivers[input_option_k]) {
const char *opt = input_drivers[input_option_k]->ident;
input_options_len += strlen(opt) + 1;
input_option_k++;
unsigned offset = 0;
while (input_drivers[input_option_k])
{
const char *opt = input_drivers[input_option_k]->ident;
input_options_len += strlen(opt) + 1;
input_option_k++;
}
uint offset = 0;
char *input_options = (char*)calloc(input_options_len, sizeof(char));
for (int i = 0; i < input_option_k; i++) {
const char *opt = input_drivers[i]->ident;
strlcpy(input_options + offset, opt, input_options_len - offset);
offset += strlen(opt);
input_options[offset] = '|';
offset += 1;
input_options = (char*)calloc(input_options_len, sizeof(char));
for (i = 0; i < input_option_k; i++)
{
const char *opt = input_drivers[i]->ident;
strlcpy(input_options + offset, opt, input_options_len - offset);
offset += strlen(opt);
input_options[offset] = '|';
offset += 1;
}
input_options[input_options_len] = '\0';