<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Apr 19, 2016 at 3:14 PM, Chad Versace <span dir="ltr"><<a href="mailto:chad.versace@intel.com" target="_blank">chad.versace@intel.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Tue 19 Apr 2016, Matt Turner wrote:<br>
> On Sat, Apr 16, 2016 at 12:45 PM, Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br>
> > C++ doesn't define the "restrict" keyword so g++ barfs when it sees isl.h.<br>
> > Having our own define lets us define it to be a no-op for C++.<br>
> > ---<br>
> > src/intel/isl/isl.h | 18 ++++++++++++++----<br>
> > 1 file changed, 14 insertions(+), 4 deletions(-)<br>
> ><br>
> > diff --git a/src/intel/isl/isl.h b/src/intel/isl/isl.h<br>
> > index 8f796b0..33d43d7 100644<br>
> > --- a/src/intel/isl/isl.h<br>
> > +++ b/src/intel/isl/isl.h<br>
> > @@ -47,6 +47,16 @@<br>
> > extern "C" {<br>
> > #endif<br>
> ><br>
> > +/* The restrict keyword is simply a hint to the optimizer and doesn't affect<br>
> > + * the caller of a function in any way. We want it in the header for the sake<br>
> > + * of documentation but we can safely remove it to make C++ happy.<br>
> > + */<br>
> > +#ifdef __cplusplus<br>
> > +#define ISL_RESTRICT<br>
> > +#else<br>
> > +#define ISL_RESTRICT restrict<br>
> > +#endif<br>
><br>
> Don't you just want __restrict?<br>
><br>
> <a href="https://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html" rel="noreferrer" target="_blank">https://gcc.gnu.org/onlinedocs/gcc/Restricted-Pointers.html</a><br>
><br>
> Maybe even just #define restrict __restrict<br>
<br>
</div></div>Yes, please. Let's just do<br>
#define restrict __restrict<br>
or<br>
#define restrict __restrict__<br>
<br>
Both work on Clang as well.<br>
</blockquote></div><br></div><div class="gmail_extra">How about we just include c99_compat.h at the top of the file?<br></div></div>