xmlconfig: Use static inline for regex fallback to prevent -O0 issues

A non-static inline function body is only actually emitted by GCC during optimization passes,
so running -O0 ends up never emitting the body, producing linker errors.

Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
This commit is contained in:
Jesse Natalie 2021-08-01 11:09:47 -07:00 committed by Marge Bot
parent 7939094d65
commit 68ff6f8be5

View file

@ -48,9 +48,9 @@ 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) {}
static inline int regcomp(regex_t *r, const char *s, int f) { return 0; }
static inline int regexec(regex_t *r, const char *s, int n, void *p, int f) { return REG_NOMATCH; }
static inline void regfree(regex_t* r) {}
#else
#include <regex.h>
#endif