diff options
author | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-30 07:53:24 +0000 |
---|---|---|
committer | shyouhei <shyouhei@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2018-07-30 07:53:24 +0000 |
commit | ab740cbb75c256e7a209f618857e136df78c6a88 (patch) | |
tree | df7e658faac45ecb4ce7912e4f4c0a7995c5bfc0 /process.c | |
parent | d83536c980fb96a880def3e952eb4920815eeb51 (diff) |
move #pragma out of functions
gcc (GCC) 4.4.7 20120313 (Red Hat 4.4.7-18) reportedly fails to compile
cf: https://rubyci.org/logs/rubyci.s3.amazonaws.com/centos6/ruby-trunk/log/20180726T093003Z.fail.html.gz
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64119 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'process.c')
-rw-r--r-- | process.c | 22 |
1 files changed, 10 insertions, 12 deletions
@@ -3959,6 +3959,10 @@ disable_child_handler_fork_child(struct child_handler_disabler_state *old, char return 0; } +COMPILER_WARNING_PUSH +#ifdef __GNUC__ +COMPILER_WARNING_IGNORED(-Wdeprecated-declarations) +#endif static rb_pid_t retry_fork_async_signal_safe(int *status, int *ep, int (*chfunc)(void*, char *, size_t), void *charg, @@ -3972,10 +3976,6 @@ retry_fork_async_signal_safe(int *status, int *ep, while (1) { prefork(); disable_child_handler_before_fork(&old); - COMPILER_WARNING_PUSH; -#ifdef __GNUC__ - COMPILER_WARNING_IGNORED(-Wdeprecated-declarations); -#endif #ifdef HAVE_WORKING_VFORK if (!has_privilege()) pid = vfork(); @@ -3984,7 +3984,6 @@ retry_fork_async_signal_safe(int *status, int *ep, #else pid = fork(); #endif - COMPILER_WARNING_POP; if (pid == 0) {/* fork succeed, child process */ int ret; close(ep[0]); @@ -4009,6 +4008,7 @@ retry_fork_async_signal_safe(int *status, int *ep, return -1; } } +COMPILER_WARNING_POP rb_pid_t rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), void *charg, VALUE fds, @@ -4040,6 +4040,10 @@ rb_fork_async_signal_safe(int *status, int (*chfunc)(void*, char *, size_t), voi return pid; } +COMPILER_WARNING_PUSH +#ifdef __GNUC__ +COMPILER_WARNING_IGNORED(-Wdeprecated-declarations) +#endif rb_pid_t rb_fork_ruby(int *status) { @@ -4053,14 +4057,7 @@ rb_fork_ruby(int *status) prefork(); disable_child_handler_before_fork(&old); before_fork_ruby(); - COMPILER_WARNING_PUSH; -#ifdef __GNUC__ - COMPILER_WARNING_IGNORED(-Wdeprecated-declarations); -#endif pid = fork(); -#ifdef __GNUC__ - COMPILER_WARNING_POP; -#endif err = errno; after_fork_ruby(); disable_child_handler_fork_parent(&old); /* yes, bad name */ @@ -4071,6 +4068,7 @@ rb_fork_ruby(int *status) return -1; } } +COMPILER_WARNING_POP #endif |