I updated my Eclipse Android SDK to version 3.2 and I'm now getting compilation errors for constants.
This used to work:
static const X = 2;
static const X_SQUARED 开发者_开发技巧= X * X;
But now I get a compilation error on the 2nd line:
error: initializer element is not a compile-time constant
Was this an intentional change? Or is there perhaps something wrong in my environment?
Thanks!
RenderScript is C99, not C++. C99 requires that all static initializations be constant expressions (integer constants, floating constants, enumeration constants, character constants, and sizeof expressions).
The RenderScript compiler must have become more strict about this. This code never should have compiled (and in fact, does not compile with a regular C99 compiler).
精彩评论