- Add missing alignment defines to winnt.h (copied from ntdef.h)
- Update bcrypt.h to Wine 1.5.4

svn path=/trunk/; revision=56775
This commit is contained in:
Thomas Faber 2012-06-21 17:41:25 +00:00
parent 6c59846bd7
commit 8d85413312
2 changed files with 37 additions and 3 deletions

View file

@ -35,6 +35,11 @@
#define OPTIONAL
#endif
#ifndef WINE_NTSTATUS_DECLARED
#define WINE_NTSTATUS_DECLARED
typedef LONG NTSTATUS;
#endif
typedef struct _BCRYPT_ALGORITHM_IDENTIFIER
{
LPWSTR pszName;

View file

@ -109,12 +109,41 @@ extern "C" {
#ifndef RC_INVOKED
#include <string.h>
/* FIXME: add more architectures. Is there a way to specify this in GCC? */
#if defined(_M_AMD64)
#undef UNALIGNED
#if defined(_M_MRX000) || defined(_M_ALPHA) || defined(_M_PPC) || defined(_M_IA64) || defined(_M_AMD64)
#define ALIGNMENT_MACHINE
#define UNALIGNED __unaligned
#if defined(_WIN64)
#define UNALIGNED64 __unaligned
#else
#define UNALIGNED64
#endif
#else
#undef ALIGNMENT_MACHINE
#define UNALIGNED
#define UNALIGNED64
#endif
#if defined(_WIN64) || defined(_M_ALPHA)
#define MAX_NATURAL_ALIGNMENT sizeof(ULONGLONG)
#define MEMORY_ALLOCATION_ALIGNMENT 16
#else
#define MAX_NATURAL_ALIGNMENT sizeof(ULONG)
#define MEMORY_ALLOCATION_ALIGNMENT 8
#endif
/* Returns the type's alignment */
#if defined(_MSC_VER) && (_MSC_VER >= 1300)
#define TYPE_ALIGNMENT(t) __alignof(t)
#else
#define TYPE_ALIGNMENT(t) FIELD_OFFSET(struct { char x; t test; }, test)
#endif
#if defined(_AMD64_) || defined(_X86_)
#define PROBE_ALIGNMENT(_s) TYPE_ALIGNMENT(ULONG)
#elif defined(_IA64_) || defined(_ARM_)
#define PROBE_ALIGNMENT(_s) max((TYPE_ALIGNMENT(_s), TYPE_ALIGNMENT(ULONG))
#else
#error "unknown architecture"
#endif
#ifndef DECLSPEC_NOVTABLE