--- bootstrap <[EMAIL PROTECTED]> wrote:
>
> Pedro Izecksohn wrote:
> >
> > First of many out of order answers:
> >
> > --- maxreason <[EMAIL PROTECTED]> wrote:
> >
> >> 3: More code that used to compile/work (and does on windoze):
> >><code>
> >> const u08 MATH_AXIS_SHIFT_1 = 0x04;
> >> const u08 MATH_AXIS_SHIFT_2 = 0x08;
> >> const u08 MATH_AXIS_X = 0x01;
> >> const u08 MATH_AXIS_Y = 0x02;
> >> const u08 MATH_AXIS_Z = 0x04;
> >> const u08 MATH_AXIS_A = 0x08;
> >> //
> >> // the above lines compile okay, but the following lines
> >> // generate errors (these are 7 of about 40 lines)
> >> //
> >> const u16 MATH_AXIS_0X = (MATH_AXIS_X << MATH_AXIS_SHIFT_1);
> >> const u16 MATH_AXIS_0Y = (MATH_AXIS_Y << MATH_AXIS_SHIFT_1);
> >> const u16 MATH_AXIS_0Z = (MATH_AXIS_Z << MATH_AXIS_SHIFT_1);
> >> const u16 MATH_AXIS_00X = (MATH_AXIS_X << MATH_AXIS_SHIFT_2);
> >> const u16 MATH_AXIS_XY = (MATH_AXIS_X | (MATH_AXIS_Y <<
> >> MATH_AXIS_SHIFT_1));
> >> const u16 MATH_AXIS_XYZ = (MATH_AXIS_X | (MATH_AXIS_Y <<
> >> MATH_AXIS_SHIFT_1) | (MATH_AXIS_Z << MATH_AXIS_SHIFT_2));
> >> //
> >> // errors say: "initializer element is not constant". I disagree!!!
> >> //
> >> // the "u08" is just a typedef for "unsigned char/byte"
> >> // the "u16" is just a typedef for "unsigned short"
> > </code>
> >
> > A shift result is an int. So a shift result must be cast to fit inside
> an
> > unsigned short.
> >
> Hmm. Strange, but that didn't solve the problem. I wonder if some
> compiler switch to force acceptance of C++ syntax vs only C syntax?
>
Instead of using const define the first constants with #define.
If you want to use C++ syntax write C++ code and compile it with g++ or
gxx.
Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
armazenamento!
http://br.mail.yahoo.com/