Browse code

Make intreadwrite.h installation-safe

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

Måns Rullgård authored on 2010/07/11 07:22:03
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@
20 20
 #define AVUTIL_INTREADWRITE_H
21 21
 
22 22
 #include <stdint.h>
23
-#include "config.h"
23
+#include "libavutil/avconfig.h"
24 24
 #include "attributes.h"
25 25
 #include "bswap.h"
26 26
 
... ...
@@ -52,6 +52,10 @@ typedef union {
52 52
  * as inline functions.
53 53
  */
54 54
 
55
+#ifdef HAVE_AV_CONFIG_H
56
+
57
+#include "config.h"
58
+
55 59
 #if   ARCH_ARM
56 60
 #   include "arm/intreadwrite.h"
57 61
 #elif ARCH_AVR32
... ...
@@ -66,11 +70,13 @@ typedef union {
66 66
 #   include "x86/intreadwrite.h"
67 67
 #endif
68 68
 
69
+#endif /* HAVE_AV_CONFIG_H */
70
+
69 71
 /*
70 72
  * Map AV_RNXX <-> AV_R[BL]XX for all variants provided by per-arch headers.
71 73
  */
72 74
 
73
-#if HAVE_BIGENDIAN
75
+#if AV_HAVE_BIGENDIAN
74 76
 
75 77
 #   if    defined(AV_RN16) && !defined(AV_RB16)
76 78
 #       define AV_RB16(p) AV_RN16(p)
... ...
@@ -120,7 +126,7 @@ typedef union {
120 120
 #       define AV_WN64(p, v) AV_WB64(p, v)
121 121
 #   endif
122 122
 
123
-#else /* HAVE_BIGENDIAN */
123
+#else /* AV_HAVE_BIGENDIAN */
124 124
 
125 125
 #   if    defined(AV_RN16) && !defined(AV_RL16)
126 126
 #       define AV_RL16(p) AV_RN16(p)
... ...
@@ -170,14 +176,14 @@ typedef union {
170 170
 #       define AV_WN64(p, v) AV_WL64(p, v)
171 171
 #   endif
172 172
 
173
-#endif /* !HAVE_BIGENDIAN */
173
+#endif /* !AV_HAVE_BIGENDIAN */
174 174
 
175 175
 /*
176 176
  * Define AV_[RW]N helper macros to simplify definitions not provided
177 177
  * by per-arch headers.
178 178
  */
179 179
 
180
-#if   HAVE_ATTRIBUTE_PACKED
180
+#if defined(__GNUC__) && !defined(__TI_COMPILER_VERSION__)
181 181
 
182 182
 union unaligned_64 { uint64_t l; } __attribute__((packed)) av_alias;
183 183
 union unaligned_32 { uint32_t l; } __attribute__((packed)) av_alias;
... ...
@@ -191,7 +197,7 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
191 191
 #   define AV_RN(s, p) (*((const __unaligned uint##s##_t*)(p)))
192 192
 #   define AV_WN(s, p, v) (*((__unaligned uint##s##_t*)(p)) = (v))
193 193
 
194
-#elif HAVE_FAST_UNALIGNED
194
+#elif AV_HAVE_FAST_UNALIGNED
195 195
 
196 196
 #   define AV_RN(s, p) (((const av_alias##s*)(p))->u##s)
197 197
 #   define AV_WN(s, p, v) (((av_alias##s*)(p))->u##s = (v))
... ...
@@ -302,7 +308,7 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
302 302
     } while(0)
303 303
 #endif
304 304
 
305
-#if HAVE_BIGENDIAN
305
+#if AV_HAVE_BIGENDIAN
306 306
 #   define AV_RN(s, p)    AV_RB##s(p)
307 307
 #   define AV_WN(s, p, v) AV_WB##s(p, v)
308 308
 #else
... ...
@@ -336,7 +342,7 @@ union unaligned_16 { uint16_t l; } __attribute__((packed)) av_alias;
336 336
 #   define AV_WN64(p, v) AV_WN(64, p, v)
337 337
 #endif
338 338
 
339
-#if HAVE_BIGENDIAN
339
+#if AV_HAVE_BIGENDIAN
340 340
 #   define AV_RB(s, p)    AV_RN##s(p)
341 341
 #   define AV_WB(s, p, v) AV_WN##s(p, v)
342 342
 #   define AV_RL(s, p)    av_bswap##s(AV_RN##s(p))