indent has problems with comments that are on the right hand side of a line.
[openssl.git] / crypto / o_time.c
index eecbdd19f0cd2ae0bdad1b2373ad06a26dcabac7..052a7f8c74ef631f77033054f4f4b641eb34683e 100644 (file)
 #include "o_time.h"
 
 #ifdef OPENSSL_SYS_VMS
-# include <libdtdef.h>
-# include <lib$routines.h>
-# include <lnmdef.h>
-# include <starlet.h>
-# include <descrip.h>
-# include <stdlib.h>
+# if __CRTL_VER >= 70000000 && \
+     (defined _POSIX_C_SOURCE || !defined _ANSI_C_SOURCE)
+#  define VMS_GMTIME_OK
+# endif
+# ifndef VMS_GMTIME_OK
+#  include <libdtdef.h>
+#  include <lib$routines.h>
+#  include <lnmdef.h>
+#  include <starlet.h>
+#  include <descrip.h>
+#  include <stdlib.h>
+# endif /* ndef VMS_GMTIME_OK */
 #endif
 
 struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
@@ -81,7 +87,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
           so we don't even look at the return value */
        gmtime_r(timer,result);
        ts = result;
-#elif !defined(OPENSSL_SYS_VMS)
+#elif !defined(OPENSSL_SYS_VMS) || defined(VMS_GMTIME_OK)
        ts = gmtime(timer);
        if (ts == NULL)
                return NULL;
@@ -89,7 +95,7 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
        memcpy(result, ts, sizeof(struct tm));
        ts = result;
 #endif
-#ifdef OPENSSL_SYS_VMS
+#if defined( OPENSSL_SYS_VMS) && !defined( VMS_GMTIME_OK)
        if (ts == NULL)
                {
                static $DESCRIPTOR(tabnam,"LNM$DCL_LOGICAL");
@@ -142,7 +148,8 @@ struct tm *OPENSSL_gmtime(const time_t *timer, struct tm *result)
                /* Since there was no gmtime_r() to do this stuff for us,
                   we have to do it the hard way. */
                {
-               /* The VMS epoch is the astronomical Smithsonian date,
+               /*-
+                * The VMS epoch is the astronomical Smithsonian date,
                   if I remember correctly, which is November 17, 1858.
                   Furthermore, time is measure in thenths of microseconds
                   and stored in quadwords (64 bit integers).  unix_epoch