[FFmpeg-devel] [PATCH 3/4] Check for bswap_64 definition even though byteswap.h is present.

Diego 'Flameeyes' Pettenò flameeyes
Thu Oct 2 18:55:06 CEST 2008


Since glibc only defines bswap_64 for GCC 2 or later, it doesn't get
defined for the Sun Studio Compiler. In that case check if bswap_64
was defined, and if it wasn't, define it.
---

 libavutil/bswap.h |    6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diff --git a/libavutil/bswap.h b/libavutil/bswap.h
index 798e857..cb6c418 100644
--- a/libavutil/bswap.h
+++ b/libavutil/bswap.h
@@ -87,6 +87,9 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x)
     return x;
 }
 
+#endif  /* !HAVE_BYTESWAP_H */
+
+#ifndef bswap_64
 static inline uint64_t av_const bswap_64(uint64_t x)
 {
 #if 0
@@ -107,8 +110,7 @@ static inline uint64_t av_const bswap_64(uint64_t x)
     return r.ll;
 #endif
 }
-
-#endif  /* !HAVE_BYTESWAP_H */
+#endif /* ndef bswap_64 */
 
 // be2me ... BigEndian to MachineEndian
 // le2me ... LittleEndian to MachineEndian





More information about the ffmpeg-devel mailing list