1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
|
From: =?utf-8?b?Ik1hcmNvIFRyZXZpc2FuIChUcmV2acOxbyki?= <mail@3v1n0.net>
Date: Wed, 10 Sep 2025 08:42:36 +0200
Subject: gi/ns: Do not trigger platform-specific warnings from C++ side
These functions are now part of GioUnix and it's not needed to do any
translation at namespace level
Origin: upstream, 1.86.0, commit:5534a6d2aa41bccd8661cd829f499df92b7bbb11
---
gi/ns.cpp | 18 ++++++++----------
1 file changed, 8 insertions(+), 10 deletions(-)
diff --git a/gi/ns.cpp b/gi/ns.cpp
index 53f1854..9a5cf52 100644
--- a/gi/ns.cpp
+++ b/gi/ns.cpp
@@ -73,25 +73,23 @@ class Ns : private GjsAutoChar, public CWrapper<Ns> {
friend CWrapperPointerOps<Ns>;
friend CWrapper<Ns>;
-#if GLIB_CHECK_VERSION(2, 79, 2)
- bool m_is_gio_or_glib : 1;
-#endif // GLib >= 2.79.2
-
static constexpr auto PROTOTYPE_SLOT = GjsGlobalSlot::PROTOTYPE_ns;
static constexpr GjsDebugTopic DEBUG_TOPIC = GJS_DEBUG_GNAMESPACE;
explicit Ns(const char* ns_name)
: GjsAutoChar(const_cast<char*>(ns_name), GjsAutoTakeOwnership()) {
GJS_INC_COUNTER(ns);
-#if GLIB_CHECK_VERSION(2, 79, 2)
+#if GLIB_CHECK_VERSION(2, 79, 2) && !GLIB_CHECK_VERSION(2, 86, 0)
m_is_gio_or_glib =
strcmp(ns_name, "Gio") == 0 || strcmp(ns_name, "GLib") == 0;
-#endif // GLib >= 2.79.2
+#endif
}
~Ns() { GJS_DEC_COUNTER(ns); }
-#if GLIB_CHECK_VERSION(2, 79, 2)
+#if GLIB_CHECK_VERSION(2, 79, 2) && !GLIB_CHECK_VERSION(2, 86, 0)
+ bool m_is_gio_or_glib : 1;
+
// helper function
void platform_specific_warning(JSContext* cx, const char* prefix,
const char* platform,
@@ -116,7 +114,7 @@ class Ns : private GjsAutoChar, public CWrapper<Ns> {
cx, GjsDeprecationMessageId::PlatformSpecificTypelib,
{old_name.get(), new_name.get()});
}
-#endif // GLib >= 2.79.2
+#endif // GLib (< 2.86.0)
// JSClass operations
@@ -156,7 +154,7 @@ class Ns : private GjsAutoChar, public CWrapper<Ns> {
"Found info type %s for '%s' in namespace '%s'",
gjs_info_type_name(info.type()), info.name(), info.ns());
-#if GLIB_CHECK_VERSION(2, 79, 2)
+#if GLIB_CHECK_VERSION(2, 79, 2) && !GLIB_CHECK_VERSION(2, 86, 0)
static const char* unix_types_exceptions[] = {
"Gio.UnixConnection",
"Gio.UnixCredentialsMessage",
@@ -172,7 +170,7 @@ class Ns : private GjsAutoChar, public CWrapper<Ns> {
platform_specific_warning(cx, "Win32", "Win32", name.get());
platform_specific_warning(cx, "win32_", "Win32", name.get());
}
-#endif // GLib >= 2.79.2
+#endif // GLib (< 2.86.0)
bool defined;
if (!gjs_define_info(cx, obj, info, &defined)) {
|