mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 13:10:10 +01: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
3 changed files with 21 additions and 1 deletions
|
|
@ -1424,6 +1424,15 @@ endif
|
||||||
# it's not linux and wont
|
# it's not linux and wont
|
||||||
dep_m = cc.find_library('m', required : false)
|
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
|
if with_platform_haiku
|
||||||
dep_network = cc.find_library('network')
|
dep_network = cc.find_library('network')
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -221,6 +221,7 @@ xmlconfig_deps = []
|
||||||
if not (with_platform_android or with_platform_windows)
|
if not (with_platform_android or with_platform_windows)
|
||||||
xmlconfig_deps += dep_expat
|
xmlconfig_deps += dep_expat
|
||||||
endif
|
endif
|
||||||
|
xmlconfig_deps += dep_regex
|
||||||
|
|
||||||
_libxmlconfig = static_library(
|
_libxmlconfig = static_library(
|
||||||
'xmlconfig',
|
'xmlconfig',
|
||||||
|
|
|
||||||
|
|
@ -43,7 +43,17 @@
|
||||||
#include <dirent.h>
|
#include <dirent.h>
|
||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#endif
|
#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>
|
#include <regex.h>
|
||||||
|
#endif
|
||||||
#include <fcntl.h>
|
#include <fcntl.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include "strndup.h"
|
#include "strndup.h"
|
||||||
|
|
@ -1153,7 +1163,7 @@ driParseConfigFiles(driOptionCache *cache, const driOptionCache *info,
|
||||||
userData.applicationVersion = applicationVersion;
|
userData.applicationVersion = applicationVersion;
|
||||||
userData.engineName = engineName ? engineName : "";
|
userData.engineName = engineName ? engineName : "";
|
||||||
userData.engineVersion = engineVersion;
|
userData.engineVersion = engineVersion;
|
||||||
userData.execName = execname ?: util_get_process_name();
|
userData.execName = execname ? execname : util_get_process_name();
|
||||||
|
|
||||||
#if WITH_XMLCONFIG
|
#if WITH_XMLCONFIG
|
||||||
char *home;
|
char *home;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue