From 9df4dee8d5aff3ec4e55712f540225ac599b2960 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Wed, 18 Feb 2026 14:25:24 +0200 Subject: [PATCH] ; Fix last change in treesit.c * src/treesit.c (ts_tree_cursor_copy) [WINDOWSNT]: Define and load from the DLL if 'ts_tree_cursor_goto_previous_sibling' is not available. This fixes the MS-Windows build broken by the last change here. (Bug#80108) --- src/treesit.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/treesit.c b/src/treesit.c index c929bcaf4fe..8c38ba82e37 100644 --- a/src/treesit.c +++ b/src/treesit.c @@ -87,6 +87,8 @@ along with GNU Emacs. If not, see . */ #undef ts_tree_cursor_goto_first_child_for_byte #ifdef HAVE_TS_TREE_CURSOR_GOTO_PREVIOUS_SIBLING #undef ts_tree_cursor_goto_previous_sibling +#else +#undef ts_tree_cursor_copy #endif #undef ts_tree_cursor_goto_next_sibling #undef ts_tree_cursor_goto_parent @@ -162,6 +164,8 @@ DEF_DLL_FN (int64_t, ts_tree_cursor_goto_first_child_for_byte, (TSTreeCursor *, DEF_DLL_FN (bool, ts_tree_cursor_goto_next_sibling, (TSTreeCursor *)); #ifdef HAVE_TS_TREE_CURSOR_GOTO_PREVIOUS_SIBLING DEF_DLL_FN (bool, ts_tree_cursor_goto_previous_sibling, (TSTreeCursor *)); +#else +DEF_DLL_FN (TSTreeCursor, ts_tree_cursor_copy, (const TSTreeCursor *)); #endif DEF_DLL_FN (bool, ts_tree_cursor_goto_parent, (TSTreeCursor *)); DEF_DLL_FN (TSTreeCursor, ts_tree_cursor_new, (TSNode)); @@ -232,6 +236,8 @@ init_treesit_functions (void) LOAD_DLL_FN (library, ts_tree_cursor_goto_next_sibling); #ifdef HAVE_TS_TREE_CURSOR_GOTO_PREVIOUS_SIBLING LOAD_DLL_FN (library, ts_tree_cursor_goto_previous_sibling); +#else + LOAD_DLL_FN (library, ts_tree_cursor_copy); #endif LOAD_DLL_FN (library, ts_tree_cursor_goto_parent); LOAD_DLL_FN (library, ts_tree_cursor_new); @@ -294,7 +300,11 @@ init_treesit_functions (void) #define ts_tree_cursor_goto_first_child fn_ts_tree_cursor_goto_first_child #define ts_tree_cursor_goto_first_child_for_byte fn_ts_tree_cursor_goto_first_child_for_byte #define ts_tree_cursor_goto_next_sibling fn_ts_tree_cursor_goto_next_sibling +#ifdef HAVE_TS_TREE_CURSOR_GOTO_PREVIOUS_SIBLING #define ts_tree_cursor_goto_previous_sibling fn_ts_tree_cursor_goto_previous_sibling +#else +#define ts_tree_cursor_copy fn_ts_tree_cursor_copy +#endif #define ts_tree_cursor_goto_parent fn_ts_tree_cursor_goto_parent #define ts_tree_cursor_new fn_ts_tree_cursor_new #define ts_tree_delete fn_ts_tree_delete