ports/devel/rubygem-unicode/files/patch-clang16
Po-Chuan Hsieh 9f2c8360e8
devel/rubygem-unicode: Fix build with Clang 16 and remove the workaround
unicode.c:1039:20: error: incompatible function pointer types passing 'VALUE (get_categories_param *)' (aka 'unsigned long (struct _get_categories_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
  return rb_ensure(get_categories_internal, (VALUE)&param,
                   ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                        ^
unicode.c:1040:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
                   get_categories_ensure, (VALUE)&wstr);
                   ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                                                             ^
unicode.c:1057:20: error: incompatible function pointer types passing 'VALUE (get_categories_param *)' (aka 'unsigned long (struct _get_categories_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
  return rb_ensure(get_categories_internal, (VALUE)&param,
                   ^~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                        ^
unicode.c:1058:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
                   get_categories_ensure, (VALUE)&wstr);
                   ^~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                                                             ^
unicode.c:1227:20: error: incompatible function pointer types passing 'VALUE (get_text_elements_param *)' (aka 'unsigned long (struct _get_text_elements_param *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
  return rb_ensure(get_text_elements_internal, (VALUE)&param,
                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:25: note: passing argument to parameter 'b_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                        ^
unicode.c:1228:20: error: incompatible function pointer types passing 'VALUE (WString *)' (aka 'unsigned long (struct _WString *)') to parameter of type 'VALUE (*)(VALUE)' (aka 'unsigned long (*)(unsigned long)') [-Wincompatible-function-pointer-types]
                   get_text_elements_ensure, (VALUE)&wstr);
                   ^~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-3.1/ruby/internal/iterator.h:425:62: note: passing argument to parameter 'e_proc' here
VALUE rb_ensure(VALUE (*b_proc)(VALUE), VALUE data1, VALUE (*e_proc)(VALUE), VALUE data2);
                                                             ^
20 warnings and 6 errors generated.
2023-07-09 18:25:37 +08:00

35 lines
1.5 KiB
Text

--- ext/unicode/unicode.c.orig 2023-07-03 15:50:18 UTC
+++ ext/unicode/unicode.c
@@ -1036,8 +1036,8 @@ unicode_get_categories(VALUE obj, VALUE str)
#endif
WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
- return rb_ensure(get_categories_internal, (VALUE)&param,
- get_categories_ensure, (VALUE)&wstr);
+ return rb_ensure((VALUE (*)(VALUE)) get_categories_internal, (VALUE)&param,
+ (VALUE (*)(VALUE)) get_categories_ensure, (VALUE)&wstr);
/* wstr will be freed in get_text_elements_ensure() */
}
@@ -1054,8 +1054,8 @@ unicode_get_abbr_categories(VALUE obj, VALUE str)
#endif
WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
- return rb_ensure(get_categories_internal, (VALUE)&param,
- get_categories_ensure, (VALUE)&wstr);
+ return rb_ensure((VALUE (*)(VALUE)) get_categories_internal, (VALUE)&param,
+ (VALUE (*)(VALUE)) get_categories_ensure, (VALUE)&wstr);
/* wstr will be freed in get_text_elements_ensure() */
}
@@ -1224,8 +1224,8 @@ unicode_get_text_elements(VALUE obj, VALUE str)
#endif
WStr_allocWithUTF8L(&wstr, RSTRING_PTR(str), RSTRING_LEN(str));
- return rb_ensure(get_text_elements_internal, (VALUE)&param,
- get_text_elements_ensure, (VALUE)&wstr);
+ return rb_ensure((VALUE (*)(VALUE)) get_text_elements_internal, (VALUE)&param,
+ (VALUE (*)(VALUE)) get_text_elements_ensure, (VALUE)&wstr);
/* wstr will be freed in get_text_elements_ensure() */
}