1 | /* most win32 perls are beyond fixing, requiring dTHX */ |
1 | /* most win32 perls are beyond fixing, requiring dTHX */ |
2 | /* even for ISO-C functions such as malloc. avoid! avoid! avoid! */ |
2 | /* even for ISO-C functions such as malloc. avoid! avoid! avoid! */ |
3 | /* and fial to define numerous symbols, but still overrwide them */ |
3 | /* and fail to define numerous symbols, but still overrwide them */ |
4 | /* with non-working versions (e.g. setjmp). */ |
4 | /* with non-working versions (e.g. setjmp). */ |
5 | #ifdef _WIN32 |
5 | #ifdef _WIN32 |
6 | # define PERL_CORE 1 |
6 | /*# define PERL_CORE 1 fixes some, breaks others */ |
7 | #else |
7 | #else |
8 | # define PERL_NO_GET_CONTEXT |
8 | # define PERL_NO_GET_CONTEXT |
9 | #endif |
9 | #endif |
10 | |
10 | |
11 | #include "EXTERN.h" |
11 | #include "EXTERN.h" |
… | |
… | |
360 | |
360 | |
361 | void |
361 | void |
362 | sleep (NV seconds) |
362 | sleep (NV seconds) |
363 | CODE: |
363 | CODE: |
364 | perlinterp_release (); |
364 | perlinterp_release (); |
365 | usleep (seconds * 1e6); |
365 | { |
|
|
366 | int nsec = seconds; |
|
|
367 | if (nsec) sleep (nsec); |
|
|
368 | nsec = (seconds - nsec) * 1e9; |
|
|
369 | if (nsec) usleep (nsec); |
|
|
370 | } |
366 | perlinterp_acquire (); |
371 | perlinterp_acquire (); |
367 | |
372 | |