Versioning Macros: Clutter Reference Manual

## Versioning Macros Versioning Macros — Versioning utility macros |

## Functions

#define | CLUTTER_CHECK_VERSION()
gboolean | clutter_check_version ()

## Types and Values

#define | CLUTTER_MAJOR_VERSION
#define | CLUTTER_MINOR_VERSION
#define | CLUTTER_MICRO_VERSION
#define | CLUTTER_VERSION
#define | CLUTTER_VERSION_S
#define | CLUTTER_VERSION_HEX
#define | CLUTTER_FLAVOUR
#define | CLUTTER_COGL
#define | CLUTTER_NO_FPU
#define | CLUTTER_VERSION_1_0
#define | CLUTTER_VERSION_1_2
#define | CLUTTER_VERSION_1_4
#define | CLUTTER_VERSION_1_6
#define | CLUTTER_VERSION_1_8
#define | CLUTTER_VERSION_1_10
#define | CLUTTER_VERSION_1_12
#define | CLUTTER_VERSION_1_14
#define | CLUTTER_VERSION_1_16
#define | CLUTTER_VERSION_1_18
#define | CLUTTER_VERSION_1_20
#define | CLUTTER_VERSION_1_22
#define | CLUTTER_VERSION_1_24
#define | CLUTTER_VERSION_1_26
#define | CLUTTER_VERSION_MAX_ALLOWED
#define | CLUTTER_VERSION_MIN_REQUIRED
extern const guint | clutter_major_version
extern const guint | clutter_minor_version
extern const guint | clutter_micro_version

## Description

Clutter offers a set of macros for checking the version of the library at compile time; it also provides a function to perform the same check at run time.

Clutter adds version information to both API deprecations and additions; by definining the macros `CLUTTER_VERSION_MIN_REQUIRED` and `CLUTTER_VERSION_MAX_ALLOWED`, you can specify the range of Clutter versions whose API you want to use. Functions that were deprecated before, or introduced after, this range will trigger compiler warnings. For instance, if we define the following symbols:

    1
    2
    CLUTTER_VERSION_MIN_REQUIRED = CLUTTER_VERSION_1_6
    CLUTTER_VERSION_MAX_ALLOWED  = CLUTTER_VERSION_1_8

and we have the following functions annotated in the Clutter headers:

    1
    2
    3
    4
    void clutter_function_A (void) CLUTTER_DEPRECATED_IN_1_4;
    void clutter_function_B (void) CLUTTER_DEPRECATED_IN_1_6;
    void clutter_function_C (void) CLUTTER_AVAILABLE_IN_1_8;
    void clutter_function_D (void) CLUTTER_AVAILABLE_IN_1_10;

then any application code using the functions above will get the output:

    1
    2
    3
    4
    clutter_function_A: deprecation warning
    clutter_function_B: no warning
    clutter_function_C: no warning
    clutter_function_D: symbol not available warning

It is possible to disable the compiler warnings by defining the macro `CLUTTER_DISABLE_DEPRECATION_WARNINGS` before including the clutter.h header.

## Functions

### CLUTTER_CHECK_VERSION()

    #define             CLUTTER_CHECK_VERSION(major,minor,micro)

Evaluates to `TRUE` if the version of the Clutter library is greater than `major` , `minor` and `micro`

#### Parameters

major | major version, like 1 in 1.2.3 |
minor | minor version, like 2 in 1.2.3 |
micro | micro version, like 3 in 1.2.3 |

### clutter_check_version ()

    gboolean
    clutter_check_version (guint major,
                           guint minor,
                           guint micro);

Run-time version check, to check the version the Clutter library that an application is currently linked against

This is the run-time equivalent of the compile-time `CLUTTER_CHECK_VERSION` pre-processor macro

#### Parameters

major | major version, like 1 in 1.2.3 |
minor | minor version, like 2 in 1.2.3 |
micro | micro version, like 3 in 1.2.3 |

#### Returns

`TRUE` if the version of the Clutter library is greater than (`major` , `minor` , `micro` ), and `FALSE` otherwise

Since: 1.2

## Types and Values

### CLUTTER_MAJOR_VERSION

    #define CLUTTER_MAJOR_VERSION   (1)

The major version of the Clutter library (1, if `CLUTTER_VERSION` is 1.2.3)

### CLUTTER_MINOR_VERSION

    #define CLUTTER_MINOR_VERSION   (26)

The minor version of the Clutter library (2, if `CLUTTER_VERSION` is 1.2.3)

### CLUTTER_MICRO_VERSION

    #define CLUTTER_MICRO_VERSION   (4)

The micro version of the Clutter library (3, if `CLUTTER_VERSION` is 1.2.3)

### CLUTTER_VERSION

    #define CLUTTER_VERSION         1.26.4

The full version of the Clutter library, like 1.2.3

### CLUTTER_VERSION_S

    #define CLUTTER_VERSION_S       "1.26.4"

The full version of the Clutter library, in string form (suited for string concatenation)

### CLUTTER_VERSION_HEX

    #define             CLUTTER_VERSION_HEX

Numerically encoded version of the Clutter library, like 0x010203

### CLUTTER_FLAVOUR

    #define CLUTTER_FLAVOUR         "deprecated"

`CLUTTER_FLAVOUR` has been deprecated since version 1.10 and should not be used in newly-written code.

