Mercurial > libavutil.hg
diff common.h @ 578:b20a4eb68876 libavutil
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.
| author | flameeyes |
|---|---|
| date | Thu, 16 Oct 2008 13:34:09 +0000 |
| parents | 481638df1e8b |
| children | fddfdadb477f |
line wrap: on
line diff
--- a/common.h Wed Oct 15 08:06:12 2008 +0000 +++ b/common.h Thu Oct 16 13:34:09 2008 +0000 @@ -154,7 +154,7 @@ { #ifdef HAVE_CMOV int i=b; - asm volatile( + __asm__ volatile( "cmp %2, %1 \n\t" "cmovg %1, %0 \n\t" "cmovg %2, %1 \n\t" @@ -327,7 +327,7 @@ static inline uint64_t read_time(void) { uint64_t a, d; - asm volatile("rdtsc\n\t" + __asm__ volatile("rdtsc\n\t" : "=a" (a), "=d" (d)); return (d << 32) | (a & 0xffffffff); } @@ -335,7 +335,7 @@ static inline long long read_time(void) { long long l; - asm volatile("rdtsc\n\t" + __asm__ volatile("rdtsc\n\t" : "=A" (l)); return l; } @@ -349,7 +349,7 @@ } p; unsigned long long c; } t; - asm volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi)); + __asm__ volatile ("%0=cycles; %1=cycles2;" : "=d" (t.p.lo), "=d" (t.p.hi)); return t.c; } #else //FIXME check ppc64 @@ -358,7 +358,7 @@ uint32_t tbu, tbl, temp; /* from section 2.2.1 of the 32-bit PowerPC PEM */ - asm volatile( + __asm__ volatile( "1:\n" "mftbu %2\n" "mftb %0\n"
