From 63898f61b0ce4e321b5a7c39da2cfb5b16cfde5f Mon Sep 17 00:00:00 2001 From: Charles Pigott Date: Mon, 18 Jun 2018 21:21:45 +0100 Subject: Codechange: Rearrange struct packing defines and make MinGW use _Pragma pack style --- src/os/windows/win32.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/os') diff --git a/src/os/windows/win32.cpp b/src/os/windows/win32.cpp index 2d853037f..59b2fccac 100644 --- a/src/os/windows/win32.cpp +++ b/src/os/windows/win32.cpp @@ -805,16 +805,15 @@ int OTTDStringCompare(const char *s1, const char *s2) } #ifdef _MSC_VER -/* Code from MSDN: https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx */ +/* Based on code from MSDN: https://msdn.microsoft.com/en-us/library/xcb2z8hs.aspx */ const DWORD MS_VC_EXCEPTION = 0x406D1388; -#pragma pack(push,8) -typedef struct { + +PACK_N(struct THREADNAME_INFO { 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. -} THREADNAME_INFO; -#pragma pack(pop) +}, 8); /** * Signal thread name to any attached debuggers. -- cgit v1.2.3-70-g09d2