Commit 47a88ba2 authored by Alexandre Julliard's avatar Alexandre Julliard

Explicitly specify alignment of 64-bit types.

parent a11b2bba
...@@ -48,7 +48,7 @@ cpp_quote("#define MAX_PIN_NAME 128") ...@@ -48,7 +48,7 @@ cpp_quote("#define MAX_PIN_NAME 128")
cpp_quote("#define MAX_FILTER_NAME 128") cpp_quote("#define MAX_FILTER_NAME 128")
typedef LONGLONG REFERENCE_TIME; typedef LONGLONG REFERENCE_TIME;
typedef double REFTIME; typedef DOUBLE REFTIME;
typedef DWORD_PTR HSEMAPHORE; typedef DWORD_PTR HSEMAPHORE;
typedef DWORD_PTR HEVENT; typedef DWORD_PTR HEVENT;
......
...@@ -59,20 +59,31 @@ extern "C" { ...@@ -59,20 +59,31 @@ extern "C" {
# endif # endif
#endif /* !defined(_MSC_VER) */ #endif /* !defined(_MSC_VER) */
/* FIXME: DECLSPEC_ALIGN should be declared only in winnt.h, but we need it here too */
#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 signed char INT8, *PINT8; typedef signed char INT8, *PINT8;
typedef signed short INT16, *PINT16; typedef signed short INT16, *PINT16;
typedef signed int INT32, *PINT32; typedef signed int INT32, *PINT32;
typedef signed __int64 INT64, *PINT64; typedef signed __int64 DECLSPEC_ALIGN(8) INT64, *PINT64;
typedef unsigned char UINT8, *PUINT8; typedef unsigned char UINT8, *PUINT8;
typedef unsigned short UINT16, *PUINT16; typedef unsigned short UINT16, *PUINT16;
typedef unsigned int UINT32, *PUINT32; typedef unsigned int UINT32, *PUINT32;
typedef unsigned __int64 UINT64, *PUINT64; typedef unsigned __int64 DECLSPEC_ALIGN(8) UINT64, *PUINT64;
typedef signed int LONG32, *PLONG32; typedef signed int LONG32, *PLONG32;
typedef unsigned int ULONG32, *PULONG32; typedef unsigned int ULONG32, *PULONG32;
typedef unsigned int DWORD32, *PDWORD32; typedef unsigned int DWORD32, *PDWORD32;
typedef signed __int64 LONG64, *PLONG64; typedef signed __int64 DECLSPEC_ALIGN(8) LONG64, *PLONG64;
typedef unsigned __int64 ULONG64, *PULONG64; typedef unsigned __int64 DECLSPEC_ALIGN(8) ULONG64, *PULONG64;
typedef unsigned __int64 DWORD64, *PDWORD64; typedef unsigned __int64 DECLSPEC_ALIGN(8) DWORD64, *PDWORD64;
/* Win32 or Win64 dependent typedef/defines. */ /* Win32 or Win64 dependent typedef/defines. */
......
...@@ -117,7 +117,7 @@ typedef enum _PinDirection { ...@@ -117,7 +117,7 @@ typedef enum _PinDirection {
#define MAX_FILTER_NAME 128 #define MAX_FILTER_NAME 128
typedef LONGLONG REFERENCE_TIME; typedef LONGLONG REFERENCE_TIME;
typedef double REFTIME; typedef DOUBLE REFTIME;
typedef DWORD_PTR HSEMAPHORE; typedef DWORD_PTR HSEMAPHORE;
......
...@@ -319,13 +319,13 @@ typedef unsigned short WCHAR, *PWCHAR; ...@@ -319,13 +319,13 @@ typedef unsigned short WCHAR, *PWCHAR;
/* 'Extended/Wide' numerical types */ /* 'Extended/Wide' numerical types */
#ifndef _ULONGLONG_ #ifndef _ULONGLONG_
#define _ULONGLONG_ #define _ULONGLONG_
typedef signed __int64 LONGLONG, *PLONGLONG; typedef signed __int64 DECLSPEC_ALIGN(8) LONGLONG, *PLONGLONG;
typedef unsigned __int64 ULONGLONG, *PULONGLONG; typedef unsigned __int64 DECLSPEC_ALIGN(8) ULONGLONG, *PULONGLONG;
#endif #endif
#ifndef _DWORDLONG_ #ifndef _DWORDLONG_
#define _DWORDLONG_ #define _DWORDLONG_
typedef ULONGLONG DWORDLONG, *PDWORDLONG; typedef ULONGLONG DECLSPEC_ALIGN(8) DWORDLONG, *PDWORDLONG;
#endif #endif
/* ANSI string types */ /* ANSI string types */
......
...@@ -184,8 +184,12 @@ typedef struct tagMSG { ...@@ -184,8 +184,12 @@ typedef struct tagMSG {
} MSG, *PMSG, *NPMSG, *LPMSG; } MSG, *PMSG, *NPMSG, *LPMSG;
#endif /* winnt.h */ #endif /* winnt.h */
#if 0
typedef double DOUBLE; typedef double DOUBLE;
#else
typedef double DECLSPEC_ALIGN(8) DOUBLE;
#endif
#ifndef _PALETTEENTRY_DEFINED #ifndef _PALETTEENTRY_DEFINED
#define _PALETTEENTRY_DEFINED #define _PALETTEENTRY_DEFINED
typedef struct tagPALETTEENTRY { typedef struct tagPALETTEENTRY {
...@@ -609,8 +613,12 @@ typedef enum tagSTATFLAG { ...@@ -609,8 +613,12 @@ typedef enum tagSTATFLAG {
STATFLAG_NOOPEN = 2 STATFLAG_NOOPEN = 2
} STATFLAG; } STATFLAG;
#if 0
typedef double DATE; typedef double DATE;
#else
typedef double DECLSPEC_ALIGN(8) DATE;
#endif
#if 0 #if 0
typedef struct tagCY { typedef struct tagCY {
LONGLONG int64; LONGLONG int64;
......
...@@ -184,7 +184,11 @@ typedef struct tagMSG ...@@ -184,7 +184,11 @@ typedef struct tagMSG
cpp_quote("#endif /* winnt.h */") cpp_quote("#endif /* winnt.h */")
cpp_quote("#if 0") /* for IDL only */
typedef double DOUBLE; typedef double DOUBLE;
cpp_quote("#else")
cpp_quote("typedef double DECLSPEC_ALIGN(8) DOUBLE;")
cpp_quote("#endif")
cpp_quote("#ifndef _PALETTEENTRY_DEFINED") cpp_quote("#ifndef _PALETTEENTRY_DEFINED")
cpp_quote("#define _PALETTEENTRY_DEFINED") cpp_quote("#define _PALETTEENTRY_DEFINED")
...@@ -563,7 +567,11 @@ typedef enum tagSTATFLAG { ...@@ -563,7 +567,11 @@ typedef enum tagSTATFLAG {
/******************** OLE Automation ********************/ /******************** OLE Automation ********************/
cpp_quote("#if 0") /* for IDL only */
typedef double DATE; typedef double DATE;
cpp_quote("#else")
cpp_quote("typedef double DECLSPEC_ALIGN(8) DATE;")
cpp_quote("#endif")
cpp_quote("#if 0") /* for IDL only */ cpp_quote("#if 0") /* for IDL only */
typedef struct tagCY { typedef struct tagCY {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment