Skip to content
  • Chad Versace's avatar
    api: Don't guard enum names with WAFFLE_API_VERSION · cba3b59e
    Chad Versace authored
    
    
    As decided between Emil and I in the email below, Waffle's enums shouldn't
    normally be guarded by feature macros.
    
      Subject: Re: [waffle] [PATCH 07/10] waffle: add full screen window request
      Date: Thu, 23 Apr 2015 03:03:08 -0700
      From: Emil Velikov
    
      On 22 April 2015 at 20:26, Chad Versace wrote:
      > On Fri 10 Apr 2015, Emil Velikov wrote:
      >> On 09/04/15 22:48, Chad Versace wrote:
      >> Should one wrap the new enum in #if WAFFLE_API_VERSION >= 0x1070 ? Or it
      >> only makes sense for new entry points into the waffle library ?
      >> Considering that WAFFLE_WINDOW_{WIDTH,HEIGHT} went in without the API
      >> guard, I'm leaning towards the latter.
      >
      > I'm unsure. Other libraries that use feature test macros, what do they
      > do? For the record, when adding WAFFLE_CONTEXT_FORWARD_COMPATIBLE and
      > WAFFLE_CONTEXT_DEBUG, I guarded those with 0x0130. But I'm open to
      > guarding only entry points if that makes more sense.
    
      That's the key that brought us here in the first place ;-) From a
      quick look at my /usr/include all of the feature test macros are used
      to guard structs (be that new ones or ABI changes) and functions
      prototypes. Haven't seen one guarding enums/defines.
    
      > I think we should research what other libraries do before committing to
      > a decision.
    
      Personally I would opt for dropping the guards in enums
       - GDK, xfixes, jpeglib guards only structs/functions,
       - anyone can provide a dummy/invalid value, it's up-to the API to
         disregard/ignore it :-)
    
    Suggested-by: default avatarEmil Velikov <emil.velikov@collabora.com>
    Signed-off-by: default avatarChad Versace <chad.versace@intel.com>
    cba3b59e