lkml.org 
[lkml]   [2005]   [Jul]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: PROBLEM: please remove reserved word "new" from kernel headers
On Wed, 6 Jul 2005, Alexey Dobriyan wrote:

> On Wednesday 06 July 2005 13:26, Rob Prowel wrote:
>> When kernel headers are included in compilation of c++
>> programs the compile fails because some header files
>> use "new" in a way that is illegal for c++. This
>> shows up when compiling mySQL under linux 2.6. It
>> uses $KERNELSOURCE/include/asm-i386/system.h.
>
> Please read http://marc.theaimsgroup.com/?t=111637777000001&r=2&w=2
> where people discuss this brokeness of MySQL.
>

Just for kicks, see if this 'fixes' it. Then contact the MySQL
people and complain.


--- /usr/src/linux-2.6.12/include/asm-i386/system.h.orig 2005-07-06 14:01:25.000000000 -0400
+++ /usr/src/linux-2.6.12/include/asm-i386/system.h 2005-07-06 14:03:42.000000000 -0400
@@ -235,7 +235,7 @@

/*
* Atomic compare and exchange. Compare OLD with MEM, if identical,
- * store NEW in MEM. Return the initial value in MEM. Success is
+ * store New in MEM. Return the initial value in MEM. Success is
* indicated by comparing RETURN with OLD.
*/

@@ -244,26 +244,26 @@
#endif

static inline unsigned long __cmpxchg(volatile void *ptr, unsigned long old,
- unsigned long new, int size)
+ unsigned long New, int size)
{
unsigned long prev;
switch (size) {
case 1:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgb %b1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "q"(New), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 2:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgw %w1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "q"(New), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
case 4:
__asm__ __volatile__(LOCK_PREFIX "cmpxchgl %1,%2"
: "=a"(prev)
- : "q"(new), "m"(*__xg(ptr)), "0"(old)
+ : "q"(New), "m"(*__xg(ptr)), "0"(old)
: "memory");
return prev;
}



Cheers,
Dick Johnson
Penguin : Linux version 2.6.12 on an i686 machine (5537.79 BogoMips).
Notice : All mail here is now cached for review by Dictator Bush.
98.36% of all statistics are fiction.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-07-07 04:26    [W:0.046 / U:18.600 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site