Bug 242409 - [WPE][GTK] Decide on conditional name for new API versions
Summary: [WPE][GTK] Decide on conditional name for new API versions
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKitGTK (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks: GTK4
  Show dependency treegraph
 
Reported: 2022-07-06 12:54 PDT by Michael Catanzaro
Modified: 2022-07-14 15:11 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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.