Skip to content

Commit 1f75f63

Browse files
committed
Address PR review comments
- phc.c: invert the _MSC_VER condition so the POSIX include block comes first (#ifndef _MSC_VER), with the MSVC shim under #else. - README: fix the "On Windows." heading to use a tab like other headings instead of 4 spaces. Per review on openwall/yescrypt PR #11.
1 parent 28b4e25 commit 1f75f63

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

README

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ of output.
124124
We do most of our testing on Linux systems with gcc. The supplied
125125
Makefile assumes that you use gcc.
126126

127-
On Windows.
127+
On Windows.
128128

129129
A PowerShell script, build.ps1, is provided to build yescrypt with the
130130
MSVC toolchain. It requires Visual Studio Community 2026 with the

phc.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,10 @@ int PHS(void *out, size_t outlen, const void *in, size_t inlen,
5252

5353
#ifdef TEST
5454
#include <stdio.h>
55-
#ifdef _MSC_VER
55+
#ifndef _MSC_VER
56+
#include <unistd.h> /* for sysconf() */
57+
#include <sys/times.h>
58+
#else
5659
/*
5760
* MSVC lacks the POSIX <unistd.h> and <sys/times.h> interfaces used for timing
5861
* below. Provide a minimal Win32-based shim; the timing it produces is only
@@ -102,9 +105,6 @@ static clock_t times(struct tms *buf)
102105
QueryPerformanceCounter(&now);
103106
return (clock_t)(now.QuadPart * 1000 / freq.QuadPart);
104107
}
105-
#else
106-
#include <unistd.h> /* for sysconf() */
107-
#include <sys/times.h>
108108
#endif
109109

110110
static void print_hex(const uint8_t *buf, size_t buflen, const char *sep)

0 commit comments

Comments
 (0)