Skip to content

Commit

Permalink
Merge pull request #43 from h2o/master
Browse files Browse the repository at this point in the history
Get windows fixes
  • Loading branch information
huitema authored Apr 1, 2019
2 parents 283d3e3 + 8999649 commit cc54ee1
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 10 deletions.
2 changes: 1 addition & 1 deletion picotlsvs/picotls/wintimeofday.c
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ int wintimeofday(struct timeval* tv, struct timezone* tz)
* of 100-nanosecond intervals since January 1, 1601 (UTC),
* in FILETIME format.
*/
GetSystemTimeAsFileTime(&ft);
GetSystemTimePreciseAsFileTime(&ft);

/*
* Convert to plain 64 bit format, without making
Expand Down
4 changes: 2 additions & 2 deletions picotlsvs/picotlsvs/picotlsvs.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -142,7 +142,7 @@
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down
4 changes: 2 additions & 2 deletions picotlsvs/ptlsbench/ptlsbench.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
<Link>
<SubSystem>Console</SubSystem>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -161,7 +161,7 @@
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<GenerateDebugInformation>true</GenerateDebugInformation>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down
4 changes: 2 additions & 2 deletions picotlsvs/testopenssl/testopenssl.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
</ClCompile>
<Link>
<SubSystem>Console</SubSystem>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down Expand Up @@ -146,7 +146,7 @@
<SubSystem>Console</SubSystem>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>$(OPENSSL64DIR);$(OPENSSL64DIR)\lib;$(OutDir);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>picotls.lib;cifra.lib;microecc.lib;libcrypto.lib;bcrypt.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>
Expand Down
7 changes: 4 additions & 3 deletions t/ptlsbench.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,19 @@ static int bench_run_aead(char * OS, char * HW, int basic_ref, uint64_t s0, con
if (strcmp(provider, "openssl") == 0) {
/*
* OPENSSL_VERSION_NUMBER is a combination of the major, minor and patch version
* into a single integer 0xMNN00PP0L, where M is major, NN is minor, PP is patch
* into a single integer 0xMNNFFPP0L, where M is major, NN is minor, PP is patch
*/
uint32_t combined = OPENSSL_VERSION_NUMBER;
int M = combined >> 28;
int NN = (combined >> 20) & 0xFF;
int FF = (combined >> 12) & 0xFF;
int PP = (combined >> 4) & 0xFF;
char letter = 'a' - 1 + PP;

#ifdef _WINDOWS
(void)sprintf_s(p_version, sizeof(p_version), "%d.%d.0%c", M, NN, letter);
(void)sprintf_s(p_version, sizeof(p_version), "%d.%d.%d%c", M, NN, FF, letter);
#else
(void)sprintf(p_version, "%d.%d.0%c", M, NN, letter);
(void)sprintf(p_version, "%d.%d.%d%c", M, NN, FF, letter);
#endif
}

Expand Down

0 comments on commit cc54ee1

Please sign in to comment.