diff options
Diffstat (limited to 'test/regression')
-rw-r--r-- | test/regression/packedstruct1.c | 14 | ||||
-rw-r--r-- | test/regression/packedstruct2.c | 10 |
2 files changed, 5 insertions, 19 deletions
diff --git a/test/regression/packedstruct1.c b/test/regression/packedstruct1.c index e7b6c1d..e5526ed 100644 --- a/test/regression/packedstruct1.c +++ b/test/regression/packedstruct1.c @@ -6,9 +6,7 @@ /* Simple packing */ -#pragma pack(1) - -struct s1 { unsigned short x; int y; double z; }; +struct __packed__ s1 { unsigned short x; int y; double z; }; void test1(void) { @@ -22,9 +20,7 @@ void test1(void) /* Packing plus alignment */ -#pragma pack(2,16) - -struct s2 { unsigned char x; int y; double z; }; +struct __packed__(2,16) s2 { unsigned char x; int y; double z; }; char filler1; @@ -42,8 +38,6 @@ void test2(void) /* Now with byte-swapped fields */ -#pragma pack(1,1,1) - struct s3 { unsigned char x; unsigned short y; @@ -53,7 +47,7 @@ struct s3 { char * p; unsigned int t[3]; unsigned char s[2]; -}; +} __packed__(1,1,1); struct s3 s3; @@ -83,8 +77,6 @@ void test3(void) /* Back to normal */ -#pragma pack() - struct s4 { unsigned short x; int y; double z; }; void test4(void) diff --git a/test/regression/packedstruct2.c b/test/regression/packedstruct2.c index 0c383a4..37c736e 100644 --- a/test/regression/packedstruct2.c +++ b/test/regression/packedstruct2.c @@ -4,9 +4,7 @@ /* Simple packing */ -#pragma pack(1) - -struct s1 { unsigned short x; int y; char z; }; +struct __packed__ s1 { unsigned short x; int y; char z; }; struct s1 s1 = { 2345, -12345678, 'x' }; @@ -17,9 +15,7 @@ void test1(void) /* Now with byte-swapped fields */ -#pragma pack(1,1,1) - -struct s3 { +struct __packed__(1,1,1) s3 { unsigned char x; unsigned short y; unsigned int z; @@ -47,8 +43,6 @@ void test3(void) /* Back to normal */ -#pragma pack() - struct s4 { unsigned short x; int y; double z; }; struct s4 s4 = { 123, -456789, 3.14159 }; |