From de8eb56e8851cef0c7aec56594531589f5580a7a Mon Sep 17 00:00:00 2001 From: nobu Date: Mon, 4 Jun 2012 05:46:24 +0000 Subject: [PATCH] merge definitions * process.c (proc_exec_v, rb_proc_exec_e): merge definitions. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- process.c | 28 +++++++++++----------------- 1 file changed, 11 insertions(+), 17 deletions(-) diff --git a/process.c b/process.c index 45b6193859..8b7b7978cf 100644 --- a/process.c +++ b/process.c @@ -1066,16 +1066,13 @@ exec_with_sh(const char *prog, char **argv) #define ALLOC_ARGV_WITH_STR(n, v, s, l) \ (char **)(((s) = ALLOCV_N(char, (v), ARGV_SIZE(n) + (l)) + ARGV_SIZE(n)) - ARGV_SIZE(n)) +static int +proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str) +{ #ifdef __native_client__ -static int -proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str) -{ - rb_notimplement(); -} + rb_notimplement(); + UNREACHABLE; #else -static int -proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str) -{ char **argv; char fbuf[MAXPATHLEN]; # if defined(__EMX__) || defined(OS2) @@ -1133,19 +1130,16 @@ proc_exec_v(const char *prog, VALUE argv_str, VALUE envp_str) } # endif return -1; -} #endif - -#ifdef __native_client__ -static int -rb_proc_exec_e(const char *str, VALUE envp_str) -{ - rb_notimplement(); } -#else + static int rb_proc_exec_e(const char *str, VALUE envp_str) { +#ifdef __native_client__ + rb_notimplement(); + UNREACHABLE; +#else while (*str == ' ' || *str == '\t' || *str == '\n') str++; @@ -1184,8 +1178,8 @@ rb_proc_exec_e(const char *str, VALUE envp_str) #endif return -1; #endif /* _WIN32 */ -} #endif +} int rb_proc_exec(const char *str)