From 9ee74087b7f0e0d66dce5eacf050808f5523b51b Mon Sep 17 00:00:00 2001 From: Byoungro So Date: Thu, 1 Jul 2021 19:24:32 -0700 Subject: [PATCH] [SYCL] Fix Windows Shutdown Failure The function DllMain() is missing important attribute, so shutdown was never called before. Signed-off-by: Byoungro So --- sycl/source/detail/global_handler.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sycl/source/detail/global_handler.cpp b/sycl/source/detail/global_handler.cpp index 06cf90b3e11f9..697ee80d9e7a7 100644 --- a/sycl/source/detail/global_handler.cpp +++ b/sycl/source/detail/global_handler.cpp @@ -151,7 +151,9 @@ void shutdown() { } #ifdef _WIN32 -BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) { +extern "C" __SYCL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL, + DWORD fdwReason, + LPVOID lpReserved) { // Perform actions based on the reason for calling. switch (fdwReason) { case DLL_PROCESS_DETACH: