@@ -266,6 +266,49 @@ index 0000000000..e5b5de8952
266
266
+ The port in-progress is being done by Gavin Hayes <[email protected] >
267
267
+
268
268
+ Last update: 2022-10-11
269
+ diff --git a/caretx.c b/caretx.c
270
+ index 3d11877037..211a2e89a7 100644
271
+ --- a/caretx.c
272
+ +++ b/caretx.c
273
+ @@ -40,6 +40,10 @@
274
+ # include <mach-o/dyld.h>
275
+ #endif
276
+
277
+ + #if defined(__COSMOPOLITAN__)
278
+ + # include "libc/cosmo.h"
279
+ + #endif
280
+ +
281
+ void
282
+ Perl_set_caret_X(pTHX) {
283
+ GV* tmpgv = gv_fetchpvs("\030", GV_ADD|GV_NOTQUAL, SVt_PV); /* $^X */
284
+ @@ -55,6 +59,9 @@ Perl_set_caret_X(pTHX) {
285
+ sv_setpv(caret_x, ansi);
286
+ win32_free(ansi);
287
+ return;
288
+ + #elif defined(__COSMOPOLITAN__)
289
+ + sv_setpv(caret_x, GetProgramExecutableName());
290
+ + return;
291
+ #else
292
+ /* We can try a platform-specific one if possible; if it fails, or we
293
+ * aren't running on a suitable platform, we'll fall back to argv[0]. */
294
+ diff --git a/configpm b/configpm
295
+ index 94a4778037..2f7ab82600 100755
296
+ --- a/configpm
297
+ +++ b/configpm
298
+ @@ -585,6 +585,13 @@ $heavy_txt .= join('',
299
+ } @v_others, @v_forced
300
+ ) . "!END!\n";
301
+
302
+ + if ($^O eq 'cosmo') {
303
+ + $heavy_txt .= <<'EOT';
304
+ +
305
+ + s/perlpath=.+/perlpath='$^X'/;
306
+ + EOT
307
+ + }
308
+ +
309
+ # Only need the dynamic byteorder code in Config.pm if 'byteorder' is one of
310
+ # the precached keys
311
+ if ($Common{byteorder}) {
269
312
diff --git a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm b/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
270
313
index 0aee5233fe..cd17c1c86f 100644
271
314
--- a/cpan/ExtUtils-Constant/lib/ExtUtils/Constant/ProxySubs.pm
@@ -481,23 +524,22 @@ index 6a7f03c289..38844079d0 100644
481
524
# endif /* OS2 */
482
525
# endif /* WIN32 */
483
526
diff --git a/doio.c b/doio.c
484
- index f0d451af3c..63dce797fa 100644
527
+ index f0d451af3c..c7e76d0512 100644
485
528
--- a/doio.c
486
529
+++ b/doio.c
487
- @@ -55,6 +55,12 @@
530
+ @@ -55,6 +55,11 @@
488
531
# define OPEN_EXCL 0
489
532
#endif
490
533
491
534
+ #ifdef __COSMOPOLITAN__
492
- + # define _COSMO_SOURCE
493
535
+ # include "libc/dce.h"
494
- + void __paginate_file(int fd, const char *s);
536
+ + # include "libc/runtime/runtime.h"
495
537
+ #endif
496
538
+
497
539
#define PERL_MODE_MAX 8
498
540
#define PERL_FLAGS_MAX 10
499
541
500
- @@ -2512,7 +2518 ,24 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
542
+ @@ -2512,7 +2517 ,24 @@ Perl_do_exec3(pTHX_ const char *incmd, int fd, int do_report)
501
543
}
502
544
doshell:
503
545
PERL_FPU_PRE_EXEC
0 commit comments