mirror of
https://github.com/elasota/Aerofoil.git
synced 2025-09-23 14:53:52 +00:00
Switch timestamp format to combined UTC + local so fewer stupid hacks are required.
This commit is contained in:
@@ -2,6 +2,8 @@
|
||||
#include <stdio.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "CombinedTimestamp.h"
|
||||
|
||||
int main(int argc, const char **argv)
|
||||
{
|
||||
if (argc != 2)
|
||||
@@ -39,11 +41,29 @@ int main(int argc, const char **argv)
|
||||
return -1;
|
||||
}
|
||||
|
||||
uint8_t encodedTimestamp[8];
|
||||
for (int i = 0; i < 8; i++)
|
||||
encodedTimestamp[i] = static_cast<uint8_t>((timeDelta >> (i * 8)) & 0xff);
|
||||
TIME_ZONE_INFORMATION tz;
|
||||
GetTimeZoneInformation(&tz);
|
||||
|
||||
fwrite(encodedTimestamp, 8, 1, f);
|
||||
SYSTEMTIME utcST;
|
||||
FileTimeToSystemTime(×tampFT, &utcST);
|
||||
|
||||
SYSTEMTIME localST;
|
||||
SystemTimeToTzSpecificLocalTime(&tz, &utcST, &localST);
|
||||
|
||||
PortabilityLayer::CombinedTimestamp ts;
|
||||
ts.SetUTCTime(timeDelta);
|
||||
|
||||
ts.SetLocalYear(localST.wYear);
|
||||
ts.m_localMonth = localST.wMonth;
|
||||
ts.m_localDay = localST.wDay;
|
||||
|
||||
ts.m_localHour = localST.wHour;
|
||||
ts.m_localMinute = localST.wMinute;
|
||||
ts.m_localSecond = localST.wSecond;
|
||||
|
||||
memset(ts.m_padding, 0, sizeof(ts.m_padding));
|
||||
|
||||
fwrite(&ts, sizeof(ts), 1, f);
|
||||
|
||||
fclose(f);
|
||||
|
||||
|
@@ -58,15 +58,19 @@
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="..\PortabilityLayer.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup />
|
||||
|
Reference in New Issue
Block a user