aboutsummaryrefslogtreecommitdiff
path: root/deps/sysobj_early
diff options
context:
space:
mode:
authorBurt P <pburt0@gmail.com>2020-01-22 10:31:32 -0600
committerLeandro A. F. Pereira <leandro@hardinfo.org>2020-01-22 16:46:19 -0800
commitacc0715e8aaf923bf0b940c767fdfb494f11c4b9 (patch)
tree3d38ee14e405e4d2250a4e621cfe29a99cee7857 /deps/sysobj_early
parent742d1ae93ed1d9bc9f8c62e3d53e90f085bfa74e (diff)
util_edid: use weak function instead of macro
Suggested-by: Leandro Pereira <leandro@hardinfo.org> Signed-off-by: Burt P <pburt0@gmail.com>
Diffstat (limited to 'deps/sysobj_early')
-rw-r--r--deps/sysobj_early/include/util_edid.h5
-rw-r--r--deps/sysobj_early/src/util_edid.c11
2 files changed, 11 insertions, 5 deletions
diff --git a/deps/sysobj_early/include/util_edid.h b/deps/sysobj_early/include/util_edid.h
index a188c135..5bb4b932 100644
--- a/deps/sysobj_early/include/util_edid.h
+++ b/deps/sysobj_early/include/util_edid.h
@@ -25,11 +25,6 @@
#include <stdint.h> /* for *int*_t types */
#include <glib.h>
-// TODO: find a better fix, I've seen a few EDID strings with bogus chars
-#if !GLIB_CHECK_VERSION(2,52,0)
-#define g_utf8_make_valid(S,L) g_strdup(S)
-#endif
-
typedef struct _edid edid;
typedef struct {
diff --git a/deps/sysobj_early/src/util_edid.c b/deps/sysobj_early/src/util_edid.c
index 28773f96..4b2c515d 100644
--- a/deps/sysobj_early/src/util_edid.c
+++ b/deps/sysobj_early/src/util_edid.c
@@ -31,6 +31,17 @@
#include "util_edid_svd_table.c"
+// TODO: find a better fix, I've seen a few EDID strings with bogus chars
+#if !GLIB_CHECK_VERSION(2,52,0)
+__attribute__ ((weak))
+gchar *g_utf8_make_valid(const gchar *s, const gssize l) {
+ if (l < 0)
+ return g_strdup(s);
+ else
+ return g_strndup(s, (gsize)l);
+}
+#endif
+
#define NOMASK (~0U)
#define BFMASK(LSB, MASK) (MASK << LSB)