diff options
author | Aaron Crane <arc@cpan.org> | 2017-10-13 15:59:59 +0200 |
---|---|---|
committer | Aaron Crane <arc@cpan.org> | 2017-10-21 16:53:06 +0100 |
commit | fca5fb9612a125f48173bedf2c079778d7bc54dd (patch) | |
tree | 08bcc0c17d8546c0ecb2c03c0c3ec86e9cdd2185 /caretx.c | |
parent | f12ee906ec242232139e92b04197e9f8a17e3f27 (diff) | |
download | perl-fca5fb9612a125f48173bedf2c079778d7bc54dd.tar.gz |
caretx.c: simplify cpp conditionals
Diffstat (limited to 'caretx.c')
-rw-r--r-- | caretx.c | 11 |
1 files changed, 5 insertions, 6 deletions
@@ -56,8 +56,7 @@ Perl_set_caret_X(pTHX) { SV *const caret_x = GvSV(tmpgv); #if defined(OS2) sv_setpv(caret_x, os2_execname(aTHX)); -#else -# ifdef USE_KERN_PROC_PATHNAME +#elif defined(USE_KERN_PROC_PATHNAME) size_t size = 0; int mib[4]; mib[0] = CTL_KERN; @@ -77,7 +76,7 @@ Perl_set_caret_X(pTHX) { return; } } -# elif defined(USE_NSGETEXECUTABLEPATH) +#elif defined(USE_NSGETEXECUTABLEPATH) char buf[1]; uint32_t size = sizeof(buf); @@ -96,7 +95,7 @@ Perl_set_caret_X(pTHX) { return; } } -# elif defined(HAS_PROCSELFEXE) +#elif defined(HAS_PROCSELFEXE) char buf[MAXPATHLEN]; SSize_t len = readlink(PROCSELFEXE_PATH, buf, sizeof(buf) - 1); /* NOTE: if the length returned by readlink() is sizeof(buf) - 1, @@ -126,7 +125,7 @@ Perl_set_caret_X(pTHX) { sv_setpvn(caret_x, buf, len); return; } -# elif defined(WIN32) +#elif defined(WIN32) char *ansi; WCHAR widename[MAX_PATH]; GetModuleFileNameW(NULL, widename, sizeof(widename)/sizeof(WCHAR)); @@ -134,7 +133,7 @@ Perl_set_caret_X(pTHX) { sv_setpv(caret_x, ansi); win32_free(ansi); return; -# endif +#else /* Fallback to this: */ sv_setpv(caret_x, PL_origargv[0]); #endif |