The macro evaluates to "deprecated" as Clutter can be compiled with multiple windowing system backends. Use the various CLUTTER_WINDOWING_* macros to detect the windowing system that Clutter is being compiled against, and the type check macros for the ClutterBackend for a run-time check.

GL Windowing system used

Since: 0.4

### CLUTTER_COGL

    #define CLUTTER_COGL            "deprecated"

`CLUTTER_COGL` has been deprecated since version 1.10 and should not be used in newly-written code.

The macro evaluates to "deprecated" as Cogl can be compiled against multiple GL implementations.

Cogl (internal GL abstraction utility library) backend. Can be "gl" or "gles" currently

Since: 0.4

### CLUTTER_NO_FPU

    #define CLUTTER_NO_FPU          (0)

`CLUTTER_NO_FPU` has been deprecated since version 0.6 and should not be used in newly-written code.

This macro is no longer defined (identical code is used regardless the presence of FPU).

Set to 1 if Clutter was built without FPU (i.e fixed math), 0 otherwise

### CLUTTER_VERSION_1_0

    #define CLUTTER_VERSION_1_0     (G_ENCODE_VERSION (1, 0))

A macro that evaluates to the 1.0 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_2

    #define CLUTTER_VERSION_1_2     (G_ENCODE_VERSION (1, 2))

A macro that evaluates to the 1.2 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_4

    #define CLUTTER_VERSION_1_4     (G_ENCODE_VERSION (1, 4))

A macro that evaluates to the 1.4 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_6

    #define CLUTTER_VERSION_1_6     (G_ENCODE_VERSION (1, 6))

A macro that evaluates to the 1.6 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_8

    #define CLUTTER_VERSION_1_8     (G_ENCODE_VERSION (1, 8))

A macro that evaluates to the 1.8 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_10

    #define CLUTTER_VERSION_1_10    (G_ENCODE_VERSION (1, 10))

A macro that evaluates to the 1.10 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.10

### CLUTTER_VERSION_1_12

    #define CLUTTER_VERSION_1_12    (G_ENCODE_VERSION (1, 12))

A macro that evaluates to the 1.12 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.12

### CLUTTER_VERSION_1_14

    #define CLUTTER_VERSION_1_14    (G_ENCODE_VERSION (1, 14))

A macro that evaluates to the 1.14 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.14

### CLUTTER_VERSION_1_16

    #define CLUTTER_VERSION_1_16    (G_ENCODE_VERSION (1, 16))

A macro that evaluates to the 1.16 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.16

### CLUTTER_VERSION_1_18

    #define CLUTTER_VERSION_1_18    (G_ENCODE_VERSION (1, 18))

A macro that evaluates to the 1.18 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.18

### CLUTTER_VERSION_1_20

    #define CLUTTER_VERSION_1_20    (G_ENCODE_VERSION (1, 20))

A macro that evaluates to the 1.20 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.20

### CLUTTER_VERSION_1_22

    #define CLUTTER_VERSION_1_22    (G_ENCODE_VERSION (1, 22))

A macro that evaluates to the 1.22 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.22

### CLUTTER_VERSION_1_24

    #define CLUTTER_VERSION_1_24    (G_ENCODE_VERSION (1, 24))

A macro that evaluates to the 1.24 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.24

### CLUTTER_VERSION_1_26

    #define CLUTTER_VERSION_1_26    (G_ENCODE_VERSION (1, 26))

A macro that evaluates to the 1.26 version of Clutter, in a format that can be used by the C pre-processor.

Since: 1.26

### CLUTTER_VERSION_MAX_ALLOWED

    #  define CLUTTER_VERSION_MAX_ALLOWED   CLUTTER_VERSION_MIN_REQUIRED

A macro that should be define by the user prior to including the clutter.h header.

The definition should be one of the predefined Clutter version macros, such as: `CLUTTER_VERSION_1_0`, `CLUTTER_VERSION_1_2`, ...

This macro defines the upper bound for the Clutter API to be used.

If a function has been introduced in a newer version of Clutter, it is possible to use this symbol to get compiler warnings when trying to use that function.

Since: 1.10

### CLUTTER_VERSION_MIN_REQUIRED

    # define CLUTTER_VERSION_MIN_REQUIRED   (CLUTTER_VERSION_CUR_STABLE)

A macro that should be defined by the user prior to including the clutter.h header.

The definition should be one of the predefined Clutter version macros, such as: `CLUTTER_VERSION_1_0`, `CLUTTER_VERSION_1_2`, ...

This macro defines the lower bound for the Clutter API to be used.

If a function has been deprecated in a newer version of Clutter, it is possible to use this symbol to avoid the compiler warnings without disabling warnings for every deprecated function.

Since: 1.10

### clutter_major_version

    extern const guint clutter_major_version;

The major component of the Clutter library version, e.g. 1 if the version is 1.2.3

This value can be used for run-time version checks

For a compile-time check, use `CLUTTER_MAJOR_VERSION`

Since: 1.2

### clutter_minor_version

    extern const guint clutter_minor_version;

The minor component of the Clutter library version, e.g. 2 if the version is 1.2.3

This value can be used for run-time version checks

For a compile-time check, use `CLUTTER_MINOR_VERSION`

Since: 1.2

### clutter_micro_version

    extern const guint clutter_micro_version;

The micro component of the Clutter library version, e.g. 3 if the version is 1.2.3

This value can be used for run-time version checks

For a compile-time check, use `CLUTTER_MICRO_VERSION`

Since: 1.2