From 65d9723dc4c45e691132ac0fef50087895935c34 Mon Sep 17 00:00:00 2001 From: Damjan Jovanovic Date: Tue, 6 Feb 2007 09:35:50 +0200 Subject: [PATCH] msvcrt: Align struct _stati64's st_size on an 8 byte boundary. --- dlls/msvcrt/msvcrt.h | 2 +- include/msvcrt/sys/stat.h | 12 +++++++++++- include/msvcrt/wchar.h | 12 +++++++++++- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/dlls/msvcrt/msvcrt.h b/dlls/msvcrt/msvcrt.h index 68fa119d0b8..e7b037fd091 100644 --- a/dlls/msvcrt/msvcrt.h +++ b/dlls/msvcrt/msvcrt.h @@ -366,7 +366,7 @@ struct MSVCRT__stati64 { short st_uid; short st_gid; MSVCRT__dev_t st_rdev; - __int64 st_size; + __int64 DECLSPEC_ALIGN(8) st_size; MSVCRT_time_t st_atime; MSVCRT_time_t st_mtime; MSVCRT_time_t st_ctime; diff --git a/include/msvcrt/sys/stat.h b/include/msvcrt/sys/stat.h index 83026f2bb10..c8b1888a6fa 100644 --- a/include/msvcrt/sys/stat.h +++ b/include/msvcrt/sys/stat.h @@ -46,6 +46,16 @@ typedef int _off_t; #define _OFF_T_DEFINED #endif +#ifndef DECLSPEC_ALIGN +# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +# else +# define DECLSPEC_ALIGN(x) +# endif +#endif + #define _S_IEXEC 0x0040 #define _S_IWRITE 0x0080 #define _S_IREAD 0x0100 @@ -99,7 +109,7 @@ struct _stati64 { short st_uid; short st_gid; _dev_t st_rdev; - __int64 st_size; + __int64 DECLSPEC_ALIGN(8) st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; diff --git a/include/msvcrt/wchar.h b/include/msvcrt/wchar.h index f07db622363..03bf7cc01e2 100644 --- a/include/msvcrt/wchar.h +++ b/include/msvcrt/wchar.h @@ -43,6 +43,16 @@ typedef unsigned short wchar_t; #define _WIN64 #endif +#ifndef DECLSPEC_ALIGN +# if defined(_MSC_VER) && (_MSC_VER >= 1300) && !defined(MIDL_PASS) +# define DECLSPEC_ALIGN(x) __declspec(align(x)) +# elif defined(__GNUC__) +# define DECLSPEC_ALIGN(x) __attribute__((aligned(x))) +# else +# define DECLSPEC_ALIGN(x) +# endif +#endif + typedef int mbstate_t; #ifndef _SIZE_T_DEFINED @@ -181,7 +191,7 @@ struct _stati64 { short st_uid; short st_gid; _dev_t st_rdev; - __int64 st_size; + __int64 DECLSPEC_ALIGN(8) st_size; time_t st_atime; time_t st_mtime; time_t st_ctime; -- 2.11.4.GIT