Re: Illegal use of reserved word in system.h

From: J.A. Magallon
Date: Thu May 19 2005 - 18:17:28 EST



On 05.20, Russell King wrote:
> On Thu, May 19, 2005 at 10:30:32PM +0000, J.A. Magallon wrote:
> > Stupid and portable C++ code follows:
> >...
> > # ifdef __linux__
> > strcpy(arch,"x86");
>
> These two appear to be self-contradictory, unless you define "portable"
> to mean "x86 only"... which would be hardly portable.
>

Yup, portable to what I needed to port it ;). Will be refined...
It was just a note about how to get info about ram, cpu, os and so on.
Probably soft (MySQL) that needs to know on what processors is being built
just needs to know on how many is being run to start a thread on each one,
or know about the ram to size its caches...

At build time, cpp -dM /dev/null:

linux-x86:
#define i386 1
#define __i386 1
#define __i386__ 1
#define __tune_pentium__ 1
#define __tune_i586__ 1

darwin-ppc:
#define __ppc__ 1

But the interesting part would be how to know at runtime on what
processor I'm running. Will have to look at x86info...

--
J.A. Magallon <jamagallon()able!es> \ Software is like sex:
werewolf!able!es \ It's better when it's free
Mandriva Linux release 2006.0 (Cooker) for i586
Linux 2.6.11-jam19 (gcc 4.0.0 (4.0.0-3mdk for Mandriva Linux release 2006.0))


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