1
1
mirror of https://gitlab.gnome.org/GNOME/gimp.git synced 2025-10-06 01:12:40 +02:00
Files
gimp/libgimpbase/gimpversion.h.in
Jehan 946a362d9b Revert "libgimpbase: #pragma once"
This reverts commit 06cd254954.

GObject Introspection tools somehow fail to introspect some macros in a
very bizarre way. See issue #14668.

I thought #pragma once was somewhat standard, but it turns out it's not.
And Wikipedia even stays about this:

> While #pragma once is available in most modern compilers, its
> implementation is tricky and might not always be reliable.

Anyway clearly it's not reliable at least regarding GIR tools. I believe
we should hold up on using #pragma once at the very least within our
libgimp* libraries. It is probably fine for app/ or plug-ins/ where we
don't need to introspect anything (and so far we haven't had any
compilation mishap because of this preprocessing directive).
2025-08-14 00:03:26 +02:00

69 lines
1.6 KiB
C

#ifndef __GIMP_VERSION_H__
#define __GIMP_VERSION_H__
/* gimpversion.h.in -> gimpversion.h
* This file is configured by Meson. Please modify meson.build files.
*/
#if !defined (__GIMP_BASE_H_INSIDE__) && !defined (GIMP_BASE_COMPILATION)
#error "Only <libgimpbase/gimpbase.h> can be included directly."
#endif
G_BEGIN_DECLS
/**
* SECTION: gimpversion
* @title: gimpversion
* @short_description: Macros and constants useful for determining
* GIMP's version number and capabilities.
*
* Macros and constants useful for determining GIMP's version number and
* capabilities.
**/
/**
* GIMP_MAJOR_VERSION:
*
* The major GIMP version number.
**/
#define GIMP_MAJOR_VERSION (@GIMP_MAJOR_VERSION@)
/**
* GIMP_MINOR_VERSION:
*
* The minor GIMP version number.
**/
#define GIMP_MINOR_VERSION (@GIMP_MINOR_VERSION@)
/**
* GIMP_MICRO_VERSION:
*
* The micro GIMP version number.
**/
#define GIMP_MICRO_VERSION (@GIMP_MICRO_VERSION@)
/**
* GIMP_VERSION:
*
* The GIMP version as a string.
**/
#define GIMP_VERSION "@GIMP_VERSION@"
/**
* GIMP_API_VERSION:
*
* Since: 2.2
**/
#define GIMP_API_VERSION "@GIMP_API_VERSION@"
#define GIMP_CHECK_VERSION(major, minor, micro) \
(GIMP_MAJOR_VERSION > (major) || \
(GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION > (minor)) || \
(GIMP_MAJOR_VERSION == (major) && GIMP_MINOR_VERSION == (minor) && \
GIMP_MICRO_VERSION >= (micro)))
G_END_DECLS
#endif /* __GIMP_VERSION_H__ */