Blame src/dzl-version-macros.h

rpm-build f53ec4
/* dzl-version-macros.h
rpm-build f53ec4
 *
rpm-build f53ec4
 * Copyright (C) 2017 Christian Hergert <chergert@redhat.com>
rpm-build f53ec4
 *
rpm-build f53ec4
 * This program is free software: you can redistribute it and/or modify
rpm-build f53ec4
 * it under the terms of the GNU General Public License as published by
rpm-build f53ec4
 * the Free Software Foundation, either version 3 of the License, or
rpm-build f53ec4
 * (at your option) any later version.
rpm-build f53ec4
 *
rpm-build f53ec4
 * This program is distributed in the hope that it will be useful,
rpm-build f53ec4
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
rpm-build f53ec4
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
rpm-build f53ec4
 * GNU General Public License for more details.
rpm-build f53ec4
 *
rpm-build f53ec4
 * You should have received a copy of the GNU General Public License
rpm-build f53ec4
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
rpm-build f53ec4
 */
rpm-build f53ec4
rpm-build f53ec4
#ifndef DZL_VERSION_MACROS_H
rpm-build f53ec4
#define DZL_VERSION_MACROS_H
rpm-build f53ec4
rpm-build f53ec4
#if !defined(DAZZLE_INSIDE) && !defined(DAZZLE_COMPILATION)
rpm-build f53ec4
# error "Only <dazzle.h> can be included directly."
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#include <glib.h>
rpm-build f53ec4
rpm-build f53ec4
#include "dzl-version.h"
rpm-build f53ec4
rpm-build f53ec4
#ifndef _DZL_EXTERN
rpm-build f53ec4
#define _DZL_EXTERN extern
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#ifdef DZL_DISABLE_DEPRECATION_WARNINGS
rpm-build f53ec4
#define DZL_DEPRECATED _DZL_EXTERN
rpm-build f53ec4
#define DZL_DEPRECATED_FOR(f) _DZL_EXTERN
rpm-build f53ec4
#define DZL_UNAVAILABLE(maj,min) _DZL_EXTERN
rpm-build f53ec4
#else
rpm-build f53ec4
#define DZL_DEPRECATED G_DEPRECATED _DZL_EXTERN
rpm-build f53ec4
#define DZL_DEPRECATED_FOR(f) G_DEPRECATED_FOR(f) _DZL_EXTERN
rpm-build f53ec4
#define DZL_UNAVAILABLE(maj,min) G_UNAVAILABLE(maj,min) _DZL_EXTERN
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#define DZL_VERSION_3_28 (G_ENCODE_VERSION (3, 28))
rpm-build f53ec4
rpm-build f53ec4
#if (DZL_MINOR_VERSION == 99)
rpm-build f53ec4
# define DZL_VERSION_CUR_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION + 1, 0))
rpm-build f53ec4
#elif (DZL_MINOR_VERSION % 2)
rpm-build f53ec4
# define DZL_VERSION_CUR_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION, DZL_MINOR_VERSION + 1))
rpm-build f53ec4
#else
rpm-build f53ec4
# define DZL_VERSION_CUR_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION, DZL_MINOR_VERSION))
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#if (DZL_MINOR_VERSION == 99)
rpm-build f53ec4
# define DZL_VERSION_PREV_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION + 1, 0))
rpm-build f53ec4
#elif (DZL_MINOR_VERSION % 2)
rpm-build f53ec4
# define DZL_VERSION_PREV_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION, DZL_MINOR_VERSION - 1))
rpm-build f53ec4
#else
rpm-build f53ec4
# define DZL_VERSION_PREV_STABLE (G_ENCODE_VERSION (DZL_MAJOR_VERSION, DZL_MINOR_VERSION - 2))
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
/**
rpm-build f53ec4
 * DZL_VERSION_MIN_REQUIRED:
rpm-build f53ec4
 *
rpm-build f53ec4
 * A macro that should be defined by the user prior to including
rpm-build f53ec4
 * the dazzle.h header.
rpm-build f53ec4
 *
rpm-build f53ec4
 * The definition should be one of the predefined DZL version
rpm-build f53ec4
 * macros: %DZL_VERSION_3_28, ...
rpm-build f53ec4
 *
rpm-build f53ec4
 * This macro defines the lower bound for the Dazzle API to use.
rpm-build f53ec4
 *
rpm-build f53ec4
 * If a function has been deprecated in a newer version of Dazzle,
rpm-build f53ec4
 * it is possible to use this symbol to avoid the compiler warnings
rpm-build f53ec4
 * without disabling warning for every deprecated function.
rpm-build f53ec4
 *
rpm-build f53ec4
 * Since: 3.28
rpm-build f53ec4
 */
