Merge branch 'ebassi/4-0-abi-bump' into 'master'

Ebassi/4 0 abi bump

Closes #3392

See merge request GNOME/gtk!2883
This commit is contained in:
Matthias Clasen 2020-12-09 13:20:20 +00:00
commit 0ddcbb52e6
2 changed files with 56 additions and 34 deletions

View File

@ -35,9 +35,10 @@
/**
* GDK_DISABLE_DEPRECATION_WARNINGS:
*
* A macro that should be defined before including the gdk.h header.
* If it is defined, no compiler warnings will be produced for uses
* of deprecated GDK and GTK APIs.
* A macro that should be defined before including the `gdk.h` header.
*
* If this symbol is defined, no compiler warnings will be produced for
* uses of deprecated GDK and GTK APIs.
*/
#ifdef GDK_DISABLE_DEPRECATION_WARNINGS
@ -52,9 +53,6 @@
/* XXX: Every new stable minor release bump should add a macro here */
#define GDK_VERSION_3_92 (G_ENCODE_VERSION (3, 92))
#define GDK_VERSION_3_94 (G_ENCODE_VERSION (3, 94))
/**
* GDK_VERSION_4_0:
*
@ -65,26 +63,34 @@
/* evaluates to the current stable version; for development cycles,
* this means the next stable target
* this means the next stable target, with a hard backstop to the
* beginning of the stable series
*/
#if (GDK_MINOR_VERSION % 2)
#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION + 1))
#elif G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION) > GDK_VERSION_4_0
# define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
#else
#define GDK_VERSION_CUR_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION))
# define GDK_VERSION_CUR_STABLE GDK_VERSION_4_0
#endif
/* evaluates to the previous stable version */
#if (GDK_MINOR_VERSION % 2)
#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
/* evaluates to the previous stable version, with a hard backstop
* to the beginning of the stable series
*/
#if GDK_MAJOR_VERSION >= 4 && (GDK_MINOR_VERSION % 2)
# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 1))
#elif GDK_MAJOR_VERSION >= 4 && GDK_MINOR_VERSION > 2
# define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
#else
#define GDK_VERSION_PREV_STABLE (G_ENCODE_VERSION (GDK_MAJOR_VERSION, GDK_MINOR_VERSION - 2))
# define GDK_VERSION_PREV_STABLE GDK_VERSION_4_0
#endif
/**
* GDK_VERSION_MIN_REQUIRED:
*
* A macro that should be defined by the user prior to including
* the gdk.h header.
* the `gdk.h` header.
*
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@ -102,7 +108,8 @@
* GDK_VERSION_MAX_ALLOWED:
*
* A macro that should be defined by the user prior to including
* the gdk.h header.
* the `gdk.h` header.
*
* The definition should be one of the predefined GDK version
* macros: %GDK_VERSION_4_0, %GDK_VERSION_4_2,...
*
@ -122,29 +129,33 @@
/* sanity checks */
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_MIN_REQUIRED
#error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
# error "GDK_VERSION_MAX_ALLOWED must be >= GDK_VERSION_MIN_REQUIRED"
#endif
#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_3_92
#error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_3_92"
#if GDK_VERSION_MIN_REQUIRED < GDK_VERSION_4_0
# error "GDK_VERSION_MIN_REQUIRED must be >= GDK_VERSION_4_0"
#endif
#define GDK_AVAILABLE_IN_ALL _GDK_EXTERN
/* XXX: Every new stable minor release should add a set of macros here */
/* This is not really necessary for 4.0, since there can't be an
* earlier version, and there are no deprecated symbols. We just
* include it for completeness, and because it's easier to copy
* this stanza every time a new development cycle starts.
*/
#if GDK_VERSION_MAX_ALLOWED < GDK_VERSION_4_0
# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
# define GDK_AVAILABLE_IN_4_0 GDK_UNAVAILABLE(4, 0)
#else
# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
# define GDK_AVAILABLE_IN_4_0 _GDK_EXTERN
#endif
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_3_92
# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#if GDK_VERSION_MIN_REQUIRED >= GDK_VERSION_4_0
# define GDK_DEPRECATED_IN_4_0 GDK_DEPRECATED
# define GDK_DEPRECATED_IN_4_0_FOR(f) GDK_DEPRECATED_FOR(f)
#else
# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0 _GDK_EXTERN
# define GDK_DEPRECATED_IN_4_0_FOR(f) _GDK_EXTERN
#endif
#endif /* __GDK_VERSION_MACROS_H__ */

View File

@ -30,15 +30,26 @@ add_project_arguments('-DG_LOG_USE_STRUCTURED=1', language: 'c')
add_project_arguments('-DGLIB_DISABLE_DEPRECATION_WARNINGS', language: 'c')
# Making releases:
# 1. gtk_micro_version += 1;
# 2. gtk_interface_age += 1;
# 3. if any functions have been added, set gtk_interface_age to 0.
# 4. if backwards compatibility has been broken, we're in trouble
# 1. new development cycle:
# a. gtk_minor_version += 1
# b. gtk_micro_version = 0
# 2. new stable cycle:
# a. gtk_minor_version += 1
# b. gtk_micro_version = 0
# 3. every new release:
# a. gtk_micro_version += 1
gtk_version = meson.project_version()
gtk_major_version = gtk_version.split('.')[0].to_int()
gtk_minor_version = gtk_version.split('.')[1].to_int()
gtk_micro_version = gtk_version.split('.')[2].to_int()
gtk_interface_age = 0
# Interface age gets reset during development cycles, when
# we add new API; new micro versions of the same minor
# stable cycle will have the same interface age
#
# If new API is added during a stable cycle, reset to 0
gtk_interface_age = gtk_minor_version.is_odd() ? 0 : gtk_micro_version
add_project_arguments('-DGTK_VERSION="@0@"'.format(meson.project_version()), language: 'c')
add_project_arguments('-D_GNU_SOURCE', language: 'c')
@ -68,8 +79,8 @@ gtk_binary_version = '4.0.0'
gtk_binary_age = 100 * gtk_minor_version + gtk_micro_version
gtk_soversion = '0'
gtk_library_version = '0.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age)
gtk_soversion = '1'
gtk_library_version = '1.@0@.@1@'.format(gtk_binary_age - gtk_interface_age, gtk_interface_age)
gtk_api_version = '4.0'