|
| 1 | +$NetBSD: patch-src_treesit.c,v 1.1 2025/12/22 19:51:06 tron Exp $ |
| 2 | + |
| 3 | +Fix build with version 0.26.x of "tree-sitter". |
| 4 | + |
| 5 | +--- src/treesit.c.orig 2024-06-21 14:10:07.000000000 +0100 |
| 6 | ++++ src/treesit.c 2025-12-22 19:31:18.581988953 +0000 |
| 7 | +@@ -34,7 +34,7 @@ |
| 8 | + # include "w32common.h" |
| 9 | + |
| 10 | + /* In alphabetical order. */ |
| 11 | +-#undef ts_language_version |
| 12 | ++#undef ts_language_abi_version |
| 13 | + #undef ts_node_child |
| 14 | + #undef ts_node_child_by_field_name |
| 15 | + #undef ts_node_child_count |
| 16 | +@@ -89,7 +89,7 @@ |
| 17 | + #undef ts_tree_get_changed_ranges |
| 18 | + #undef ts_tree_root_node |
| 19 | + |
| 20 | +-DEF_DLL_FN (uint32_t, ts_language_version, (const TSLanguage *)); |
| 21 | ++DEF_DLL_FN (uint32_t, ts_language_abi_version, (const TSLanguage *)); |
| 22 | + DEF_DLL_FN (TSNode, ts_node_child, (TSNode, uint32_t)); |
| 23 | + DEF_DLL_FN (TSNode, ts_node_child_by_field_name, |
| 24 | + (TSNode, const char *, uint32_t)); |
| 25 | +@@ -166,7 +166,7 @@ |
| 26 | + if (!library) |
| 27 | + return false; |
| 28 | + |
| 29 | +- LOAD_DLL_FN (library, ts_language_version); |
| 30 | ++ LOAD_DLL_FN (library, ts_language_abi_version); |
| 31 | + LOAD_DLL_FN (library, ts_node_child); |
| 32 | + LOAD_DLL_FN (library, ts_node_child_by_field_name); |
| 33 | + LOAD_DLL_FN (library, ts_node_child_count); |
| 34 | +@@ -224,7 +224,7 @@ |
| 35 | + return true; |
| 36 | + } |
| 37 | + |
| 38 | +-#define ts_language_version fn_ts_language_version |
| 39 | ++#define ts_language_abi_version fn_ts_language_abi_version |
| 40 | + #define ts_node_child fn_ts_node_child |
| 41 | + #define ts_node_child_by_field_name fn_ts_node_child_by_field_name |
| 42 | + #define ts_node_child_count fn_ts_node_child_count |
| 43 | +@@ -664,7 +664,7 @@ |
| 44 | + { |
| 45 | + *signal_symbol = Qtreesit_load_language_error; |
| 46 | + *signal_data = list2 (Qversion_mismatch, |
| 47 | +- make_fixnum (ts_language_version (lang))); |
| 48 | ++ make_fixnum (ts_language_abi_version (lang))); |
| 49 | + return NULL; |
| 50 | + } |
| 51 | + return lang; |
| 52 | +@@ -735,7 +735,7 @@ |
| 53 | + &signal_data); |
| 54 | + if (ts_language == NULL) |
| 55 | + return Qnil; |
| 56 | +- uint32_t version = ts_language_version (ts_language); |
| 57 | ++ uint32_t version = ts_language_abi_version (ts_language); |
| 58 | + return make_fixnum((ptrdiff_t) version); |
| 59 | + } |
| 60 | + } |
0 commit comments