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

Eric Engestrom eric.engestrom at imgtec.com
Mon Jun 13 17:27:36 UTC 2016


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.

Cheers,
  Eric


More information about the mesa-dev mailing list