mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2024-11-23 10:14:13 +08:00
meson/xmlconfig: win32 regex fallback
xmlconfig now uses regex fonctions even without xml support
Fixes: c83400e6
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9261>
This commit is contained in:
parent
f08670b4ea
commit
5a2b930014
@ -1424,6 +1424,15 @@ endif
|
||||
# it's not linux and wont
|
||||
dep_m = cc.find_library('m', required : false)
|
||||
|
||||
if host_machine.system() == 'windows'
|
||||
dep_regex = meson.get_compiler('c').find_library('regex', required : false)
|
||||
if not dep_regex.found()
|
||||
dep_regex = declare_dependency(compile_args : ['-DNO_REGEX'])
|
||||
endif
|
||||
else
|
||||
dep_regex = null_dep
|
||||
endif
|
||||
|
||||
if with_platform_haiku
|
||||
dep_network = cc.find_library('network')
|
||||
endif
|
||||
|
@ -221,6 +221,7 @@ xmlconfig_deps = []
|
||||
if not (with_platform_android or with_platform_windows)
|
||||
xmlconfig_deps += dep_expat
|
||||
endif
|
||||
xmlconfig_deps += dep_regex
|
||||
|
||||
_libxmlconfig = static_library(
|
||||
'xmlconfig',
|
||||
|
@ -43,7 +43,17 @@
|
||||
#include <dirent.h>
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#ifdef NO_REGEX
|
||||
typedef int regex_t;
|
||||
#define REG_EXTENDED 0
|
||||
#define REG_NOSUB 0
|
||||
#define REG_NOMATCH 1
|
||||
inline int regcomp(regex_t *r, const char *s, int f) { return 0; }
|
||||
inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; }
|
||||
inline void regfree(regex_t* r) {}
|
||||
#else
|
||||
#include <regex.h>
|
||||
#endif
|
||||
#include <fcntl.h>
|
||||
#include <math.h>
|
||||
#include "strndup.h"
|
||||
@ -1153,7 +1163,7 @@ driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
|
||||
userData.applicationVersion = applicationVersion;
|
||||
userData.engineName = engineName ? engineName : "";
|
||||
userData.engineVersion = engineVersion;
|
||||
userData.execName = execname ?: util_get_process_name();
|
||||
userData.execName = execname ? execname : util_get_process_name();
|
||||
|
||||
#if WITH_XMLCONFIG
|
||||
char *home;
|
||||
|
Loading…
Reference in New Issue
Block a user