Update iatomic.h functions definitions for mips
PATCH 1/1 Update iatomic.h functions definitions for mips
From: Kai Kang <jiashuo.kang at gmail.com>
Functions atomic_add(s) and atomic_sub(s) are defined with 'extern __inline__' that may cause compile fails when cross compile for mips. The error message looks like:
| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
| .../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'
Replace the 'extern __inline__' with 'static __inline__' to fix this issue.
--- include/iatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
include/iatomic.h +4 -4
@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;* Atomically adds @i to @v. Note that the guaranteed useful range * of an atomic_t is only 24 bits. */ -extern __inline__void atomic_add (int i,atomic_t * v) +static __inline__void atomic_add (int i,atomic_t * v) {unsigned long temp;
@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)* Atomically subtracts @i from @v. Note that the guaranteed * useful range of an atomic_t is only 24 bits. */ -extern __inline__void atomic_sub (int i,atomic_t * v) +static __inline__void atomic_sub (int i,atomic_t * v) {unsigned long temp;
@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)/* * Same as above, but return the result value */ -extern __inline__int atomic_add_return (int i,atomic_t * v) +static __inline__int atomic_add_return (int i,atomic_t * v) {unsigned long temp, result;
@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)return result; } -extern __inline__int atomic_sub_return (int i,atomic_t * v) +static __inline__int atomic_sub_return (int i,atomic_t * v) {unsigned long temp, result;
Signature · 1 line
1.8.1.2
Quoted 61 lines · On Thu, Aug 15, 2013 at 5:17 PM, <[email protected]> wrote:
From: Kai Kang <jiashuo.kang at gmail.com>
Functions
atomic_add(s)andatomic_sub(s)are defined with 'extern__inline__' that may cause compile fails when cross compile for mips. The error message looks like:| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
|.../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'Replace the 'extern
__inline__' with 'static__inline__' to fix this issue.Signed-off-by Kai Kang <jiashuo.kang at gmail.com>--- include/iatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)include/iatomic.h +4
-5@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;* Atomically adds @i to @v. Note that the guaranteed useful range * of an atomic_t is only 24 bits. */ -extern __inline__void atomic_add (int i,atomic_t * v) +static __inline__void atomic_add (int i,atomic_t * v) {unsigned long temp;@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)* Atomically subtracts @i from @v. Note that the guaranteed * useful range of an atomic_t is only 24 bits. */ -extern __inline__void atomic_sub (int i,atomic_t * v) +static __inline__void atomic_sub (int i,atomic_t * v) {unsigned long temp;@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)/* * Same as above, but return the result value */ -extern __inline__int atomic_add_return (int i,atomic_t * v) +static __inline__int atomic_add_return (int i,atomic_t * v) {unsigned long temp, result;@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)return result; } -extern __inline__int atomic_sub_return (int i,atomic_t * v) +static __inline__int atomic_sub_return (int i,atomic_t * v) {unsigned long temp, result; --
Quoted 3 lines
1.8.1.2
Any comment?
Thanks,
Kai
At Mon, 19 Aug 2013 10:18:17 +0800,
Quoted 63 lines · Jiashuo Kang
Quoted 60 lines · On Thu, Aug 15, 2013 at 5:17 PM, <[email protected]> wrote:
From: Kai Kang <jiashuo.kang at gmail.com>
Functions
atomic_add(s)andatomic_sub(s)are defined with 'extern__inline__' that may cause compile fails when cross compile for mips. The error message looks like:| pcm/.libs/libpcm.a(pcm_meter.o): In function `snd_pcm_meter_update_scope':
|.../alsa-lib-1.0.27.2/src/pcm/pcm_meter.c:139: undefined reference to `atomic_sub'Replace the 'extern
__inline__' with 'static__inline__' to fix this issue.Signed-off-by Kai Kang <jiashuo.kang at gmail.com>--- include/iatomic.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)include/iatomic.h +4
-4@@ -720,7 +720,7 @@ typedef struct { volatile int counter; } atomic_t;* Atomically adds @i to @v. Note that the guaranteed useful range * of an atomic_t is only 24 bits. */ -extern __inline__void atomic_add (int i,atomic_t * v) +static __inline__void atomic_add (int i,atomic_t * v) {unsigned long temp;@@ -744,7 +744,7 @@ extern __inline__ void atomic_add(int i, atomic_t * v)* Atomically subtracts @i from @v. Note that the guaranteed * useful range of an atomic_t is only 24 bits. */ -extern __inline__void atomic_sub (int i,atomic_t * v) +static __inline__void atomic_sub (int i,atomic_t * v) {unsigned long temp;@@ -763,7 +763,7 @@ extern __inline__ void atomic_sub(int i, atomic_t * v)/* * Same as above, but return the result value */ -extern __inline__int atomic_add_return (int i,atomic_t * v) +static __inline__int atomic_add_return (int i,atomic_t * v) {unsigned long temp, result;@@ -784,7 +784,7 @@ extern __inline__ int atomic_add_return(int i, atomic_t * v)return result; } -extern __inline__int atomic_sub_return (int i,atomic_t * v) +static __inline__int atomic_sub_return (int i,atomic_t * v) {unsigned long temp, result;
Quoted 5 lines
Quoted 4 lines
--
1.8.1.2Any comment?
Applied now. Thanks.
Takashi