[Mesa-dev] [PATCH] glsl: reuse main extension table to appropriate restrict extensions

Ilia Mirkin imirkin at alum.mit.edu
Tue Jun 14 03:10:28 UTC 2016


On Mon, Jun 13, 2016 at 1:27 PM, Eric Engestrom
<eric.engestrom at imgtec.com> wrote:
> On Mon, Jun 13, 2016 at 09:39:39AM -0700, Nanley Chery wrote:
>> You can add an entry to the end of the enum defined in extensions.h called
>> "MESA_EXTENSION_COUNT"  or similar.
>
> This is a good idea, but with one caveat:
> I've seen twice already bugs caused by people using ALL_CAPS counter
> entries in enums, and then someone trying to use them in #if conditions,
> where it resolves as `0` since the preprocessor doesn't know them.
>
> I would strongly advise to use lower case names, so as to avoid this
> confusion.

I see where you're coming from, but that's not the convention in mesa.
The enums are already MESA_EXTENSION_ARB_foo, so it'd be odd to call
the last thing "mesa_extension_count". I also can't think of a legit
scenario where someone would want to use MESA_EXTENSION_COUNT in a
preprocessor macro. So I'm going to leave it upper-cased.

  -ilia


More information about the mesa-dev mailing list