Browse code

Check for __attribute__((packed)) support

Not all compilers claiming to be gcc support this attribute.

Originally committed as revision 19453 to svn://svn.ffmpeg.org/ffmpeg/trunk

Måns Rullgård authored on 2009/07/17 17:21:43
Showing 2 changed files
... ...
@@ -899,6 +899,7 @@ HAVE_LIST="
899 899
     alsa_asoundlib_h
900 900
     altivec_h
901 901
     arpa_inet_h
902
+    attribute_packed
902 903
     bigendian
903 904
     bswap
904 905
     closesocket
... ...
@@ -2165,6 +2166,10 @@ void foo(char * $restrict_keyword p);
2165 2165
 EOF
2166 2166
 done
2167 2167
 
2168
+check_cc <<EOF && enable attribute_packed
2169
+struct { int x; } __attribute__((packed)) x;
2170
+EOF
2171
+
2168 2172
 ##########################################
2169 2173
 # SDL check
2170 2174
 
... ...
@@ -42,7 +42,7 @@
42 42
  * by per-arch headers.
43 43
  */
44 44
 
45
-#if   defined(__GNUC__)
45
+#if   HAVE_ATTRIBUTE_PACKED
46 46
 
47 47
 struct unaligned_64 { uint64_t l; } __attribute__((packed));
48 48
 struct unaligned_32 { uint32_t l; } __attribute__((packed));