summaryrefslogtreecommitdiff
path: root/process.c
diff options
context:
space:
mode:
authorshyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 +0000
committershyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2018-07-30 07:07:48 +0000
commitd83536c980fb96a880def3e952eb4920815eeb51 (patch)
treeac970bbba01d5b04b4d0ab7c0175e996d7468875 /process.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 'process.c')
-rw-r--r--process.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/process.c b/process.c
index 5ac18315ef..ec6bbf8da5 100644
--- a/process.c
+++ b/process.c
@@ -3972,9 +3972,9 @@ retry_fork_async_signal_safe(int *status, int *ep,
while (1) {
prefork();
disable_child_handler_before_fork(&old);
+ COMPILER_WARNING_PUSH;
#ifdef __GNUC__
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
#endif
#ifdef HAVE_WORKING_VFORK
if (!has_privilege())
@@ -3984,9 +3984,7 @@ retry_fork_async_signal_safe(int *status, int *ep,
#else
pid = fork();
#endif
-#ifdef __GNUC__
-# pragma GCC diagnostic pop
-#endif
+ COMPILER_WARNING_POP;
if (pid == 0) {/* fork succeed, child process */
int ret;
close(ep[0]);
@@ -4055,13 +4053,13 @@ rb_fork_ruby(int *status)
prefork();
disable_child_handler_before_fork(&old);
before_fork_ruby();
+ COMPILER_WARNING_PUSH;
#ifdef __GNUC__
-# pragma GCC diagnostic push
-# pragma GCC diagnostic ignored "-Wdeprecated-declarations"
+ COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
#endif
pid = fork();
#ifdef __GNUC__
-# pragma GCC diagnostic pop
+ COMPILER_WARNING_POP;
#endif
err = errno;
after_fork_ruby();