patch 9.0.2013: confusing ifdefs in if_<lang>.c
Problem: confusing ifdefs in if_<lang>.c
Solution: refactor ifndefs to #ifdefs
if_x: Avoid using #ifndef - #else - #endif
Using #ifndef - #else - #endif is sometimes confusing.
Use #ifdef - #else - #endif instead.
closes: #13310
Signed-off-by: Christian Brabandt <cb@256bit.org>
Co-authored-by: Ken Takata <kentkt@csc.jp>
diff --git a/src/if_mzsch.c b/src/if_mzsch.c
index e44714a..9a9c487 100644
--- a/src/if_mzsch.c
+++ b/src/if_mzsch.c
@@ -1366,10 +1366,10 @@
bp = BUFFER_REF(buf);
bp->buf = INVALID_BUFFER_VALUE;
-#ifndef MZ_PRECISE_GC
- scheme_gc_ptr_ok(bp);
-#else
+#ifdef MZ_PRECISE_GC
scheme_free_immobile_box(buf->b_mzscheme_ref);
+#else
+ scheme_gc_ptr_ok(bp);
#endif
buf->b_mzscheme_ref = NULL;
MZ_GC_CHECK();
@@ -1391,10 +1391,10 @@
MZ_GC_REG();
wp = WINDOW_REF(win);
wp->win = INVALID_WINDOW_VALUE;
-#ifndef MZ_PRECISE_GC
- scheme_gc_ptr_ok(wp);
-#else
+#ifdef MZ_PRECISE_GC
scheme_free_immobile_box(win->w_mzscheme_ref);
+#else
+ scheme_gc_ptr_ok(wp);
#endif
win->w_mzscheme_ref = NULL;
MZ_GC_CHECK();
@@ -1921,10 +1921,10 @@
MZ_GC_REG();
self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_window));
CLEAR_POINTER(self);
-#ifndef MZ_PRECISE_GC
- scheme_dont_gc_ptr(self); // because win isn't visible to GC
-#else
+#ifdef MZ_PRECISE_GC
win->w_mzscheme_ref = scheme_malloc_immobile_box(NULL);
+#else
+ scheme_dont_gc_ptr(self); // because win isn't visible to GC
#endif
MZ_GC_CHECK();
WINDOW_REF(win) = self;
@@ -2305,10 +2305,10 @@
MZ_GC_REG();
self = scheme_malloc_fail_ok(scheme_malloc_tagged, sizeof(vim_mz_buffer));
CLEAR_POINTER(self);
-#ifndef MZ_PRECISE_GC
- scheme_dont_gc_ptr(self); // because buf isn't visible to GC
-#else
+#ifdef MZ_PRECISE_GC
buf->b_mzscheme_ref = scheme_malloc_immobile_box(NULL);
+#else
+ scheme_dont_gc_ptr(self); // because buf isn't visible to GC
#endif
MZ_GC_CHECK();
BUFFER_REF(buf) = self;