On Sun, Oct 25, 2015 at 8:05 AM, Erik Faye-Lund <kusmab...@gmail.com> wrote:
> On Sat, Oct 24, 2015 at 7:08 PM, Rob Clark <robdcl...@gmail.com> wrote:
>> From: Rob Clark <robcl...@freedesktop.org>
>>
>> +#define NIR_PASS_PROGRESS(pass, nir, ...) ({               \
>> +      assert(nir_shader_is_mutable(nir));                  \
>> +      bool __ret = pass(nir, ##__VA_ARGS__);               \
>> +      nir_validate_shader(nir);                            \
>> +      if (__nir_test_clone()) {                            \
>> +         nir = nir_shader_clone(ralloc_parent(nir), nir);  \
>> +         nir_validate_shader(nir);                         \
>> +      }                                                    \
>> +      __ret;                                               \
>> +   })
>> +
> <snip>0
>> +      progress |= NIR_PASS_PROGRESS(nir_copy_prop, nir);
>
> This does not generate valid C code, but rather what looks like a GCC
> extension. Is that really a good move?

hmm, bleh.. it's used a lot in linux kernel, but it is a GNU C extension:

https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

well, I guess at least llvm must support it (since I've heard of
people building linux kernel w/ llvm), no idea about MSVC.  If it is
supported by MSVC, then maybe we could use it?  Or is there any other
compiler people use that doesn't?  It sure is a nice extension for
macros..

BR,
-R
_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to