From 4ba317444522e2f96667938deb258ea05124f61f Mon Sep 17 00:00:00 2001 From: Joshua Granick Date: Thu, 19 Mar 2015 12:45:33 -0700 Subject: [PATCH] Compile fix --- project/src/backend/sdl/SDLSystem.cpp | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/project/src/backend/sdl/SDLSystem.cpp b/project/src/backend/sdl/SDLSystem.cpp index 7039de34a..95cc8a65c 100644 --- a/project/src/backend/sdl/SDLSystem.cpp +++ b/project/src/backend/sdl/SDLSystem.cpp @@ -5,10 +5,18 @@ #endif #ifdef HX_WINDOWS -#include +#include #include //#include //#include +#ifdef __MINGW32__ +#ifndef CSIDL_MYDOCUMENTS +#define CSIDL_MYDOCUMENTS CSIDL_PERSONAL +#endif +#ifndef SHGFP_TYPE_CURRENT +#define SHGFP_TYPE_CURRENT 0 +#endif +#endif #endif #include @@ -49,7 +57,7 @@ namespace lime { char result[MAX_PATH] = ""; SHGetFolderPath (NULL, CSIDL_DESKTOPDIRECTORY, NULL, SHGFP_TYPE_CURRENT, result); - return &result; + return std::string (result).c_str (); #else @@ -74,7 +82,7 @@ namespace lime { char result[MAX_PATH] = ""; SHGetFolderPath (NULL, CSIDL_MYDOCUMENTS, NULL, SHGFP_TYPE_CURRENT, result); - return &result; + return std::string (result).c_str (); #else @@ -99,7 +107,7 @@ namespace lime { char result[MAX_PATH] = ""; SHGetFolderPath (NULL, CSIDL_PROFILE, NULL, SHGFP_TYPE_CURRENT, result); - return &result; + return std::string (result).c_str (); #else