From 187f1ec8b3bf0f78f5986d6f25b95e1ffab26fb9 Mon Sep 17 00:00:00 2001 From: Tomas Rylek Date: Sun, 22 Sep 2019 21:23:54 +0200 Subject: [PATCH] Address JanK's PR feedback I fulltext-searched CoreCLR source code and I have found almost no conditional checks for Windows. I ended up using _WINNT_ and it seems to work. Thanks Tomas --- src/coreclr/hosts/corerun/corerun.cpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/coreclr/hosts/corerun/corerun.cpp b/src/coreclr/hosts/corerun/corerun.cpp index 3e60cdf907d4..d5e58264b22b 100644 --- a/src/coreclr/hosts/corerun/corerun.cpp +++ b/src/coreclr/hosts/corerun/corerun.cpp @@ -459,18 +459,18 @@ bool TryLoadHostPolicy(StackSString& hostPolicyPath) } // Use proper prefix / extension for the host policy dynamic library -#if defined(__APPLE__) +#if defined(_WINNT_) + static const WCHAR LibraryPrefix[] = L""; + static const WCHAR LibrarySuffix[] = L".dll"; + static const WCHAR PathSeparator = L'\\'; +#elif defined(__APPLE__) static const WCHAR LibraryPrefix[] = u"lib"; static const WCHAR LibrarySuffix[] = u".dylib"; static const WCHAR PathSeparator = u'/'; -#elif defined(__linux__) || defined(__FreeBSD__) || defined(__NetBSD__) +#else // Various Linux-related OS-es static const WCHAR LibraryPrefix[] = u"lib"; static const WCHAR LibrarySuffix[] = u".so"; static const WCHAR PathSeparator = u'/'; -#else - static const WCHAR LibraryPrefix[] = L""; - static const WCHAR LibrarySuffix[] = L".dll"; - static const WCHAR PathSeparator = L'\\'; #endif SString::CIterator fileNamePos = hostPolicyPath.End();