Commit 23a5b79f authored by Francois Gouget's avatar Francois Gouget Committed by Alexandre Julliard

Added support for three levels of nesting of the 'pragma pack'

directives.
parent 7c4bee56
#ifdef __WINE_PSHPACK_H #if defined(__WINE_PSHPACK_H3)
#undef __WINE_PSHPACK_H # ifndef __WINE_INTERNAL_POPPACK
# undef __WINE_PSHPACK_H3
#if defined(__GNUC__) || defined(__SUNPRO_C) # endif
#pragma pack() /* Depth == 3 */
#elif defined(__SUNPRO_CC)
#warning "Assumes default alignment is 4" # if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
#pragma pack(4) # if __WINE_PSHPACK_H2 == 1
#elif !defined(RC_INVOKED) # pragma pack(1)
#error "Restoration of the previous alignment isn't supported by the compiler" # elif __WINE_PSHPACK_H2 == 2
#endif /* defined(__GNUC__) || defined(__SUNPRO_C) ; !defined(RC_INVOKED) */ # pragma pack(2)
# elif __WINE_PSHPACK_H2 == 8
#else /* defined(__WINE_PSHPACK_H) */ # pragma pack(8)
# else
# pragma pack(4)
# endif
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#elif defined(__WINE_PSHPACK_H2)
# ifndef __WINE_INTERNAL_POPPACK
# undef __WINE_PSHPACK_H2
# endif
/* Depth == 2 */
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# if __WINE_PSHPACK_H == 1
# pragma pack(1)
# elif __WINE_PSHPACK_H == 2
# pragma pack(2)
# elif __WINE_PSHPACK_H == 8
# pragma pack(8)
# else
# pragma pack(4)
# endif
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#elif defined(__WINE_PSHPACK_H)
# ifndef __WINE_INTERNAL_POPPACK
# undef __WINE_PSHPACK_H
# endif
/* Depth == 1 */
# if defined(__GNUC__) || defined(__SUNPRO_C)
# pragma pack()
# elif defined(__SUNPRO_CC)
# warning "Assuming a default alignment of 4"
# pragma pack(4)
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#else
/* Depth == 0 ! */
#error "Popping alignment isn't possible since no alignment has been pushed" #error "Popping alignment isn't possible since no alignment has been pushed"
#endif /* defined(__WINE_PSHPACK_H) */
#endif
#undef __WINE_INTERNAL_POPPACK
#ifndef __WINE_PSHPACK_H #if defined(__WINE_PSHPACK_H3)
#define __WINE_PSHPACK_H 1
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) /* Depth > 3 */
#pragma pack(1) # error "Alignment nesting > 3 is not supported"
#elif !defined(RC_INVOKED)
#error "1 as alignment isn't supported by the compiler"
#endif /* defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */
#else /* !defined(__WINE_PSHPACK_H) */ #else
#error "Nested pushing of alignment isn't supported by the compiler"
#endif /* !defined(__WINE_PSHPACK_H) */
# if !defined(__WINE_PSHPACK_H)
# define __WINE_PSHPACK_H 1
/* Depth == 1 */
# elif !defined(__WINE_PSHPACK_H2)
# define __WINE_PSHPACK_H2 1
/* Depth == 2 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# elif !defined(__WINE_PSHPACK_H3)
# define __WINE_PSHPACK_H3 1
/* Depth == 3 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# endif
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack(1)
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#endif
#ifndef __WINE_PSHPACK_H #if defined(__WINE_PSHPACK_H3)
#define __WINE_PSHPACK_H 2
/* Depth > 3 */
#if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) # error "Alignment nesting > 3 is not supported"
#pragma pack(2)
#elif !defined(RC_INVOKED) #else
#error "2 as alignment isn't supported by the compiler"
#endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */ # if !defined(__WINE_PSHPACK_H)
# define __WINE_PSHPACK_H 2
#else /* !defined(__WINE_PSHPACK_H) */ /* Depth == 1 */
#error "Nested pushing of alignment isn't supported by the compiler" # elif !defined(__WINE_PSHPACK_H2)
#endif /* !defined(__WINE_PSHPACK_H) */ # define __WINE_PSHPACK_H2 2
/* Depth == 2 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# elif !defined(__WINE_PSHPACK_H3)
# define __WINE_PSHPACK_H3 2
/* Depth == 3 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# endif
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack(2)
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#endif
#ifndef __WINE_PSHPACK_H #if defined(__WINE_PSHPACK_H3)
#define __WINE_PSHPACK_H 4
#if defined(__GNUC__) || defined(__SUNPRO_CC) /* Depth > 3 */
#pragma pack(4) # error "Alignment nesting > 3 is not supported"
#elif defined(__SUNPRO_C)
#pragma pack()
#elif !defined(RC_INVOKED)
#error "4 as alignment isn't supported by the compiler"
#endif /* defined(__GNUC__) || defined(__SUNPRO_CC) ; !defined(RC_INVOKED) */
#else /* !defined(__WINE_PSHPACK_H) */ #else
#error "Nested pushing of alignment isn't supported by the compiler"
#endif /* !defined(__WINE_PSHPACK_H) */
# if !defined(__WINE_PSHPACK_H)
# define __WINE_PSHPACK_H 4
/* Depth == 1 */
# elif !defined(__WINE_PSHPACK_H2)
# define __WINE_PSHPACK_H2 4
/* Depth == 2 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# elif !defined(__WINE_PSHPACK_H3)
# define __WINE_PSHPACK_H3 4
/* Depth == 3 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# endif
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack(4)
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#endif
#ifndef __WINE_PSHPACK_H #if defined(__WINE_PSHPACK_H3)
#define __WINE_PSHPACK_H 8
/* Depth > 3 */
#if 0 # error "Alignment nesting > 3 is not supported"
#pragma pack(8)
#elif !defined(RC_INVOKED) #else
#error "8 as alignment is not supported"
#endif /* 0 ; !defined(RC_INVOKED) */ # if !defined(__WINE_PSHPACK_H)
# define __WINE_PSHPACK_H 8
#else /* !defined(__WINE_PSHPACK_H) */ /* Depth == 1 */
#error "Nested pushing of alignment isn't supported by the compiler" # elif !defined(__WINE_PSHPACK_H2)
#endif /* !defined(__WINE_PSHPACK_H) */ # define __WINE_PSHPACK_H2 8
/* Depth == 2 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# elif !defined(__WINE_PSHPACK_H3)
# define __WINE_PSHPACK_H3 8
/* Depth == 3 */
# define __WINE_INTERNAL_POPPACK
# include "poppack.h"
# endif
# if defined(__GNUC__) || defined(__SUNPRO_C) || defined(__SUNPRO_CC)
# pragma pack(8)
# warning "8 as alignment is not supported"
# elif !defined(RC_INVOKED)
# error "Adjusting the alignment is not supported with this compiler"
# endif
#endif
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