From 80b34ebea4212c232865498c4d4b59ca70befb00 Mon Sep 17 00:00:00 2001 From: wm4 Date: Wed, 18 Dec 2013 17:12:27 +0100 Subject: m_option: don't include config.h in header Requires a small workaround. --- options/m_option.c | 8 ++++++++ options/m_option.h | 10 +++------- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/options/m_option.c b/options/m_option.c index d93c18ee52..ba020f5375 100644 --- a/options/m_option.c +++ b/options/m_option.c @@ -41,6 +41,14 @@ #include "m_option.h" #include "m_config.h" +#if HAVE_DOS_PATHS +#define OPTION_PATH_SEPARATOR ';' +#else +#define OPTION_PATH_SEPARATOR ':' +#endif + +const char m_option_path_separator = OPTION_PATH_SEPARATOR; + char *m_option_strerror(int code) { switch (code) { diff --git a/options/m_option.h b/options/m_option.h index 041915bbc1..46c00b92e7 100644 --- a/options/m_option.h +++ b/options/m_option.h @@ -481,6 +481,8 @@ static inline void m_option_free(const m_option_t *opt, void *dst) int m_option_required_params(const m_option_t *opt); +extern const char m_option_path_separator; + // Cause a compilation warning if typeof(expr) != type. // Should be used with pointer types only. #define MP_EXPECT_TYPE(type, expr) (0 ? (type)0 : (expr)) @@ -495,12 +497,6 @@ int m_option_required_params(const m_option_t *opt); #define OPTION_LIST_SEPARATOR ',' -#if HAVE_DOS_PATHS -#define OPTION_PATH_SEPARATOR ';' -#else -#define OPTION_PATH_SEPARATOR ':' -#endif - #define OPTDEF_STR(s) .defval = (void *)&(char * const){s} #define OPTDEF_INT(i) .defval = (void *)&(const int){i} #define OPTDEF_FLOAT(f) .defval = (void *)&(const float){f} @@ -547,7 +543,7 @@ int m_option_required_params(const m_option_t *opt); #define OPT_PATHLIST(...) \ OPT_GENERAL(char**, __VA_ARGS__, .type = &m_option_type_string_list, \ - .priv = (void *)&(const char){OPTION_PATH_SEPARATOR}) + .priv = (void *)&m_option_path_separator) #define OPT_INT(...) \ OPT_GENERAL(int, __VA_ARGS__, .type = &m_option_type_int) -- cgit v1.2.3