From be449fca79a3b0394143f0a77c99784e65868d9f Mon Sep 17 00:00:00 2001 From: Diego Pettenò Date: Thu, 16 Oct 2008 13:34:09 +0000 Subject: Convert asm keyword into __asm__. Neither the asm() nor the __asm__() keyword is part of the C99 standard, but while GCC accepts the former in C89 syntax, it is not accepted in C99 unless GNU extensions are turned on (with -fasm). The latter form is accepted in any syntax as an extension (without requiring further command-line options). Sun Studio C99 compiler also does not accept asm() while accepting __asm__(), albeit reporting warnings that it's not valid C99 syntax. Originally committed as revision 15627 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavutil/bswap.h | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) (limited to 'libavutil/bswap.h') diff --git a/libavutil/bswap.h b/libavutil/bswap.h index 18fa594f94..8e6b1b20f1 100644 --- a/libavutil/bswap.h +++ b/libavutil/bswap.h @@ -33,11 +33,11 @@ static av_always_inline av_const uint16_t bswap_16(uint16_t x) { #if defined(ARCH_X86) - asm("rorw $8, %0" : "+r"(x)); + __asm__("rorw $8, %0" : "+r"(x)); #elif defined(ARCH_SH4) - asm("swap.b %0,%0" : "=r"(x) : "0"(x)); + __asm__("swap.b %0,%0" : "=r"(x) : "0"(x)); #elif defined(HAVE_ARMV6) - asm("rev16 %0, %0" : "+r"(x)); + __asm__("rev16 %0, %0" : "+r"(x)); #else x= (x>>8) | (x<<8); #endif @@ -48,30 +48,30 @@ static av_always_inline av_const uint32_t bswap_32(uint32_t x) { #if defined(ARCH_X86) #ifdef HAVE_BSWAP - asm("bswap %0" : "+r" (x)); + __asm__("bswap %0" : "+r" (x)); #else - asm("rorw $8, %w0 \n\t" + __asm__("rorw $8, %w0 \n\t" "rorl $16, %0 \n\t" "rorw $8, %w0" : "+r"(x)); #endif #elif defined(ARCH_SH4) - asm("swap.b %0,%0\n" + __asm__("swap.b %0,%0\n" "swap.w %0,%0\n" "swap.b %0,%0\n" : "=r"(x) : "0"(x)); #elif defined(HAVE_ARMV6) - asm("rev %0, %0" : "+r"(x)); + __asm__("rev %0, %0" : "+r"(x)); #elif defined(ARCH_ARMV4L) uint32_t t; - asm ("eor %1, %0, %0, ror #16 \n\t" + __asm__ ("eor %1, %0, %0, ror #16 \n\t" "bic %1, %1, #0xFF0000 \n\t" "mov %0, %0, ror #8 \n\t" "eor %0, %0, %1, lsr #8 \n\t" : "+r"(x), "+r"(t)); #elif defined(ARCH_BFIN) unsigned tmp; - asm("%1 = %0 >> 8 (V); \n\t" + __asm__("%1 = %0 >> 8 (V); \n\t" "%0 = %0 << 8 (V); \n\t" "%0 = %0 | %1; \n\t" "%0 = PACK(%0.L, %0.H); \n\t" @@ -90,7 +90,7 @@ static inline uint64_t av_const bswap_64(uint64_t x) x= ((x<<16)&0xFFFF0000FFFF0000ULL) | ((x>>16)&0x0000FFFF0000FFFFULL); return (x>>32) | (x<<32); #elif defined(ARCH_X86_64) - asm("bswap %0": "=r" (x) : "0" (x)); + __asm__("bswap %0": "=r" (x) : "0" (x)); return x; #else union { -- cgit v1.2.3