summaryrefslogtreecommitdiff
path: root/cont.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 (GMT)
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 (GMT)
commitd83536c980fb96a880def3e952eb4920815eeb51 (patch)
treeac970bbba01d5b04b4d0ab7c0175e996d7468875 /cont.c
parent7018acc946882f21d519af7c42ccf84b22a46b27 (diff)
reduce copy & paste
We see several occurrence of "diagnostic push/pop" so why not make them macros. Tested on GCC8 / Clang 6. Note that ruby.h is intentionally left untouched because we don't want to introduce new public macros. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64118 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'cont.c')
-rw-r--r--cont.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/cont.c b/cont.c
index 1f82a79..e7ad79f 100644
--- a/cont.c
+++ b/cont.c
@@ -628,9 +628,9 @@ show_vm_pcs(const rb_control_frame_t *cfp,
}
}
#endif
+COMPILER_WARNING_PUSH
#ifdef __clang__
-#pragma clang diagnostic push
-#pragma clang diagnostic ignored "-Wduplicate-decl-specifier"
+COMPILER_WARNING_IGNORED(-Wduplicate-decl-specifier)
#endif
static VALUE
cont_capture(volatile int *volatile stat)
@@ -694,9 +694,7 @@ cont_capture(volatile int *volatile stat)
return contval;
}
}
-#ifdef __clang__
-#pragma clang diagnostic pop
-#endif
+COMPILER_WARNING_POP
static inline void
fiber_restore_thread(rb_thread_t *th, rb_fiber_t *fib)