Skip to content

Commit 1dea757

Browse files
authored
[SYCL] Fix Windows Shutdown Failure (#4040)
The function DllMain() is missing important attribute, so shutdown was never called before. Signed-off-by: Byoungro So <[email protected]>
1 parent 4236bbb commit 1dea757

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sycl/source/detail/global_handler.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,9 @@ void shutdown() {
151151
}
152152

153153
#ifdef _WIN32
154-
BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpReserved) {
154+
extern "C" __SYCL_EXPORT BOOL WINAPI DllMain(HINSTANCE hinstDLL,
155+
DWORD fdwReason,
156+
LPVOID lpReserved) {
155157
// Perform actions based on the reason for calling.
156158
switch (fdwReason) {
157159
case DLL_PROCESS_DETACH:

0 commit comments

Comments
 (0)