Mesa (main): xmlconfig: Use static inline for regex fallback to prevent -O0 issues
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Aug 10 15:35:39 UTC 2021
Module: Mesa
Branch: main
Commit: 68ff6f8be54f82c170ad7a1526891c63d43ac951
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=68ff6f8be54f82c170ad7a1526891c63d43ac951
Author: Jesse Natalie <jenatali at microsoft.com>
Date: Sun Aug 1 11:09:47 2021 -0700
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 at gmail.com>
Reviewed-by: Charmaine Lee <charmainel at vmware.com>
Reviewed-by: Neha Bhende <bhenden at vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12158>
---
src/util/xmlconfig.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/util/xmlconfig.c b/src/util/xmlconfig.c
index 1f1ec14bd33..8766bb01f0a 100644
--- a/src/util/xmlconfig.c
+++ b/src/util/xmlconfig.c
@@ -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
More information about the mesa-commit
mailing list