rpm-build f53ec4
#ifndef DZL_VERSION_MIN_REQUIRED
rpm-build f53ec4
# define DZL_VERSION_MIN_REQUIRED (DZL_VERSION_CUR_STABLE)
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
/**
rpm-build f53ec4
 * DZL_VERSION_MAX_ALLOWED:
rpm-build f53ec4
 *
rpm-build f53ec4
 * A macro that should be defined by the user prior to including
rpm-build f53ec4
 * the dazzle.h header.
rpm-build f53ec4
rpm-build f53ec4
 * The definition should be one of the predefined Dazzle version
rpm-build f53ec4
 * macros: %DZL_VERSION_1_0, %DZL_VERSION_1_2,...
rpm-build f53ec4
 *
rpm-build f53ec4
 * This macro defines the upper bound for the DZL API to use.
rpm-build f53ec4
 *
rpm-build f53ec4
 * If a function has been introduced in a newer version of Dazzle,
rpm-build f53ec4
 * it is possible to use this symbol to get compiler warnings when
rpm-build f53ec4
 * trying to use that function.
rpm-build f53ec4
 *
rpm-build f53ec4
 * Since: 3.28
rpm-build f53ec4
 */
rpm-build f53ec4
#ifndef DZL_VERSION_MAX_ALLOWED
rpm-build f53ec4
# if DZL_VERSION_MIN_REQUIRED > DZL_VERSION_PREV_STABLE
rpm-build f53ec4
#  define DZL_VERSION_MAX_ALLOWED (DZL_VERSION_MIN_REQUIRED)
rpm-build f53ec4
# else
rpm-build f53ec4
#  define DZL_VERSION_MAX_ALLOWED (DZL_VERSION_CUR_STABLE)
rpm-build f53ec4
# endif
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#if DZL_VERSION_MAX_ALLOWED < DZL_VERSION_MIN_REQUIRED
rpm-build f53ec4
#error "DZL_VERSION_MAX_ALLOWED must be >= DZL_VERSION_MIN_REQUIRED"
rpm-build f53ec4
#endif
rpm-build f53ec4
#if DZL_VERSION_MIN_REQUIRED < DZL_VERSION_3_28
rpm-build f53ec4
#error "DZL_VERSION_MIN_REQUIRED must be >= DZL_VERSION_3_28"
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#define DZL_AVAILABLE_IN_ALL                   _DZL_EXTERN
rpm-build f53ec4
rpm-build f53ec4
#if DZL_VERSION_MIN_REQUIRED >= DZL_VERSION_3_28
rpm-build f53ec4
# define DZL_DEPRECATED_IN_3_28                DZL_DEPRECATED
rpm-build f53ec4
# define DZL_DEPRECATED_IN_3_28_FOR(f)         DZL_DEPRECATED_FOR(f)
rpm-build f53ec4
#else
rpm-build f53ec4
# define DZL_DEPRECATED_IN_3_28                _DZL_EXTERN
rpm-build f53ec4
# define DZL_DEPRECATED_IN_3_28_FOR(f)         _DZL_EXTERN
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#if DZL_VERSION_MAX_ALLOWED < DZL_VERSION_3_28
rpm-build f53ec4
# define DZL_AVAILABLE_IN_3_28                 DZL_UNAVAILABLE(3, 28)
rpm-build f53ec4
#else
rpm-build f53ec4
# define DZL_AVAILABLE_IN_3_28                 _DZL_EXTERN
rpm-build f53ec4
#endif
rpm-build f53ec4
rpm-build f53ec4
#endif /* DZL_VERSION_MACROS_H */