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:
Michel Zou
2021-02-24 20:28:38 +01:00
committed by Marge Bot
parent f08670b4ea
commit 5a2b930014
3 changed files with 21 additions and 1 deletions
+11 -1
View File
@@ -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;