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?

-- 
View this message in context: 
http://www.nabble.com/problems-porting-3D-engine-from-windoze-to-linux-tp15108399p15122754.html
Sent from the C-prog mailing list archive at Nabble.com.

Reply via email to