Skip to content

Commit

Permalink
Merge pull request #26 from jeremy/incompatible-function-pointer-types
Browse files Browse the repository at this point in the history
Use compatible function pointer types to fix build errors on newer Clang
  • Loading branch information
hsbt authored Aug 1, 2024
2 parents 81adc6b + 13d61ab commit 90e03d2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
9 changes: 8 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,14 @@ jobs:
strategy:
matrix:
ruby: ${{ fromJson(needs.ruby-versions.outputs.versions) }}
os: [ ubuntu-latest, macos-13 ]
os: [ ubuntu-latest, macos-13, macos-latest ]
exclude:
- ruby: 2.3
os: macos-latest
- ruby: 2.4
os: macos-latest
- ruby: 2.5
os: macos-latest
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
11 changes: 6 additions & 5 deletions ext/iconv/iconv.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static VALUE iconv_convert _((iconv_t cd, VALUE str, long start, long length, in
static VALUE iconv_s_allocate _((VALUE klass));
static VALUE iconv_initialize _((int argc, VALUE *argv, VALUE self));
static VALUE iconv_s_open _((int argc, VALUE *argv, VALUE self));
static VALUE iconv_s_convert _((struct iconv_env_t* env));
static VALUE iconv_s_convert _((VALUE self));
static VALUE iconv_s_iconv _((int argc, VALUE *argv, VALUE self));
static VALUE iconv_init_state _((VALUE cd));
static VALUE iconv_finish _((VALUE self));
Expand All @@ -204,7 +204,7 @@ static VALUE charset_map;
* Returns the map from canonical name to system dependent name.
*/
static VALUE
charset_map_get(void)
charset_map_get(VALUE klass)
{
return charset_map;
}
Expand Down Expand Up @@ -642,7 +642,7 @@ iconv_s_allocate(VALUE klass)
}

static VALUE
get_iconv_opt_i(VALUE i, VALUE arg)
get_iconv_opt_i(RB_BLOCK_CALL_FUNC_ARGLIST(i, arg))
{
VALUE name;
#if defined ICONV_SET_TRANSLITERATE || defined ICONV_SET_DISCARD_ILSEQ
Expand Down Expand Up @@ -784,8 +784,9 @@ iconv_s_open(int argc, VALUE *argv, VALUE self)
}

static VALUE
iconv_s_convert(struct iconv_env_t* env)
iconv_s_convert(VALUE self)
{
struct iconv_env_t* env = (struct iconv_env_t*)self;
VALUE last = 0;

for (; env->argc > 0; --env->argc, ++env->argv) {
Expand Down Expand Up @@ -906,7 +907,7 @@ list_iconv(unsigned int namescount, const char *const *names, void *data)

#if defined(HAVE_ICONVLIST) || defined(HAVE___ICONV_FREE_LIST)
static VALUE
iconv_s_list(void)
iconv_s_list(VALUE klass)
{
#ifdef HAVE_ICONVLIST
int state;
Expand Down

0 comments on commit 90e03d2

Please sign in to comment.