aboutsummaryrefslogtreecommitdiffstats
path: root/mjit.c
diff options
context:
space:
mode:
authork0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-05 17:00:43 +0000
committerk0kubun <k0kubun@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-02-05 17:00:43 +0000
commitb64f7258f4cabf9b005d27e98f98376e95ce7e46 (patch)
treeb331caafe8b226b942757c8c3717b80210197ad2 /mjit.c
parent1fd0a7a6608ed0a0514d59e40f3a149f289ea537 (diff)
downloadruby-b64f7258f4cabf9b005d27e98f98376e95ce7e46.tar.gz
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
Diffstat (limited to 'mjit.c')
-rw-r--r--mjit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mjit.c b/mjit.c
index fb7fe14f06..7fbb27ec3e 100644
--- a/mjit.c
+++ b/mjit.c
@@ -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