| OLD | NEW |
| 1 diff --git a/Include/datetime.h b/Include/datetime.h | 1 diff --git a/Include/datetime.h b/Include/datetime.h |
| 2 --- a/Include/datetime.h | 2 --- a/Include/datetime.h |
| 3 +++ b/Include/datetime.h | 3 +++ b/Include/datetime.h |
| 4 @@ -166,6 +166,8 @@ typedef struct { | 4 @@ -166,6 +166,8 @@ typedef struct { |
| 5 | 5 |
| 6 #ifdef Py_BUILD_CORE | 6 #ifdef Py_BUILD_CORE |
| 7 | 7 |
| 8 +#define PyDataTime_STATIC 1 | 8 +#define PyDataTime_STATIC 1 |
| 9 + | 9 + |
| 10 /* Macros for type checking when building the Python core. */ | 10 /* Macros for type checking when building the Python core. */ |
| (...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 +} | 416 +} |
| 417 +#define getpwuid my_getpwuid | 417 +#define getpwuid my_getpwuid |
| 418 +#endif | 418 +#endif |
| 419 + | 419 + |
| 420 PyDoc_STRVAR(pwd_getpwuid__doc__, | 420 PyDoc_STRVAR(pwd_getpwuid__doc__, |
| 421 "getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\ | 421 "getpwuid(uid) -> (pw_name,pw_passwd,pw_uid,\n\ |
| 422 pw_gid,pw_gecos,pw_dir,pw_shell)\n\ | 422 pw_gid,pw_gecos,pw_dir,pw_shell)\n\ |
| 423 diff --git a/Modules/python.c b/Modules/python.c | 423 diff --git a/Modules/python.c b/Modules/python.c |
| 424 --- a/Modules/python.c | 424 --- a/Modules/python.c |
| 425 +++ b/Modules/python.c | 425 +++ b/Modules/python.c |
| 426 @@ -6,6 +6,36 @@ | 426 @@ -6,6 +6,12 @@ |
| 427 #include <floatingpoint.h> | 427 #include <floatingpoint.h> |
| 428 #endif | 428 #endif |
| 429 | 429 |
| 430 +#ifdef __native_client__ | 430 +#ifdef __native_client__ |
| 431 +#define main nacl_main | 431 +#define main nacl_main |
| 432 +#include <stdio.h> | 432 +#include <stdio.h> |
| 433 +#include <sys/utsname.h> | 433 +#include <sys/utsname.h> |
| 434 + | |
| 435 +// Stubs for functions implemented through PPAPI. | |
| 436 +int spawnv(int mode, const char* path, char *const argv[]) { | |
| 437 + return 0; | |
| 438 +} | |
| 439 + | |
| 440 +int spawnve(int mode, const char* path, | |
| 441 + char *const argv[], char *const envp[]) { | |
| 442 + return 0; | |
| 443 +} | |
| 444 + | |
| 445 +// Dummy implementation of uname. This is only needed for the sel_ldr | |
| 446 +// version of python. Otherwise it gets provided by nacl_io. | |
| 447 +int uname(struct utsname *buf) | |
| 448 +{ | |
| 449 + sprintf(buf->sysname, "NaCl"); | |
| 450 + return 0; | |
| 451 +} | |
| 452 +#endif | 434 +#endif |
| 453 + | 435 + |
| 454 +// Dummy implementation of nacl_spawn_vfork_exit, otherwise provided | |
| 455 +// by nacl_spawn. | |
| 456 +void nacl_spawn_vfork_exit(int status) { | |
| 457 + _exit(status); | |
| 458 +} | |
| 459 + | |
| 460 int | 436 int |
| 461 main(int argc, char **argv) | 437 main(int argc, char **argv) |
| 462 { | 438 { |
| 463 @@ -20,5 +44,9 @@ main(int argc, char **argv) | 439 @@ -20,5 +26,9 @@ main(int argc, char **argv) |
| 464 m = fpgetmask(); | 440 m = fpgetmask(); |
| 465 fpsetmask(m & ~FP_X_OFL); | 441 fpsetmask(m & ~FP_X_OFL); |
| 466 #endif | 442 #endif |
| 467 +#ifdef __native_client__ | 443 +#ifdef __native_client__ |
| 468 + setvbuf(stdout, NULL, _IOLBF, 0); | 444 + setvbuf(stdout, NULL, _IOLBF, 0); |
| 469 + setvbuf(stdin, NULL, _IOLBF, 0); | 445 + setvbuf(stdin, NULL, _IOLBF, 0); |
| 470 +#endif | 446 +#endif |
| 471 return Py_Main(argc, argv); | 447 return Py_Main(argc, argv); |
| 472 } | 448 } |
| 473 diff --git a/Modules/timemodule.c b/Modules/timemodule.c | 449 diff --git a/Modules/timemodule.c b/Modules/timemodule.c |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 OpenUNIX*|UnixWare*) | 708 OpenUNIX*|UnixWare*) |
| 733 @@ -2121,7 +2140,7 @@ then | 709 @@ -2121,7 +2140,7 @@ then |
| 734 LINKFORSHARED="-Wl,-E -Wl,+s";; | 710 LINKFORSHARED="-Wl,-E -Wl,+s";; |
| 735 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; | 711 # LINKFORSHARED="-Wl,-E -Wl,+s -Wl,+b\$(BINLIBDEST)/lib-dynload";; |
| 736 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; | 712 BSD/OS/4*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 737 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; | 713 - Linux*|GNU*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 738 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";; | 714 + Linux*|GNU*|NaCl*) LINKFORSHARED="-Xlinker -export-dynamic";; |
| 739 # -u libsys_s pulls in all symbols in libsys | 715 # -u libsys_s pulls in all symbols in libsys |
| 740 Darwin/*) | 716 Darwin/*) |
| 741 # -u _PyMac_Error is needed to pull in the mac toolbox glue, | 717 # -u _PyMac_Error is needed to pull in the mac toolbox glue, |
| OLD | NEW |