root/OpenSceneGraph/trunk/include/osg/Version @ 10173

Revision 10173, 3.4 kB (checked in by robert, 5 years ago)

Added OSG_MIN_VERSION_REQUIRED, OSG_VERSION_LESS_THAN, OSG_VERSION_LESS_OR_EQUAL, OSG_VERSION_GREATER_THAN, OSG_VERSION_GREATER_OR_EQUAL macros to help out with management of feature usage in 3rd party libs and applications

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
RevLine 
[5328]1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
[1529]2 *
3 * This library is open source and may be redistributed and/or modified under 
4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
5 * (at your option) any later version.  The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
7 *
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11 * OpenSceneGraph Public License for more details.
12*/
[51]13
[3440]14#ifndef OSG_VERSION
15#define OSG_VERSION 1
[2]16
17#include <osg/Export>
18
19extern "C" {
20
[6656]21
[7945]22#define OPENSCENEGRAPH_MAJOR_VERSION    2
[9696]23#define OPENSCENEGRAPH_MINOR_VERSION    9
[10173]24#define OPENSCENEGRAPH_PATCH_VERSION    5
25#define OPENSCENEGRAPH_SOVERSION        60
[4113]26
[10173]27/** convinience macro that can be used to decide whether a feature is present or not i.e.
28  * #if OSG_MIN_VERSION_REQUIRED(2,9,5)
29  *    your code here
30  * #endif
31  */
32#define OSG_MIN_VERSION_REQUIRED(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH))))
33#define OSG_VERSION_LESS_THAN(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION<MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION<MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION<PATCH))))
34#define OSG_VERSION_LESS_OR_EQUAL(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION<MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION<MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION<=PATCH))))
35#define OSG_VERSION_GREATER_THAN(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>PATCH))))
36#define OSG_VERSION_GREATER_OR_EQUAL(MAJOR, MINOR, PATCH) ((OPENSCENEGRAPH_MAJOR_VERSION>MAJOR) || (OPENSCENEGRAPH_MAJOR_VERSION==MAJOR && (OPENSCENEGRAPH_MINOR_VERSION>MINOR || (OPENSCENEGRAPH_MINOR_VERSION==MINOR && OPENSCENEGRAPH_PATCH_VERSION>=PATCH))))
37
38
[2]39/**
[3413]40  * osgGetVersion() returns the library version number.
[4707]41 * Numbering convention : OpenSceneGraph-1.0 will return 1.0 from osgGetVersion.
[3413]42  *
43  * This C function can be also used to check for the existence of the OpenSceneGraph
44  * library using autoconf and its m4 macro AC_CHECK_LIB.
45  *
46  * Here is the code to add to your configure.in:
[2]47 \verbatim
48 #
49 # Check for the OpenSceneGraph (OSG) library
50 #
51 AC_CHECK_LIB(osg, osgGetVersion, ,
52    [AC_MSG_ERROR(OpenSceneGraph library not found. See http://www.openscenegraph.org)],)
53 \endverbatim
54*/
[4021]55extern OSG_EXPORT const char* osgGetVersion();
[2]56
[7383]57/** The osgGetSOVersion() method returns the OpenSceneGraph soversion number. */
58extern OSG_EXPORT const char* osgGetSOVersion();
59
[3413]60/** The osgGetLibraryName() method returns the library name in human-friendly form. */
[4021]61extern OSG_EXPORT const char* osgGetLibraryName();
[2]62
[7383]63// old defines for backwards compatibility.
64#define OSG_VERSION_MAJOR OPENSCENEGRAPH_MAJOR_VERSION
65#define OSG_VERSION_MINOR OPENSCENEGRAPH_MINOR_VERSION
66#define OSG_VERSION_PATCH OPENSCENEGRAPH_PATCH_VERSION
67
68#define OSG_VERSION_RELEASE OSG_VERSION_PATCH
69#define OSG_VERSION_REVISION 0
70
71
[349]72}
[2]73
74#endif
Note: See TracBrowser for help on using the browser.