1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

mjit.c: fix MinGW warning by r62221

mjit.c: In function 'worker':
mjit.c:126:64: warning: passing argument 1 of '_InterlockedExchangePointer' from incompatible pointer type [-Wincompatible-pointer-types]
 #  define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer(&(var), val)
                                                                ^
mjit.c:828:17: note: in expansion of macro 'MJIT_ATOMIC_SET'
                 MJIT_ATOMIC_SET(node->unit->iseq->body->jit_func, func);
                 ^
In file included from C:/msys64/mingw64/x86_64-w64-mingw32/include/winnt.h:27:0,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/minwindef.h:163,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windef.h:8,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/windows.h:69,
                 from C:/msys64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
                 from ./include/ruby/win32.h:41,
                 from ./include/ruby/defines.h:250,
                 from ./include/ruby/ruby.h:29,
                 from ./include/ruby.h:33,
                 from internal.h:15,
                 from mjit.c:76:
C:/msys64/mingw64/x86_64-w64-mingw32/include/psdk_inc/intrin-impl.h:1420:7: note: expected 'void * volatile*' but argument is of type 'VALUE (**)(struct rb_execution_context_struct *, struct rb_control_frame_struct *) {aka long long unsigned int (**)(struct rb_execution_context_struct *, struct rb_control_frame_struct *)}'
 void *_InterlockedExchangePointer(void *volatile *Target,void *Value) {
       ^~~~~~~~~~~~~~~~~~~~~~~~~~~

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62239 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-02-05 17:00:43 +00:00
parent 1fd0a7a660
commit b64f7258f4

2
mjit.c
View file

@ -123,7 +123,7 @@ typedef intptr_t pid_t;
/* Atomically set function pointer if possible. */
#ifdef _WIN32
# ifdef InterlockedExchangePointer
# define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer(&(var), val)
# define MJIT_ATOMIC_SET(var, val) InterlockedExchangePointer((void **)&(var), (void *)val)
# else
# define MJIT_ATOMIC_SET(var, val) (void)((var) = (val))
# endif