(Xbox 360) Buildfixes

This commit is contained in:
twinaphex 2017-10-16 01:33:17 +02:00
parent 1b1d5c468d
commit 8464ad30bd
5 changed files with 29 additions and 22 deletions

View File

@ -24,6 +24,10 @@
#include "../include/d3d8/d3dx8tex.h"
#endif
#ifdef _XBOX
#include <xgraphics.h>
#endif
bool d3d_swap(void *data, LPDIRECT3DDEVICE dev)
{
#if defined(_XBOX1)

View File

@ -14,7 +14,10 @@
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifdef _XBOX
#include <xtl.h>
#include <xgraphics.h>
#endif
#include <string/stdstring.h>

View File

@ -118,28 +118,27 @@ static bool path_stat(const char *path, enum stat_mode mode, int32_t *size)
struct _stat buf;
char *path_local;
wchar_t *path_wide;
DWORD file_info;
if (!path || !*path)
return false;
#if defined(_MSC_VER) && _MSC_VER < 1400
(void)path_wide;
(void)path_local;
(void)file_info;
#if defined(_MSC_VER) && _MSC_VER < 1400 || defined(_XBOX)
/* assume W-functions do not work below VC2005 */
path_local = utf8_to_local_string_alloc(path);
DWORD file_info = GetFileAttributes(path_local);
file_info = GetFileAttributes(path_local);
_stat(path_local, &buf);
if (path_local)
free(path_local);
#else
(void)path_local;
path_wide = utf8_to_utf16_string_alloc(path);
DWORD file_info = GetFileAttributesW(path_wide);
file_info = GetFileAttributesW(path_wide);
_wstat(path_wide, &buf);
@ -915,15 +914,17 @@ void fill_short_pathname_representation_noext(char* out_rep,
int path_file_remove(const char *path)
{
char *path_local;
wchar_t *path_wide;
char *path_local = NULL;
wchar_t *path_wide = NULL;
if (!path || !*path)
return false;
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_MSC_VER) && _MSC_VER < 1400
(void)path_local;
(void)path_wide;
#if defined(_WIN32) && !defined(_XBOX)
#if defined(_MSC_VER) && _MSC_VER < 1400
path_local = utf8_to_local_string_alloc(path);
if (path_local)
@ -934,8 +935,6 @@ int path_file_remove(const char *path)
return ret;
}
#else
(void)path_local;
path_wide = utf8_to_utf16_string_alloc(path);
if (path_wide)

View File

@ -70,7 +70,7 @@
struct RDIR
{
#if defined(_WIN32)
#if defined(_MSC_VER) && _MSC_VER < 1400
#if defined(_MSC_VER) && _MSC_VER < 1400 || defined(_XBOX)
WIN32_FIND_DATA entry;
#else
WIN32_FIND_DATAW entry;
@ -95,10 +95,10 @@ struct RDIR *retro_opendir(const char *name)
{
#if defined(_WIN32)
char path_buf[1024];
char *path_local = NULL;
char *path_local = NULL;
wchar_t *path_wide = NULL;
#endif
struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir));
struct RDIR *rdir = (struct RDIR*)calloc(1, sizeof(*rdir));
if (!rdir)
return NULL;
@ -106,10 +106,10 @@ struct RDIR *retro_opendir(const char *name)
#if defined(_WIN32)
path_buf[0] = '\0';
snprintf(path_buf, sizeof(path_buf), "%s\\*", name);
#if defined(_MSC_VER) && _MSC_VER < 1400
#if defined(_MSC_VER) && _MSC_VER < 1400 || defined(_XBOX)
(void)path_wide;
path_local = utf8_to_local_string_alloc(path_buf);
path_local = utf8_to_local_string_alloc(path_buf);
rdir->directory = FindFirstFile(path_local, &rdir->entry);
if (path_local)
@ -117,7 +117,7 @@ struct RDIR *retro_opendir(const char *name)
#else
(void)path_local;
path_wide = utf8_to_utf16_string_alloc(path_buf);
path_wide = utf8_to_utf16_string_alloc(path_buf);
rdir->directory = FindFirstFileW(path_wide, &rdir->entry);
if (path_wide)
@ -155,7 +155,7 @@ int retro_readdir(struct RDIR *rdir)
{
#if defined(_WIN32)
if(rdir->next)
#if defined(_MSC_VER) && _MSC_VER < 1400
#if defined(_MSC_VER) && _MSC_VER < 1400 || defined(_XBOX)
return (FindNextFile(rdir->directory, &rdir->entry) != 0);
#else
return (FindNextFileW(rdir->directory, &rdir->entry) != 0);
@ -177,7 +177,7 @@ int retro_readdir(struct RDIR *rdir)
const char *retro_dirent_get_name(struct RDIR *rdir)
{
#if defined(_WIN32)
#if defined(_MSC_VER) && _MSC_VER < 1400
#if defined(_MSC_VER) && _MSC_VER < 1400 || defined(_XBOX)
char *name_local = local_to_utf8_string_alloc(rdir->entry.cFileName);
memset(rdir->entry.cFileName, 0, sizeof(rdir->entry.cFileName));
strlcpy(rdir->entry.cFileName, name_local, sizeof(rdir->entry.cFileName));

View File

@ -2997,6 +2997,7 @@ static int menu_displaylist_parse_load_content_settings(
static int menu_displaylist_parse_horizontal_content_actions(
menu_displaylist_info_t *info)
{
bool content_loaded = false;
unsigned idx = rpl_entry_selection_ptr;
menu_handle_t *menu = NULL;
const char *label = NULL;
@ -3016,7 +3017,7 @@ static int menu_displaylist_parse_horizontal_content_actions(
playlist_get_index(playlist, idx,
&entry_path, &label, &core_path, &core_name, NULL, &db_name);
bool content_loaded = !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)
content_loaded = !rarch_ctl(RARCH_CTL_IS_DUMMY_CORE, NULL)
&& string_is_equal(menu->deferred_path, fullpath);
if (content_loaded)