Skip to content

Commit 788128a

Browse files
authored
Fix -Wpointer-type-mismatch warning (GH-17453)
`GetProcAddress()` returns a `FARPROC` (aka. `long long (*)()`) which is not compatible with `void *` per the specs. However, on Windows they are, so we silence the warning with a cast.
1 parent 1675d32 commit 788128a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

ext/ffi/ffi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3052,7 +3052,7 @@ static void *dlsym_loaded(char *symbol)
30523052
return addr;
30533053
}
30543054
# undef DL_FETCH_SYMBOL
3055-
# define DL_FETCH_SYMBOL(h, s) (h == NULL ? dlsym_loaded(s) : GetProcAddress(h, s))
3055+
# define DL_FETCH_SYMBOL(h, s) (h == NULL ? dlsym_loaded(s) : (void*) GetProcAddress(h, s))
30563056
#endif
30573057

30583058
ZEND_METHOD(FFI, cdef) /* {{{ */

0 commit comments

Comments
 (0)