patch 9.2.0625: GTK4: Link error when Wayland is disabled

Commit: 
https://github.com/vim/vim/commit/6fe4d8614e22eb4158a21e68b16ae02e7e7fa395
Author: Christian Brabandt <[email protected]>
Date:   Sat Jun 13 14:41:35 2026 +0000

    patch 9.2.0625: GTK4: Link error when Wayland is disabled
    
    Problem:  GTK4: Link error when Wayland is disabled
              (chdiza)
    Solution: Adjust ifdefs for clip_convert_data()
    
    fixes: #20488
    
    Signed-off-by: Christian Brabandt <[email protected]>

diff --git a/src/clipboard.c b/src/clipboard.c
index 243625047..5ac185cb5 100644
--- a/src/clipboard.c
+++ b/src/clipboard.c
@@ -2574,72 +2574,6 @@ clip_reset_wayland(void)
     return OK;
 }
 
-/*
- * If "vim" is TRUE, then get the motion type. If "vimenc" is TRUE, then get 
the
- * motion type and also convert "*buf". "buf" and "len_store" will be updated 
to
- * reflect the actual contents, but should be set beforehand with the initial
- * contents. Returns OK on success and FAIL on failure.
- */
-    int
-clip_convert_data(
-       char_u  **buf,
-       long    *len_store,
-       int     *motion,
-       bool    vim,
-       bool    vimenc,
-       char_u  **tofree)
-{
-    char_u  *final = *buf;
-    char_u  *enc;
-    long    len = *len_store;
-
-    if (vim && len >= 2)
-    {
-       *motion = *final++;
-       len--;
-    }
-    else if (vimenc && len >= 3)
-    {
-       vimconv_T   conv;
-       int         convlen;
-
-       // First byte is motion type
-       *motion = *final++;
-       len--;
-
-       // Get encoding of selection
-       enc = final;
-
-       // Skip the encoding type including null terminator in final text
-       final = memchr(final, NUL, len);
-       if (final == NULL)
-           return FAIL;
-       final++; // Skip NUL
-
-       // Subtract pointers to get length of encoding;
-       len -= final - enc;
-
-       conv.vc_type = CONV_NONE;
-       convert_setup(&conv, enc, p_enc);
-       if (conv.vc_type != CONV_NONE)
-       {
-          char_u *tmp;
-
-          convlen = len;
-          tmp = string_convert(&conv, final, &convlen);
-          len = convlen;
-          if (tmp != NULL)
-          {
-               final = tmp;
-               *tofree = final;
-          }
-          convert_setup(&conv, NULL, NULL);
-       }
-    }
-    *buf = final;
-    *len_store = len;
-    return OK;
-}
 
 /*
  * Read data from a file descriptor and write it to the given clipboard.
@@ -3790,3 +3724,72 @@ dec_clip_provider(void)
 }
 
 #endif // FEAT_CLIPBOARD_PROVIDER
+
+#if defined(FEAT_WAYLAND_CLIPBOARD) || (defined(FEAT_GUI_GTK) && 
defined(USE_GTK4))
+/*
+ * If "vim" is TRUE, then get the motion type. If "vimenc" is TRUE, then get 
the
+ * motion type and also convert "*buf". "buf" and "len_store" will be updated 
to
+ * reflect the actual contents, but should be set beforehand with the initial
+ * contents. Returns OK on success and FAIL on failure.
+ */
+    int
+clip_convert_data(
+       char_u  **buf,
+       long    *len_store,
+       int     *motion,
+       bool    vim,
+       bool    vimenc,
+       char_u  **tofree)
+{
+    char_u  *final = *buf;
+    char_u  *enc;
+    long    len = *len_store;
+
+    if (vim && len >= 2)
+    {
+       *motion = *final++;
+       len--;
+    }
+    else if (vimenc && len >= 3)
+    {
+       vimconv_T   conv;
+       int         convlen;
+
+       // First byte is motion type
+       *motion = *final++;
+       len--;
+
+       // Get encoding of selection
+       enc = final;
+
+       // Skip the encoding type including null terminator in final text
+       final = memchr(final, NUL, len);
+       if (final == NULL)
+           return FAIL;
+       final++; // Skip NUL
+
+       // Subtract pointers to get length of encoding;
+       len -= final - enc;
+
+       conv.vc_type = CONV_NONE;
+       convert_setup(&conv, enc, p_enc);
+       if (conv.vc_type != CONV_NONE)
+       {
+          char_u *tmp;
+
+          convlen = len;
+          tmp = string_convert(&conv, final, &convlen);
+          len = convlen;
+          if (tmp != NULL)
+          {
+               final = tmp;
+               *tofree = final;
+          }
+          convert_setup(&conv, NULL, NULL);
+       }
+    }
+    *buf = final;
+    *len_store = len;
+    return OK;
+}
+#endif
diff --git a/src/proto/clipboard.pro b/src/proto/clipboard.pro
index 25633ca39..46dc72ede 100644
--- a/src/proto/clipboard.pro
+++ b/src/proto/clipboard.pro
@@ -37,7 +37,6 @@ void may_set_selection(void);
 int clip_init_wayland(void);
 void clip_uninit_wayland(void);
 int clip_reset_wayland(void);
-int clip_convert_data(char_u **buf, long *len_store, int *motion, bool vim, 
bool vimenc, char_u **tofree);
 char *choose_clipmethod(void);
 void ex_clipreset(exarg_T *eap);
 void adjust_clip_reg(int *rp);
@@ -46,4 +45,5 @@ void call_clip_provider_request(int reg);
 void call_clip_provider_set(int reg);
 void inc_clip_provider(void);
 void dec_clip_provider(void);
+int clip_convert_data(char_u **buf, long *len_store, int *motion, bool vim, 
bool vimenc, char_u **tofree);
 /* vim: set ft=c : */
diff --git a/src/version.c b/src/version.c
index 28606e3d3..6e78357c4 100644
--- a/src/version.c
+++ b/src/version.c
@@ -754,6 +754,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    625,
 /**/
     624,
 /**/

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion visit 
https://groups.google.com/d/msgid/vim_dev/E1wYPq8-00DAFc-6q%40256bit.org.

Raspunde prin e-mail lui