MCPcopy Create free account
hub / github.com/boostorg/build / timestamp_from_filetime

Function timestamp_from_filetime

v2/engine/timestamp.c:82–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 */
81
82void timestamp_from_filetime( timestamp * const t, FILETIME const * const ft )
83{
84 /* Seconds between 1.1.1601 and 1.1.1970 */
85 static __int64 const secs_between_epochs = 11644473600;
86
87 /* We can not simply cast and dereference a FILETIME, since it might not be
88 * aligned properly. __int64 type variables are expected to be aligned to an
89 * 8 byte boundary while FILETIME structures may be aligned to any 4 byte
90 * boundary. Using an incorrectly aligned __int64 variable may cause a
91 * performance penalty on some platforms or even exceptions on others
92 * (documented on MSDN).
93 */
94 __int64 in;
95 memcpy( &in, ft, sizeof( in ) );
96
97 /* FILETIME resolution: 100ns. */
98 timestamp_init( t, (time_t)( ( in / 10000000 ) - secs_between_epochs ),
99 (int)( in % 10000000 ) * 100 );
100}
101#endif /* OS_NT */
102
103

Callers 4

timestamp_currentFunction · 0.85
record_timesFunction · 0.85
try_file_query_rootFunction · 0.85

Calls 1

timestamp_initFunction · 0.85

Tested by

no test coverage detected