openoffice-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dam...@apache.org
Subject svn commit: r1853022 - /openoffice/trunk/main/rsc/source/rscpp/cpp3.c
Date Tue, 05 Feb 2019 18:08:21 GMT
Author: damjan
Date: Tue Feb  5 18:08:21 2019
New Revision: 1853022

URL: http://svn.apache.org/viewvc?rev=1853022&view=rev
Log:
Use native time_t instead of a 32-bit-capped long, which breaks on Win64.

>From source/rscpp/cppdef.h:
 * OK_DATE      Predefines the compilation date if set TRUE.
 *              Not permitted by the Nov. 12, 1984 Draft Standard.


In 1984 there might have been reason to doubt whether time_t will
exist on various systems, but in 2019 we can be certain that it does.

Patch by: me


Modified:
    openoffice/trunk/main/rsc/source/rscpp/cpp3.c

Modified: openoffice/trunk/main/rsc/source/rscpp/cpp3.c
URL: http://svn.apache.org/viewvc/openoffice/trunk/main/rsc/source/rscpp/cpp3.c?rev=1853022&r1=1853021&r2=1853022&view=diff
==============================================================================
--- openoffice/trunk/main/rsc/source/rscpp/cpp3.c (original)
+++ openoffice/trunk/main/rsc/source/rscpp/cpp3.c Tue Feb  5 18:08:21 2019
@@ -20,10 +20,6 @@
  *************************************************************/
 
 
-#if defined(_MSC_VER) && (_MSC_VER > 1310)
-#define _USE_32BIT_TIME_T
-#endif
-
 #include        <stdio.h>
 #ifdef UNX
 #include        <stdlib.h>
@@ -462,7 +458,7 @@ void initdefines()
         register char           *tp;
         register DEFBUF         *dp;
         int                     i;
-        long                    tvec;
+        time_t                  tvec;
 
 #if !defined( ZTC ) && !defined( WNT ) && !defined(BLC) && !defined(G3)
         extern char             *ctime();
@@ -500,9 +496,9 @@ void initdefines()
             dp = defendel("__DATE__", FALSE);
             dp->repl = tp = getmem(27);
             dp->nargs = DEF_NOARGS;
-            time( (time_t*)&tvec);
+            time(&tvec);
             *tp++ = '"';
-            strcpy(tp, ctime((const time_t*)&tvec));
+            strcpy(tp, ctime(&tvec));
             tp[24] = '"';                       /* Overwrite newline    */
 #endif
         }



Mime
View raw message