Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ab740cb

Browse files
committed
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
1 parent d83536c commit ab740cb

File tree

2 files changed

+15
-18
lines changed

2 files changed

+15
-18
lines changed

mjit.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -352,6 +352,10 @@ form_args(int num, ...)
352352
return res;
353353
}
354354

355+
COMPILER_WARNING_PUSH
356+
#ifdef __GNUC__
357+
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
358+
#endif
355359
/* Start an OS process of executable PATH with arguments ARGV. Return
356360
PID of the process.
357361
TODO: Use the same function in process.c */
@@ -387,13 +391,7 @@ start_process(const char *path, char *const *argv)
387391
}
388392
dev_null = rb_cloexec_open(ruby_null_device, O_WRONLY, 0);
389393

390-
COMPILER_WARNING_PUSH;
391-
#ifdef __GNUC__
392-
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
393-
#endif
394394
if ((pid = vfork()) == 0) {
395-
COMPILER_WARNING_POP;
396-
397395
umask(0077);
398396
if (mjit_opts.verbose == 0) {
399397
/* CC can be started in a thread using a file which has been
@@ -415,6 +413,7 @@ start_process(const char *path, char *const *argv)
415413
#endif
416414
return pid;
417415
}
416+
COMPILER_WARNING_POP
418417

419418
/* Execute an OS process of executable PATH with arguments ARGV.
420419
Return -1 or -2 if failed to execute, otherwise exit code of the process.

process.c

+10-12
Original file line numberDiff line numberDiff line change
@@ -3959,6 +3959,10 @@ disable_child_handler_fork_child(struct child_handler_disabler_state *old, char
39593959
return 0;
39603960
}
39613961

3962+
COMPILER_WARNING_PUSH
3963+
#ifdef __GNUC__
3964+
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
3965+
#endif
39623966
static rb_pid_t
39633967
retry_fork_async_signal_safe(int *status, int *ep,
39643968
int (*chfunc)(void*, char *, size_t), void *charg,
@@ -3972,10 +3976,6 @@ retry_fork_async_signal_safe(int *status, int *ep,
39723976
while (1) {
39733977
prefork();
39743978
disable_child_handler_before_fork(&old);
3975-
COMPILER_WARNING_PUSH;
3976-
#ifdef __GNUC__
3977-
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
3978-
#endif
39793979
#ifdef HAVE_WORKING_VFORK
39803980
if (!has_privilege())
39813981
pid = vfork();
@@ -3984,7 +3984,6 @@ retry_fork_async_signal_safe(int *status, int *ep,
39843984
#else
39853985
pid = fork();
39863986
#endif
3987-
COMPILER_WARNING_POP;
39883987
if (pid == 0) {/* fork succeed, child process */
39893988
int ret;
39903989
close(ep[0]);
@@ -4009,6 +4008,7 @@ retry_fork_async_signal_safe(int *status, int *ep,
40094008
return -1;
40104009
}
40114010
}
4011+
COMPILER_WARNING_POP
40124012

40134013
rb_pid_t
40144014
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
40404040
return pid;
40414041
}
40424042

4043+
COMPILER_WARNING_PUSH
4044+
#ifdef __GNUC__
4045+
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations)
4046+
#endif
40434047
rb_pid_t
40444048
rb_fork_ruby(int *status)
40454049
{
@@ -4053,14 +4057,7 @@ rb_fork_ruby(int *status)
40534057
prefork();
40544058
disable_child_handler_before_fork(&old);
40554059
before_fork_ruby();
4056-
COMPILER_WARNING_PUSH;
4057-
#ifdef __GNUC__
4058-
COMPILER_WARNING_IGNORED(-Wdeprecated-declarations);
4059-
#endif
40604060
pid = fork();
4061-
#ifdef __GNUC__
4062-
COMPILER_WARNING_POP;
4063-
#endif
40644061
err = errno;
40654062
after_fork_ruby();
40664063
disable_child_handler_fork_parent(&old); /* yes, bad name */
@@ -4071,6 +4068,7 @@ rb_fork_ruby(int *status)
40714068
return -1;
40724069
}
40734070
}
4071+
COMPILER_WARNING_POP
40744072

40754073
#endif
40764074

0 commit comments

Comments
 (0)