mirror of
https://github.com/mpv-player/mpv
synced 2025-01-19 22:01:10 +00:00
m_option: don't include config.h in header
Requires a small workaround.
This commit is contained in:
parent
2c08bf1bd7
commit
80b34ebea4
@ -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) {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user