VirtualBox

Changeset 102225 in vbox


Ignore:
Timestamp:
Nov 22, 2023 8:54:21 AM (12 months ago)
Author:
vboxsync
Message:

libs/xpcom: Remove use PR_Now() and get rid of it, bugref:10545

Location:
trunk/src/libs/xpcom18a4
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/private/primpl.h

    r102216 r102225  
    130130#define    _PR_MD_FINAL_INIT _MD_FINAL_INIT
    131131
    132 /* Current Time */
    133 NSPR_API(PRTime) _PR_MD_NOW(void);
    134 #define    _PR_MD_NOW _MD_NOW
    135 
    136132/* Time intervals */
    137133
  • trunk/src/libs/xpcom18a4/nsprpub/pr/include/prtime.h

    r102223 r102225  
    5151#include "prlong.h"
    5252
    53 #ifdef VBOX_WITH_XPCOM_NAMESPACE_CLEANUP
    54 #define PR_Now VBoxNsprPR_Now
    55 #endif /* VBOX_WITH_XPCOM_NAMESPACE_CLEANUP */
    56 
    5753PR_BEGIN_EXTERN_C
    5854
     
    6359#define PR_MSEC_PER_SEC         1000UL
    6460#define PR_USEC_PER_SEC         1000000UL
    65 #define PR_NSEC_PER_SEC         1000000000UL
    6661#define PR_USEC_PER_MSEC        1000UL
    67 #define PR_NSEC_PER_MSEC        1000000UL
    6862
    6963/*
     
    8478typedef PRInt64 PRTime;
    8579
    86 /**********************************************************************/
    87 /****************************** FUNCTIONS *****************************/
    88 /**********************************************************************/
    89 
    90 /*
    91  * The PR_Now routine returns the current time relative to the
    92  * epoch, midnight, January 1, 1970 UTC. The units of the returned
    93  * value are microseconds since the epoch.
    94  *
    95  * The values returned are not guaranteed to advance in a linear fashion
    96  * due to the application of time correction protocols which synchronize
    97  * computer clocks to some external time source. Consequently it should
    98  * not be depended on for interval timing.
    99  *
    100  * The implementation is machine dependent.
    101  * Cf. time_t time(time_t *tp) in ANSI C.
    102  */
    103 #if defined(HAVE_WATCOM_BUG_2)
    104 PRTime __pascal __export __loadds
    105 #else
    106 NSPR_API(PRTime)
    107 #endif
    108 PR_Now(void);
    109 
    11080PR_END_EXTERN_C
    11181
  • trunk/src/libs/xpcom18a4/nsprpub/pr/src/md/unix/unix.c

    r102198 r102225  
    6060    rv = sigaction(SIGPIPE, &sigact, 0);
    6161    Assert(0 == rv);
    62 }
    63 
    64 /*
    65  *-----------------------------------------------------------------------
    66  *
    67  * PR_Now --
    68  *
    69  *     Returns the current time in microseconds since the epoch.
    70  *     The epoch is midnight January 1, 1970 GMT.
    71  *     The implementation is machine dependent.  This is the Unix
    72  *     implementation.
    73  *     Cf. time_t time(time_t *tp)
    74  *
    75  *-----------------------------------------------------------------------
    76  */
    77 
    78 PR_IMPLEMENT(PRTime)
    79 PR_Now(void)
    80 {
    81     struct timeval tv;
    82     PRInt64 s, us, s2us;
    83 
    84     GETTIMEOFDAY(&tv);
    85     LL_I2L(s2us, PR_USEC_PER_SEC);
    86     LL_I2L(s, tv.tv_sec);
    87     LL_I2L(us, tv.tv_usec);
    88     LL_MUL(s, s, s2us);
    89     LL_ADD(s, s, us);
    90     return s;
    9162}
    9263
  • trunk/src/libs/xpcom18a4/xpcom/build/nsXPComInit.cpp

    r102122 r102225  
    3737
    3838#include <iprt/initterm.h>
     39#include <iprt/time.h>
    3940
    4041#include "nsXPCOM.h"
     
    690691                                    NS_GET_IID(nsIFile),
    691692                                    getter_AddRefs(compregFile));
    692         compregFile->SetLastModifiedTime(PR_Now() / 1000);
     693        RTTIMESPEC Time;
     694        RTTimeNow(&Time);
     695        compregFile->SetLastModifiedTime(RTTimeSpecGetMilli(&Time));
    693696    }
    694697
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette