summaryrefslogtreecommitdiffstats
path: root/source/core
diff options
context:
space:
mode:
authorEllie Hermaszewska <ellieh@nvidia.com>2024-12-13 00:34:16 +0800
committerGitHub <noreply@github.com>2024-12-13 00:34:16 +0800
commit48ac6f25ff53290850a0edff0285dc3e1a350ad3 (patch)
tree2388d19d2943980c92a4a719d73a7f1fbbb750d9 /source/core
parent7279c0419409dfe609b0f147df0a7ab357559e69 (diff)
Correctly distinguish between windows and MSVC (#5851)
Partially sorts https://github.com/shader-slang/slang/issues/5843
Diffstat (limited to 'source/core')
-rw-r--r--source/core/slang-allocator.h6
-rw-r--r--source/core/slang-platform.cpp2
-rw-r--r--source/core/slang-secure-crt.h2
3 files changed, 5 insertions, 5 deletions
diff --git a/source/core/slang-allocator.h b/source/core/slang-allocator.h
index 03cfabe40..38d46c9bd 100644
--- a/source/core/slang-allocator.h
+++ b/source/core/slang-allocator.h
@@ -4,7 +4,7 @@
#include "slang-common.h"
#include <stdlib.h>
-#ifdef _MSC_VER
+#if SLANG_WINDOWS_FAMILY
#include <malloc.h>
#endif
@@ -14,7 +14,7 @@ namespace Slang
{
inline void* alignedAllocate(size_t size, size_t alignment)
{
-#ifdef _MSC_VER
+#if SLANG_WINDOWS_FAMILY
return _aligned_malloc(size, alignment);
#elif defined(__CYGWIN__)
return aligned_alloc(alignment, size);
@@ -27,7 +27,7 @@ inline void* alignedAllocate(size_t size, size_t alignment)
inline void alignedDeallocate(void* ptr)
{
-#ifdef _MSC_VER
+#if SLANG_WINDOWS_FAMILY
_aligned_free(ptr);
#else
free(ptr);
diff --git a/source/core/slang-platform.cpp b/source/core/slang-platform.cpp
index 79b883e39..51f6b97c7 100644
--- a/source/core/slang-platform.cpp
+++ b/source/core/slang-platform.cpp
@@ -157,7 +157,7 @@ SLANG_COMPILE_TIME_ASSERT(E_OUTOFMEMORY == SLANG_E_OUT_OF_MEMORY);
/* static */ void* SharedLibrary::findSymbolAddressByName(Handle handle, char const* name)
{
SLANG_ASSERT(handle);
- return GetProcAddress((HMODULE)handle, name);
+ return reinterpret_cast<void*>(GetProcAddress((HMODULE)handle, name));
}
/* static */ void SharedLibrary::appendPlatformFileName(
diff --git a/source/core/slang-secure-crt.h b/source/core/slang-secure-crt.h
index 57e38f0dd..607fc7a73 100644
--- a/source/core/slang-secure-crt.h
+++ b/source/core/slang-secure-crt.h
@@ -1,4 +1,4 @@
-#ifndef _MSC_VER
+#ifndef _WIN32
#ifndef SLANG_CORE_SECURE_CRT_H
#define SLANG_CORE_SECURE_CRT_H
#include <assert.h>