Fix build when config file support isn't compiled in.

This commit is contained in:
Themaister 2011-05-26 20:44:12 +02:00
parent aec44b093e
commit 7c5f36be61
2 changed files with 10 additions and 0 deletions

View File

@ -273,6 +273,7 @@ static bool load_plain(const char *path)
return true; return true;
} }
#ifdef HAVE_CONFIGFILE
static bool load_textures(const char *dir_path, config_file_t *conf) static bool load_textures(const char *dir_path, config_file_t *conf)
{ {
char *textures; char *textures;
@ -343,9 +344,11 @@ error:
glBindTexture(GL_TEXTURE_2D, 0); glBindTexture(GL_TEXTURE_2D, 0);
return false; return false;
} }
#endif
static bool load_preset(const char *path) static bool load_preset(const char *path)
{ {
#ifdef HAVE_CONFIGFILE
// Create passthrough shader. // Create passthrough shader.
prg[0].fprg = cgCreateProgram(cgCtx, CG_SOURCE, stock_cg_program, cgFProf, "main_fragment", 0); prg[0].fprg = cgCreateProgram(cgCtx, CG_SOURCE, stock_cg_program, cgFProf, "main_fragment", 0);
prg[0].vprg = cgCreateProgram(cgCtx, CG_SOURCE, stock_cg_program, cgVProf, "main_vertex", 0); prg[0].vprg = cgCreateProgram(cgCtx, CG_SOURCE, stock_cg_program, cgVProf, "main_vertex", 0);
@ -562,6 +565,11 @@ error:
if (conf) if (conf)
config_file_free(conf); config_file_free(conf);
return false; return false;
#else
(void)path;
SSNES_ERR("No config file support compiled in.\n");
return false;
#endif
} }
bool gl_cg_init(const char *path) bool gl_cg_init(const char *path)

View File

@ -181,6 +181,7 @@ void parse_config(void)
#endif #endif
} }
#ifdef HAVE_CONFIGFILE
static config_file_t *open_default_config_file(void) static config_file_t *open_default_config_file(void)
{ {
config_file_t *conf = NULL; config_file_t *conf = NULL;
@ -236,6 +237,7 @@ static config_file_t *open_default_config_file(void)
return conf; return conf;
} }
#endif
// Macros to ease config getting. // Macros to ease config getting.
#define CONFIG_GET_BOOL(var, key) if (config_get_bool(conf, key, &tmp_bool)) \ #define CONFIG_GET_BOOL(var, key) if (config_get_bool(conf, key, &tmp_bool)) \