source: trunk/yat/utility/version.h @ 2431

Last change on this file since 2431 was 2431, checked in by Peter, 11 years ago

fixes #620. Move version defines from 'version.h' to
'config_public.h'. The latter is included from the former so the api
is not changed in the sense that a program that used e.g. YAT_VERSIOn
and included 'version.h' will still compile. version.h is no longer
generated but checked into the repository. This may cause a confict in
developers wc, which can easily be avoided by removing version.h
before updating to with this ChangeSet?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Id
File size: 2.3 KB
Line 
1#ifndef _theplu_yat_utility_version_
2#define _theplu_yat_utility_version_
3
4// @configure_input@
5
6// $Id: version.h 2431 2011-03-06 20:04:31Z peter $
7
8/*
9  Copyright (C) 2008 Jari Häkkinen, Peter Johansson
10  Copyright (C) 2009 Peter Johansson
11
12  This file is part of the yat library, http://dev.thep.lu.se/yat
13
14  The yat library is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License as
16  published by the Free Software Foundation; either version 3 of the
17  License, or (at your option) any later version.
18
19  The yat library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23
24  You should have received a copy of the GNU General Public License
25  along with yat. If not, see <http://www.gnu.org/licenses/>.
26*/
27
28///
29/// \file utility/version.h
30///
31
32/*
33  Compile-time version constants
34
35  \see http://apr.apache.org/versioning.html
36*/
37
38#include "config_public.h"
39
40/**
41   Check at compile time if the version of yat is at least a certain
42   level.
43   @param major The major version component of the version checked
44   for (e.g., the "0" of "0.5.1").
45   @param minor The minor version component of the version checked
46   for (e.g., the "5" of "0.5.1").
47   @param patch The patch level component of the version checked
48   for (e.g., the "1" of "0.5.1").
49
50   \since New in yat 0.5
51 */
52#define YAT_VERSION_AT_LEAST(major,minor,patch)                    \
53(((major) < YAT_MAJOR_VERSION) ||                                    \
54 ((major) == YAT_MAJOR_VERSION && (minor) < YAT_MINOR_VERSION) || \
55 ((major) == YAT_MAJOR_VERSION && (minor) == YAT_MINOR_VERSION &&\
56  (patch) <= YAT_PATCH_VERSION))
57
58#include <string>
59
60namespace theplu {
61namespace yat {
62namespace utility {
63
64  /**
65     \return major version number of compiled yat library
66
67   \since New in yat 0.5
68   */
69  unsigned int major_version(void);
70
71  /**
72     \return minor version number of compiled yat library
73
74     \since New in yat 0.5
75   */
76  unsigned int minor_version(void);
77
78  /**
79     \return patch version number of compiled yat library
80
81     \since New in yat 0.5
82   */
83  unsigned int patch_version(void);
84
85  /**
86     \return version number of compiled yat library
87
88     \since New in yat 0.5
89   */
90  std::string version(void);
91
92}}} // of namespace utility, yat, and theplu
93
94#endif
Note: See TracBrowser for help on using the repository browser.