summaryrefslogtreecommitdiff
path: root/time64.c
diff options
context:
space:
mode:
authorCraig A. Berry <craigberry@mac.com>2014-06-27 07:58:42 -0500
committerCraig A. Berry <craigberry@mac.com>2014-06-27 07:58:42 -0500
commitc97ab48957e7f73939e2a77e6312b44dc2408398 (patch)
tree8f1a305ff16bd91a0c34e31e6e1f00792079f435 /time64.c
parentae7c5b9bcea1e06708978024a3f9c6409468ad51 (diff)
downloadperl-c97ab48957e7f73939e2a77e6312b44dc2408398.tar.gz
Time functions in time64.c need thread context on VMS.
In order to support the C<vmsish 'time'> pragma, the wrappers for gmtime and localtime need thread context, which in the case of localtime was removed in 23491f1decae17401c5. Add it back but make it VMS-specific and turn the comment indicating why it's there into a more direct statement.
Diffstat (limited to 'time64.c')
-rw-r--r--time64.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/time64.c b/time64.c
index 555286b5e0..74914bdcf7 100644
--- a/time64.c
+++ b/time64.c
@@ -300,8 +300,8 @@ static void S_copy_little_tm_to_big_TM(const struct tm *src, struct TM *dest) {
#ifndef HAS_LOCALTIME_R
/* Simulate localtime_r() to the best of our ability */
static struct tm * S_localtime_r(const time_t *clock, struct tm *result) {
-#ifdef VMS
- dTHX; /* in case the following is defined as Perl_my_localtime(aTHX_ ...) */
+#ifdef __VMS
+ dTHX; /* the following is defined as Perl_my_localtime(aTHX_ ...) */
#endif
const struct tm *static_result = localtime(clock);
@@ -321,6 +321,9 @@ static struct tm * S_localtime_r(const time_t *clock, struct tm *result) {
#ifndef HAS_GMTIME_R
/* Simulate gmtime_r() to the best of our ability */
static struct tm * S_gmtime_r(const time_t *clock, struct tm *result) {
+#ifdef __VMS
+ dTHX; /* the following is defined as Perl_my_localtime(aTHX_ ...) */
+#endif
const struct tm *static_result = gmtime(clock);
assert(result != NULL);