(Xbox 1) Variadic macros workaround for VC 7.1

This commit is contained in:
TwinAphex51224 2012-06-24 22:47:51 +02:00
parent 31bab3015a
commit b5acc3863e
5 changed files with 104 additions and 10 deletions

View File

@ -21,7 +21,7 @@
#include "console/logger/logger.h"
#define RARCH_LOG(...) do { \
if (g_extern.verbose) logger_send("SSNES: " __VA_ARGS__); \
if (g_extern.verbose) logger_send("RetroArch: " __VA_ARGS__); \
} while(0)
#define RARCH_ERR(...) do { \
@ -36,7 +36,7 @@ extern FILE * log_fp;
#ifndef RARCH_LOG
#define RARCH_LOG(...) do { \
if (g_extern.verbose) \
fprintf(log_fp, "SSNES: " __VA_ARGS__); \
fprintf(log_fp, "RetroArch: " __VA_ARGS__); \
fflush(log_fp); \
} while (0)
#endif

View File

@ -501,8 +501,8 @@ extern struct console_settings g_console;
#endif
/////////
#if defined(RARCH_CONSOLE) && (defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER))
#include "logger_override.h"
#if defined(RARCH_CONSOLE) && (defined(HAVE_LOGGER) || defined(HAVE_FILE_LOGGER) || defined(_XBOX1))
#include <logger_override.h>
#else
#ifndef RARCH_LOG
@ -602,8 +602,10 @@ static inline void rarch_sleep(unsigned msec)
{
#ifdef __CELLOS_LV2__
sys_timer_usleep(1000 * msec);
#elif defined(_WIN32)
#elif defined(_WIN32) && !defined(_XBOX1)
Sleep(msec);
#elif defined(_XBOX1)
//stub
#elif defined(XENON)
udelay(1000 * msec);
#elif defined(GEKKO)

View File

@ -19,7 +19,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;"
PreprocessorDefinitions="_XBOX;_XBOX1;RARCH_CONSOLE;PACKAGE_VERSION=&quot;0.9.6&quot;"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
@ -65,7 +65,7 @@
Name="VCCLCompilerTool"
Optimization="3"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;"
PreprocessorDefinitions="_XBOX;_XBOX1;RARCH_CONSOLE;PACKAGE_VERSION=&quot;0.9.6&quot;"
StringPooling="TRUE"
BufferSecurityCheck="TRUE"
@ -114,7 +114,7 @@
Name="VCCLCompilerTool"
Optimization="3"
OmitFramePointers="TRUE"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;"
PreprocessorDefinitions="_XBOX;_XBOX1;RARCH_CONSOLE;PACKAGE_VERSION=&quot;0.9.6&quot;"
StringPooling="TRUE"
EnableFunctionLevelLinking="TRUE"
@ -155,7 +155,7 @@
ConfigurationType="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;"
PreprocessorDefinitions="_XBOX;_XBOX1;RARCH_CONSOLE;PACKAGE_VERSION=&quot;0.9.6&quot;"
UsePrecompiledHeader="0"/>
<Tool
@ -190,7 +190,7 @@
ConfigurationType="1">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;"
AdditionalIncludeDirectories="&quot;$(SolutionDir)\msvc-stdint&quot;;&quot;$(SolutionDir)\msvc-71&quot;"
PreprocessorDefinitions="_XBOX;_XBOX1;RARCH_CONSOLE;PACKAGE_VERSION=&quot;0.9.6&quot;"
UsePrecompiledHeader="0"/>
<Tool

View File

@ -0,0 +1,46 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MSVC_71_H
#define __MSVC_71_H
#include <stdarg.h>
static inline void RARCH_LOG(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
static inline void RARCH_WARN(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
static inline void RARCH_ERR(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
#endif

View File

@ -0,0 +1,46 @@
/* RetroArch - A frontend for libretro.
* Copyright (C) 2010-2012 - Hans-Kristian Arntzen
* Copyright (C) 2011-2012 - Daniel De Matteis
*
* RetroArch is free software: you can redistribute it and/or modify it under the terms
* of the GNU General Public License as published by the Free Software Found-
* ation, either version 3 of the License, or (at your option) any later version.
*
* RetroArch is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
* PURPOSE. See the GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License along with RetroArch.
* If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __MSVC_71_H
#define __MSVC_71_H
#include <stdargs.h>
static inline void RARCH_LOG(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
static inline void RARCH_WARN(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
static inline void RARCH_ERR(const char *msg, ...)
{
va_list ap;
va_start(ap, msg);
vfprintf(stderr, msg, ap);
va_end(ap);
}
#endif