Add some RARCH_INTERNAL checks to resampler code to make it

easier to export outside
This commit is contained in:
twinaphex 2014-09-23 07:06:05 +02:00
parent 55154b6e53
commit 75bc44fc8e
4 changed files with 15 additions and 1 deletions

View File

@ -25,6 +25,7 @@
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
#include "../../general.h"
#else
/* FIXME - variadic macros not supported for MSVC 2003 */
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
#endif

View File

@ -9,6 +9,7 @@
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
#include "../../general.h"
#else
/* FIXME - variadic macros not supported for MSVC 2003 */
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)
#endif

View File

@ -22,6 +22,10 @@
#include "../../general.h"
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
#include "../../general.h"
#endif
static const rarch_resampler_t *resampler_drivers[] = {
&sinc_resampler,
#ifdef HAVE_CC_RESAMPLER
@ -50,6 +54,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
return resampler_drivers[i];
else
{
#ifdef RARCH_INTERNAL
unsigned d;
RARCH_ERR("Couldn't find any resampler driver named \"%s\"\n", ident);
RARCH_LOG_OUTPUT("Available resampler drivers are:\n");
@ -57,6 +62,7 @@ static const rarch_resampler_t *find_resampler_driver(const char *ident)
RARCH_LOG_OUTPUT("\t%s\n", resampler_drivers[d]->ident);
RARCH_WARN("Going to default to first resampler driver ...\n");
#endif
return resampler_drivers[0];
}
@ -69,9 +75,11 @@ void find_prev_resampler_driver(void)
if (i > 0)
strlcpy(g_settings.audio.resampler, resampler_drivers[i - 1]->ident,
sizeof(g_settings.audio.resampler));
#ifdef RARCH_INTERNAL
else
RARCH_WARN("Couldn't find any previous resampler driver (current one: \"%s\").\n",
g_extern.audio_data.resampler->ident);
#endif
}
void find_next_resampler_driver(void)
@ -80,9 +88,11 @@ void find_next_resampler_driver(void)
if (i >= 0 && resampler_drivers[i + 1])
strlcpy(g_settings.audio.resampler, resampler_drivers[i + 1]->ident,
sizeof(g_settings.audio.resampler));
#ifdef RARCH_INTERNAL
else
RARCH_WARN("Couldn't find any next resampler driver (current one: \"%s\").\n",
g_extern.audio_data.resampler->ident);
#endif
}
#endif

View File

@ -17,7 +17,9 @@
#include "resampler.h"
#include "../../libretro.h"
#ifndef RARCH_INTERNAL
#include "../../performance.h"
#endif
#include <math.h>
#include <stdint.h>
#include <stdlib.h>
@ -25,7 +27,7 @@
#include <stdio.h>
#include "../../msvc/msvc_compat.h"
#ifndef RESAMPLER_TEST
#if !defined(RESAMPLER_TEST) && defined(RARCH_INTERNAL)
#include "../../general.h"
#else
#define RARCH_LOG(...) fprintf(stderr, __VA_ARGS__)