[Mesa-dev] [PATCH 03/22] glsl: Add a IS_CONSTANT macro

Matt Turner mattst88 at gmail.com
Sat Jan 3 12:22:39 PST 2015

On Sat, Jan 3, 2015 at 12:10 PM, Thomas Helland
<thomashelland90 at gmail.com> wrote:
> I was just looking at the git log and noticed the commit:
>    i965: Show opt_vector_float() and later passes in INTEL_DEBUG=optimizer.
> It converts a macro to use the GNU Statement Expression extension.
> This would greatly simplify the macro I've written in this patch,
> so I'm considering rewriting it to use this extension.
> The question is: Does the compilers we care about support the extension?
> It looks like clang does, and obviously GCC does.
> ICC seems to also support it, apart from some things like variable
> length arrays.
> MSVC however, not so much: https://news.ycombinator.com/item?id=8030312
> Should I rewrite the patch, or should I leave it as is?

We can't use statement expressions in code that's compiled by MSVC,
like src/glsl. We can use it in i965 since we only care about gcc and
maybe clang.

More information about the mesa-dev mailing list