Skip to content

Commit a1d4777

Browse files
ntkmezhangskz
authored andcommitted
[Ruby] Fix mismatched pointer type (#17240)
This PR fixes the following error on windows ruby 3.4 (head): ``` current directory: D:/a/sass-embedded-host-ruby/sass-embedded-host-ruby/vendor/bundle/ruby/3.4.0+0/gems/google-protobuf-4.27.1/ext/google/protobuf_c make.exe DESTDIR\= sitearchdir\=./.gem.20240623-6612-4umz58 sitelibdir\=./.gem.20240623-6612-4umz58 generating protobuf_c-x64-mingw-ucrt.def compiling protobuf.c compiling convert.c compiling defs.c defs.c: In function 'MethodDescriptor_initialize': defs.c:1513:19: error: assignment to 'const upb_MethodDef *' from incompatible pointer type 'const upb_ServiceDef *' [-Wincompatible-pointer-types] 1513 | self->methoddef = (const upb_ServiceDef*)NUM2ULL(ptr); | ^ make: *** [Makefile:250: defs.o] Error 1 make failed, exit code 2 ``` - Closes #17266 Closes #17240 COPYBARA_INTEGRATE_REVIEW=#17240 from ntkme:fix-ruby-upb-pointer-type 22e9859 PiperOrigin-RevId: 648923147
1 parent 2440498 commit a1d4777

File tree

1 file changed

+1
-1
lines changed
  • ruby/ext/google/protobuf_c

1 file changed

+1
-1
lines changed

ruby/ext/google/protobuf_c/defs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ static VALUE MethodDescriptor_initialize(VALUE _self, VALUE cookie,
15101510
}
15111511

15121512
RB_OBJ_WRITE(_self, &self->descriptor_pool, descriptor_pool);
1513-
self->methoddef = (const upb_ServiceDef*)NUM2ULL(ptr);
1513+
self->methoddef = (const upb_MethodDef*)NUM2ULL(ptr);
15141514

15151515
return Qnil;
15161516
}

0 commit comments

Comments
 (0)