From 03b9c143770566ebcbee7ca3abde223529c07ce9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?S=C3=B8ren=20Sandmann?= Date: Wed, 26 Mar 2008 01:49:56 -0400 Subject: [PATCH] Move version functions from pixman-version.c into pixman-utils.c. Delete pixman-version.c --- configure.ac | 33 ++++++++++++++-------- pixman/Makefile.am | 3 +- pixman/pixman-utils.c | 43 +++++++++++++++++++++++++++++ pixman/pixman-version.c | 73 ------------------------------------------------- 4 files changed, 66 insertions(+), 86 deletions(-) delete mode 100644 pixman/pixman-version.c diff --git a/configure.ac b/configure.ac index e39f4c0..f0563ac 100644 --- a/configure.ac +++ b/configure.ac @@ -24,25 +24,36 @@ AC_PREREQ([2.57]) # Pixman versioning scheme # -# - If the changes don't affect API or ABI, then increment pixman_micro -# Note: This number is incremented immediately before *and* -# immediately after a release. This gurantees that the micro -# component is always an even number in any release. +# - The git version must at all times have an odd MICRO version +# number. # -# - If API is added, then increment PIXMAN_MINOR, and set MICRO to 0 +# - If you add API, increment the MICRO version to the next largest +# odd number. # -# - If you break ABI, then -# - In the first development release where you break ABI, find all instances of -# "pixman-n" and change it to pixman-(n+1) +# - If you release a version that contains new API, then increment +# MINOR and set MICRO to 0. +# +# - If you release a new version that does not contain new API, then +# increment MICRO to the next even number. +# +# - After doing a release, increment MICRO again to make the version +# number in git odd. +# +# - If you break the ABI, then +# +# - increment MAJOR +# +# - In the first development release where you break ABI, find +# all instances of "pixman-n" and change them to pixman-(n+1) # # This needs to be done at least in # configure.ac # all Makefile.am's # pixman-n.pc.in # -# This ensures that binary incompatible versions can be installed in parallel. -# See http://www106.pair.com/rhp/parallel.html for more information -# +# This ensures that binary incompatible versions can be installed +# in parallel. See http://www106.pair.com/rhp/parallel.html for +# more information m4_define([pixman_major], 0) m4_define([pixman_minor], 9) diff --git a/pixman/Makefile.am b/pixman/Makefile.am index ff3997b..a4eacaa 100644 --- a/pixman/Makefile.am +++ b/pixman/Makefile.am @@ -21,8 +21,7 @@ libpixman_1_la_SOURCES = \ pixman-edge-imp.h \ pixman-trap.c \ pixman-compute-region.c \ - pixman-timer.c \ - pixman-version.c + pixman-timer.c libpixmanincludedir = $(includedir)/pixman-1/ libpixmaninclude_HEADERS = pixman.h pixman-version.h diff --git a/pixman/pixman-utils.c b/pixman/pixman-utils.c index 9cba793..b100d09 100644 --- a/pixman/pixman-utils.c +++ b/pixman/pixman-utils.c @@ -408,6 +408,49 @@ pixman_malloc_abc (unsigned int a, return malloc (a * b * c); } + +/** + * pixman_version: + * + * Returns the version of the pixman library encoded in a single + * integer as per %PIXMAN_VERSION_ENCODE. The encoding ensures that + * later versions compare greater than earlier versions. + * + * A run-time comparison to check that pixman's version is greater than + * or equal to version X.Y.Z could be performed as follows: + * + * + * if (pixman_version() >= PIXMAN_VERSION_ENCODE(X,Y,Z)) {...} + * + * + * See also pixman_version_string() as well as the compile-time + * equivalents %PIXMAN_VERSION and %PIXMAN_VERSION_STRING. + * + * Return value: the encoded version. + **/ +int +pixman_version (void) +{ + return PIXMAN_VERSION; +} + +/** + * pixman_version_string: + * + * Returns the version of the pixman library as a human-readable string + * of the form "X.Y.Z". + * + * See also pixman_version() as well as the compile-time equivalents + * %PIXMAN_VERSION_STRING and %PIXMAN_VERSION. + * + * Return value: a string containing the version. + **/ +const char* +pixman_version_string (void) +{ + return PIXMAN_VERSION_STRING; +} + /** * pixman_format_supported_destination: * @format: A pixman_format_code_t format diff --git a/pixman/pixman-version.c b/pixman/pixman-version.c deleted file mode 100644 index 58ac057..0000000 --- a/pixman/pixman-version.c +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright © 2008 Red Hat, Inc. - * - * Permission is hereby granted, free of charge, to any person - * obtaining a copy of this software and associated documentation - * files (the "Software"), to deal in the Software without - * restriction, including without limitation the rights to use, copy, - * modify, merge, publish, distribute, sublicense, and/or sell copies - * of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be - * included in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS - * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN - * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE. - * - * Author: Carl D. Worth - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include "pixman-private.h" - -/** - * pixman_version: - * - * Returns the version of the pixman library encoded in a single - * integer as per %PIXMAN_VERSION_ENCODE. The encoding ensures that - * later versions compare greater than earlier versions. - * - * A run-time comparison to check that pixman's version is greater than - * or equal to version X.Y.Z could be performed as follows: - * - * - * if (pixman_version() >= PIXMAN_VERSION_ENCODE(X,Y,Z)) {...} - * - * - * See also pixman_version_string() as well as the compile-time - * equivalents %PIXMAN_VERSION and %PIXMAN_VERSION_STRING. - * - * Return value: the encoded version. - **/ -int -pixman_version (void) -{ - return PIXMAN_VERSION; -} - -/** - * pixman_version_string: - * - * Returns the version of the pixman library as a human-readable string - * of the form "X.Y.Z". - * - * See also pixman_version() as well as the compile-time equivalents - * %PIXMAN_VERSION_STRING and %PIXMAN_VERSION. - * - * Return value: a string containing the version. - **/ -const char* -pixman_version_string (void) -{ - return PIXMAN_VERSION_STRING; -} -- 2.7.4