--- ./caretx.c.orig 2018-05-21 12:29:23.000000000 +0000 +++ ./caretx.c 2018-09-28 14:05:46.785353073 +0000 @@ -56,7 +56,8 @@ Perl_set_caret_X(pTHX) { SV *const caret_x = GvSV(tmpgv); #if defined(OS2) sv_setpv(caret_x, os2_execname(aTHX)); -#elif defined(USE_KERN_PROC_PATHNAME) +#else +# ifdef USE_KERN_PROC_PATHNAME size_t size = 0; int mib[4]; mib[0] = CTL_KERN; @@ -76,7 +77,7 @@ Perl_set_caret_X(pTHX) { return; } } -#elif defined(USE_NSGETEXECUTABLEPATH) +# elif defined(USE_NSGETEXECUTABLEPATH) char buf[1]; uint32_t size = sizeof(buf); @@ -95,7 +96,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, @@ -125,7 +126,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)); @@ -133,7 +134,7 @@ Perl_set_caret_X(pTHX) { sv_setpv(caret_x, ansi); win32_free(ansi); return; -#else +# endif /* Fallback to this: */ sv_setpv(caret_x, PL_origargv[0]); #endif