2.3.99-pre* /usr/src/linux/include/asm-alpha/system.h and g++

From: Berkley Shands (berkley@cs.wustl.edu)
Date: Thu May 04 2000 - 10:02:49 EST


the include file /usr/src/linux/include/asm-alpha/system.h is not compatible
with g++ (C++). The keyword "new" is reserved, so c++ programs cannot
load it. This breaks bttv (video) applications.

Here is a fix

berkley

diff -Naur linux-2.3.99-pre6-clean/include/asm-alpha/system.h linux-2.3.99-pre6/include/asm-alpha/system.h
--- linux-2.3.99-pre6-clean/include/asm-alpha/system.h Fri Feb 25 00:36:05 2000
+++ linux-2.3.99-pre6/include/asm-alpha/system.h Wed May 3 09:32:55 2000
@@ -416,7 +416,7 @@
 #define __HAVE_ARCH_CMPXCHG 1
 
 extern __inline__ unsigned long
-__cmpxchg_u32(volatile int *m, int old, int new)
+__cmpxchg_u32(volatile int *m, int old, int Xnew)
 {
         unsigned long prev, cmp;
 
@@ -432,13 +432,13 @@
         "3: br 1b\n"
         ".previous"
         : "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m));
+ : "r"((long) old), "r"(Xnew), "m"(*m));
 
         return prev;
 }
 
 extern __inline__ unsigned long
-__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long new)
+__cmpxchg_u64(volatile long *m, unsigned long old, unsigned long Xnew)
 {
         unsigned long prev, cmp;
 
@@ -454,7 +454,7 @@
         "3: br 1b\n"
         ".previous"
         : "=&r"(prev), "=&r"(cmp), "=m"(*m)
- : "r"((long) old), "r"(new), "m"(*m));
+ : "r"((long) old), "r"(Xnew), "m"(*m));
 
         return prev;
 }
@@ -464,13 +464,13 @@
 extern void __cmpxchg_called_with_bad_pointer(void);
 
 static __inline__ unsigned long
-__cmpxchg(volatile void *ptr, unsigned long old, unsigned long new, int size)
+__cmpxchg(volatile void *ptr, unsigned long old, unsigned long Xnew, int size)
 {
         switch (size) {
                 case 4:
- return __cmpxchg_u32(ptr, old, new);
+ return __cmpxchg_u32(ptr, old, Xnew);
                 case 8:
- return __cmpxchg_u64(ptr, old, new);
+ return __cmpxchg_u64(ptr, old, Xnew);
         }
         __cmpxchg_called_with_bad_pointer();
         return old;

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Sun May 07 2000 - 21:00:14 EST