Skip to content

Commit 044221b

Browse files
committed
#ifdef cleanup, japhb++
1 parent f42871d commit 044221b

File tree

1 file changed

+3
-13
lines changed

1 file changed

+3
-13
lines changed

src/vm/parrot/ops/nqp.ops

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -3704,8 +3704,8 @@ inline op nqp_getlexrelcaller(out PMC, in PMC, in STR) :base_core {
37043704
}
37053705

37063706
inline op nqp_delete_f(out INT, in STR) :base_core {
3707-
#ifdef WIN32
37083707
char* const filename = Parrot_str_to_platform_cstring(interp, $2);
3708+
#ifdef WIN32
37093709
DWORD attrs = GetFileAttributesA(filename);
37103710
INTVAL ret;
37113711

@@ -3724,7 +3724,6 @@ inline op nqp_delete_f(out INT, in STR) :base_core {
37243724

37253725
$1 = ret;
37263726
#else
3727-
char* const filename = Parrot_str_to_platform_cstring(interp, $2);
37283727
$1 = unlink(filename);
37293728
#endif
37303729
}
@@ -3740,32 +3739,23 @@ inline op nqp_spawn(out INT, in PMC, in STR, in PMC) {
37403739
}
37413740

37423741
inline op nqp_shell(out INT, in STR, in STR, in PMC) {
3743-
#ifdef WIN32
37443742
STRING *dir = $3;
37453743
PMC *env = $4;
37463744
STRING * const old_cwd = Parrot_file_getcwd(interp);
37473745
PMC * command = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
3746+
#ifdef WIN32
37483747
const STRING *comspec = Parrot_str_new(interp, "ComSpec", 0);
37493748
VTABLE_push_string(interp, command, Parrot_getenv(interp, comspec));
37503749
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "/c"));
3751-
VTABLE_push_string(interp, command, $2);
3752-
3753-
Parrot_file_chdir(interp, dir);
3754-
$1 = Run_OS_Command(interp, command, env);
3755-
Parrot_file_chdir(interp, old_cwd);
37563750
#else
3757-
STRING *dir = $3;
3758-
PMC *env = $4;
3759-
STRING * const old_cwd = Parrot_file_getcwd(interp);
3760-
PMC * command = Parrot_pmc_new(interp, enum_class_ResizableStringArray);
37613751
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "sh"));
37623752
VTABLE_push_string(interp, command, Parrot_str_new_constant(interp, "-c"));
3753+
#endif
37633754
VTABLE_push_string(interp, command, $2);
37643755

37653756
Parrot_file_chdir(interp, dir);
37663757
$1 = Run_OS_Command(interp, command, env);
37673758
Parrot_file_chdir(interp, old_cwd);
3768-
#endif
37693759
}
37703760

37713761
inline op nqp_getenvhash(out PMC) {

0 commit comments

Comments
 (0)