Alexandre Julliard | 0799c1a | 2002-03-09 23:29:33 +0000 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 1999 Patrik Stridvall |
| 3 | * |
| 4 | * This library is free software; you can redistribute it and/or |
| 5 | * modify it under the terms of the GNU Lesser General Public |
| 6 | * License as published by the Free Software Foundation; either |
| 7 | * version 2.1 of the License, or (at your option) any later version. |
| 8 | * |
| 9 | * This library is distributed in the hope that it will be useful, |
| 10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 12 | * Lesser General Public License for more details. |
| 13 | * |
| 14 | * You should have received a copy of the GNU Lesser General Public |
| 15 | * License along with this library; if not, write to the Free Software |
| 16 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 17 | */ |
| 18 | |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 19 | #if defined(__WINE_PSHPACK_H3) |
| 20 | # ifndef __WINE_INTERNAL_POPPACK |
| 21 | # undef __WINE_PSHPACK_H3 |
| 22 | # endif |
| 23 | /* Depth == 3 */ |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 24 | |
Dimitrie O. Paun | 41d7518 | 2003-09-11 23:08:58 +0000 | [diff] [blame] | 25 | # if __WINE_PSHPACK_H2 == 1 |
| 26 | # pragma pack(1) |
| 27 | # elif __WINE_PSHPACK_H2 == 2 |
| 28 | # pragma pack(2) |
| 29 | # elif __WINE_PSHPACK_H2 == 8 |
| 30 | # pragma pack(8) |
| 31 | # else |
| 32 | # pragma pack(4) |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 33 | # endif |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 34 | |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 35 | #elif defined(__WINE_PSHPACK_H2) |
| 36 | # ifndef __WINE_INTERNAL_POPPACK |
| 37 | # undef __WINE_PSHPACK_H2 |
| 38 | # endif |
| 39 | /* Depth == 2 */ |
| 40 | |
Dimitrie O. Paun | 41d7518 | 2003-09-11 23:08:58 +0000 | [diff] [blame] | 41 | # if __WINE_PSHPACK_H == 1 |
| 42 | # pragma pack(1) |
| 43 | # elif __WINE_PSHPACK_H == 2 |
| 44 | # pragma pack(2) |
| 45 | # elif __WINE_PSHPACK_H == 8 |
| 46 | # pragma pack(8) |
| 47 | # else |
| 48 | # pragma pack(4) |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 49 | # endif |
| 50 | |
| 51 | #elif defined(__WINE_PSHPACK_H) |
| 52 | # ifndef __WINE_INTERNAL_POPPACK |
| 53 | # undef __WINE_PSHPACK_H |
| 54 | # endif |
| 55 | /* Depth == 1 */ |
| 56 | |
Dimitrie O. Paun | 41d7518 | 2003-09-11 23:08:58 +0000 | [diff] [blame] | 57 | # if defined(__SUNPRO_CC) |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 58 | # warning "Assuming a default alignment of 4" |
| 59 | # pragma pack(4) |
Dimitrie O. Paun | 41d7518 | 2003-09-11 23:08:58 +0000 | [diff] [blame] | 60 | # else |
| 61 | # pragma pack() |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 62 | # endif |
| 63 | |
| 64 | #else |
| 65 | /* Depth == 0 ! */ |
| 66 | |
Patrik Stridvall | c7a8dde | 1999-04-25 12:36:53 +0000 | [diff] [blame] | 67 | #error "Popping alignment isn't possible since no alignment has been pushed" |
Francois Gouget | 23a5b79 | 2000-10-19 20:20:07 +0000 | [diff] [blame] | 68 | |
| 69 | #endif |
| 70 | |
| 71 | #undef __WINE_INTERNAL_POPPACK |