Check if FFI_GO_CLOSURES is defined (#796)
authorNobuyoshi Nakada <nobu@ruby-lang.org>
Sat, 21 Oct 2023 11:44:24 +0000 (20:44 +0900)
committerGitHub <noreply@github.com>
Sat, 21 Oct 2023 11:44:24 +0000 (07:44 -0400)
This macro is always defined to 1 if defined, or undefined.
With `-Wundef` option, checking the value without checking if it is defined causes warnings:

```
/opt/local/include/ffi.h:477:5: warning: 'FFI_GO_CLOSURES' is not defined, evaluates to 0 [-Wundef]
#if FFI_GO_CLOSURES
    ^
```

include/ffi.h.in
msvc_build/aarch64/aarch64_include/ffi.h

index e7fe9633a516c66506ac95c059039fc625ca8391..ecfe60a01981e404c14028dac9ca4885ab1c1a49 100644 (file)
@@ -464,7 +464,7 @@ ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
 
 #endif /* FFI_CLOSURES */
 
-#if FFI_GO_CLOSURES
+#ifdef FFI_GO_CLOSURES
 
 typedef struct {
   void      *tramp;
index 8aed5255503cb107990174d6fe7fe810e8fc229f..2b0b693998a41c3fb48bbfba43fd9e7f8c3f9194 100644 (file)
@@ -429,7 +429,7 @@ ffi_prep_java_raw_closure_loc (ffi_java_raw_closure*,
 
 #endif /* FFI_CLOSURES */
 
-#if FFI_GO_CLOSURES
+#ifdef FFI_GO_CLOSURES
 
 typedef struct {
   void      *tramp;