aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/threads.c
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2014-04-17 09:22:57 -0700
committerChris Robinson <[email protected]>2014-04-17 09:22:57 -0700
commit8a00c240126d4138df21630f630da4c4f551000d (patch)
tree1d1a7d52af1bdbb0269832e0215999ea88eb2314 /Alc/threads.c
parent4b5e8b8c407354d94203a59fff8af59ce7d2b5e4 (diff)
Fix SetThreadName for 64-bit MSVC builds
Diffstat (limited to 'Alc/threads.c')
-rw-r--r--Alc/threads.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Alc/threads.c b/Alc/threads.c
index 35c66c6c..3a0d1a22 100644
--- a/Alc/threads.c
+++ b/Alc/threads.c
@@ -54,19 +54,21 @@ void SetThreadName(const char *name)
{
#if defined(_MSC_VER)
#define MS_VC_EXCEPTION 0x406D1388
+#pragma pack(push,8)
struct {
DWORD dwType; // Must be 0x1000.
LPCSTR szName; // Pointer to name (in user addr space).
DWORD dwThreadID; // Thread ID (-1=caller thread).
DWORD dwFlags; // Reserved for future use, must be zero.
} info;
+#pragma pack(pop)
info.dwType = 0x1000;
info.szName = name;
info.dwThreadID = -1;
info.dwFlags = 0;
__try {
- RaiseException(MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(DWORD), (ULONG_PTR*)&info);
+ RaiseException(MS_VC_EXCEPTION, 0, sizeof(info)/sizeof(ULONG_PTR), (ULONG_PTR*)&info);
}
__except(EXCEPTION_CONTINUE_EXECUTION) {
}