From 4b41ea60a0156c70c3057410b19d6a092b1886b5 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Sun, 25 Oct 2015 20:40:36 +0100 Subject: [PATCH] Fix CXX_BUILD --- gfx/video_shader_driver.h | 8 ++++++++ libretro-common/file/file_path.c | 7 +++++++ net_http_special.h | 8 -------- retroarch.c | 11 ++++------- 4 files changed, 19 insertions(+), 15 deletions(-) diff --git a/gfx/video_shader_driver.h b/gfx/video_shader_driver.h index 16e7e14275..cd7d4a0f04 100644 --- a/gfx/video_shader_driver.h +++ b/gfx/video_shader_driver.h @@ -25,6 +25,10 @@ #include "video_context_driver.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef struct shader_backend { bool (*init)(void *data, const char *path); @@ -110,4 +114,8 @@ const shader_backend_t *shader_ctx_init_first(void); struct video_shader *video_shader_driver_get_current_shader(void); +#ifdef __cplusplus +} +#endif + #endif diff --git a/libretro-common/file/file_path.c b/libretro-common/file/file_path.c index 28c9c114a4..c46a54b561 100644 --- a/libretro-common/file/file_path.c +++ b/libretro-common/file/file_path.c @@ -41,6 +41,9 @@ #include #include +#ifdef __cplusplus +extern "C" { +#endif /** * path_mkdir: @@ -640,3 +643,7 @@ void fill_short_pathname_representation(char* out_rep, else strlcpy(out_rep, path_short, size); } + +#ifdef __cplusplus +} +#endif diff --git a/net_http_special.h b/net_http_special.h index b4d1b164b9..c48e148a6c 100644 --- a/net_http_special.h +++ b/net_http_special.h @@ -18,14 +18,6 @@ #include "libretro.h" -#ifdef __cplusplus -extern "C" { -#endif - int net_http_get(const char **result, size_t *size, const char *url, retro_time_t *timeout); -#ifdef __cplusplus -} -#endif - #endif diff --git a/retroarch.c b/retroarch.c index 3b7cfff6f0..378badcb5b 100644 --- a/retroarch.c +++ b/retroarch.c @@ -1484,6 +1484,7 @@ void rarch_main_deinit(void) **/ void rarch_playlist_load_content(void *data, unsigned idx) { + unsigned i; const char *path = NULL; const char *core_path = NULL; char *path_check = NULL; @@ -1500,19 +1501,15 @@ void rarch_playlist_load_content(void *data, unsigned idx) idx, &path, NULL, &core_path, NULL, NULL, NULL); path_tolower = strdup(path); - for (int i = 0; i < strlen(path_tolower); ++i) - { + + for (i = 0; i < strlen(path_tolower); ++i) path_tolower[i] = tolower(path_tolower[i]); - } + if (strstr(path_tolower, ".zip")) - { strstr(path_tolower, ".zip")[4] = '\0'; - } else if (strstr(path_tolower, ".7z")) - { strstr(path_tolower, ".7z")[3] = '\0'; - } path_check = (char *)calloc(strlen(path_tolower) + 1, sizeof(char)); strncpy(path_check, path, strlen(path_tolower));