Bug 242409

Summary: [WPE][GTK] Decide on conditional name for new API versions
Product: WebKit Reporter: Michael Catanzaro <mcatanzaro>
Component: WebKitGTKAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: bugs-noreply, mcatanzaro
Priority: P2    
Version: WebKit Nightly Build   
Hardware: PC   
OS: Linux   
Bug Depends on:    
Bug Blocks: 210100    

Description Michael Catanzaro 2022-07-06 12:54:41 PDT
I'm trying to decide on a single conditional I can use to distinguish between new API and old API. Example usage:

#if PLATFORM(GTK) && WEBKITGTK_API_VERSION >= 5.0 || PLATFORM(WPE) && WPE_API_VERSION >= 2.0
// do new thing
#else
// do old thing
#endif

Except that's too verbose, so we should have something much shorter, ideally with no && or || at all.

#if ENABLE(NEW_GLIB_APIS)
#if ENABLE(MODERN_WPE_GTK_API)
#if ENABLE(2022_API_VERSION)
#if ENABLE(2022_GLIB_API)
#if ENABLE(SOME_CODEWORD)

Ideas and/or votes welcome. This is a bikeshedding bug report.
Comment 1 Michael Catanzaro 2022-07-06 12:57:00 PDT
Another option, which works only if we drop older WPE API versions (see bug #242407):

#if WEBKITGTK_API_VERSION >= 5.0 || PLATFORM(WPE)
#if PLATFORM(WPE) WEBKITGTK_API_VERSION >= 5.0

which is slightly longer, but not too long.
Comment 2 Michael Catanzaro 2022-07-13 10:01:04 PDT
(In reply to Michael Catanzaro from comment #0)
> #if ENABLE(2022_GLIB_API)

If nobody has a preference, I'll probably try this.