Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 193e946be0
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 112 lines (90 sloc) 4.504 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111

/* Copyright (c) 2012, Stefan Eilemann <eile@eyescale.ch>
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License version 2.1 as published
* by the Free Software Foundation.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*
* You should have received a copy of the GNU Lesser General Public License
* along with this library; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*/

#ifndef GLSTATS_VERSION_H
#define GLSTATS_VERSION_H

#include <GLStats/api.h>
#include <GLStats/types.h>
#include <string>

namespace GLStats
{
    // GLStats version macros and functions
    /** The current major version. @version 0.4 */
# define GLSTATS_VERSION_MAJOR @VERSION_MAJOR@

    /** The current minor version. @version 0.4 */
# define GLSTATS_VERSION_MINOR @VERSION_MINOR@

    /** The current patch level. @version 0.4 */
# define GLSTATS_VERSION_PATCH @VERSION_PATCH@

    /** The current DSO binary revision. @version 0.4 */
# define GLSTATS_VERSION_ABI @VERSION_ABI@

/** True if the current version is newer than the given one. @version 0.4 */
# define GLSTATS_VERSION_GT( MAJOR, MINOR, PATCH ) \
( (GLSTATS_VERSION_MAJOR>MAJOR) || \
(GLSTATS_VERSION_MAJOR==MAJOR && \
(GLSTATS_VERSION_MINOR>MINOR || \
(GLSTATS_VERSION_MINOR==MINOR && GLSTATS_VERSION_PATCH>PATCH))))

/** True if the current version is equal or newer to the given. @version 0.4 */
# define GLSTATS_VERSION_GE( MAJOR, MINOR, PATCH ) \
( (GLSTATS_VERSION_MAJOR>MAJOR) || \
(GLSTATS_VERSION_MAJOR==MAJOR && \
(GLSTATS_VERSION_MINOR>MINOR || \
(GLSTATS_VERSION_MINOR==MINOR && GLSTATS_VERSION_PATCH>=PATCH))))

/** True if the current version is older than the given one. @version 0.4 */
# define GLSTATS_VERSION_LT( MAJOR, MINOR, PATCH ) \
( (GLSTATS_VERSION_MAJOR<MAJOR) || \
(GLSTATS_VERSION_MAJOR==MAJOR && \
(GLSTATS_VERSION_MINOR<MINOR || \
(GLSTATS_VERSION_MINOR==MINOR && GLSTATS_VERSION_PATCH<PATCH))))

/** True if the current version is older or equal to the given. @version 0.4 */
# define GLSTATS_VERSION_LE( MAJOR, MINOR, PATCH ) \
( (GLSTATS_VERSION_MAJOR<MAJOR) || \
(GLSTATS_VERSION_MAJOR==MAJOR && \
(GLSTATS_VERSION_MINOR<MINOR || \
(GLSTATS_VERSION_MINOR==MINOR && GLSTATS_VERSION_PATCH<=PATCH))))

    /** Information about the current GLStats version. */
    class GLSTATS_API Version
    {
    public:
        /** @return the current major version of GLStats. @version 0.4 */
        static uint32_t getMajor();

        /** @return the current minor version of GLStats. @version 0.4 */
        static uint32_t getMinor();

        /** @return the current patch level of GLStats. @version 0.4 */
        static uint32_t getPatch();

        /** @return the current revision of GLStats. @version 0.4 */
        static std::string getRevision();

        /** @return the current DSO binary revision. @version 0.4 */
        static uint32_t getABI();

        /** @return the current GLStats version (MMmmpp). @version 0.4 */
        static uint32_t getInt();

        /** @return the current GLStats version (MM.mmpp). @version 0.4 */
        static float getFloat();

        /**
* @return the current GLStats version (MM.mm.pp[.rr]).
* @version 1.1
*/
        static std::string getString();

        /**
* @return true if the link-time and compile-time DSO versions are
* compatible.
*/
        static bool check()
        {
            return getMajor()==GLSTATS_VERSION_MAJOR &&
                getMinor()==GLSTATS_VERSION_MINOR;
        }
    };
}

#endif //GLSTATS_VERSION_H
Something went wrong with that request. Please try again.