summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwm4 <wm4@nowhere>2013-12-18 17:12:27 +0100
committerwm4 <wm4@nowhere>2013-12-18 17:12:27 +0100
commit80b34ebea4212c232865498c4d4b59ca70befb00 (patch)
treebefaac6611566af51d96b5f2896eafc252254acf
parent2c08bf1bd744bb8eb5986f1ccb3ae03e284170dc (diff)
downloadmpv-80b34ebea4212c232865498c4d4b59ca70befb00.tar.bz2
mpv-80b34ebea4212c232865498c4d4b59ca70befb00.tar.xz
m_option: don't include config.h in header
Requires a small workaround.
-rw-r--r--options/m_option.c8
-rw-r--r--options/m_option.h10
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)