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

Last change on this file since 2451 was 2451, checked in by Peter, 12 years ago

update copyright years

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