xrootd
XrdVersion.hh
Go to the documentation of this file.
1 /******************************************************************************/
2 /* */
3 /* X r d V e r s i o n . h h . i n */
4 /* */
5 /* (c) 2012 by the Board of Trustees of the Leland Stanford, Jr., University */
6 /* */
7 /* This file is part of the XRootD software suite. */
8 /* */
9 /* XRootD is free software: you can redistribute it and/or modify it under */
10 /* the terms of the GNU Lesser General Public License as published by the */
11 /* Free Software Foundation, either version 3 of the License, or (at your */
12 /* option) any later version. */
13 /* */
14 /* XRootD is distributed in the hope that it will be useful, but WITHOUT */
15 /* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or */
16 /* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public */
17 /* License for more details. */
18 /* */
19 /* You should have received a copy of the GNU Lesser General Public License */
20 /* along with XRootD in a file called COPYING.LESSER (LGPL license) and file */
21 /* COPYING (GPL license). If not, see <http://www.gnu.org/licenses/>. */
22 /* */
23 /* The copyright holder's institutional names and contributor's names may not */
24 /* be used to endorse or promote products derived from this software without */
25 /* specific prior written permission of the institution or contributor. */
26 /******************************************************************************/
27 
28 // this file is automatically updated by the genversion.sh script
29 // if you touch anything make sure that it still works
30 
31 #ifndef __XRD_VERSION_H__
32 #define __XRD_VERSION_H__
33 
34 #define XrdVERSION "v3.3.2"
35 
36 // Numeric representation of the version tag
37 // The format for the released code is: xyyzz, where: x is the major version,
38 // y is the minor version and zz is the bugfix revision number
39 // For the non-released code the value is 1000000
40 #define XrdVNUMUNK 1000000
41 #define XrdVNUMBER 30302
42 
43 #if XrdDEBUG
44 #define XrdVSTRING XrdVERSION "_dbg"
45 #else
46 #define XrdVSTRING XrdVERSION
47 #endif
48 
49 #define XrdDEFAULTPORT 1094;
50 
51 // The following macros extract version digits from a numeric version number
52 #define XrdMajorVNUM(x) x/10000
53 #define XrdMinorVNUM(x) x/100%100
54 #define XrdPatchVNUM(x) x%100
55 
56 // The following structure defines the standard way to record a version. You can
57 // determine component version numbers within an object file by simply executing
58 // "strings <objectfile> | grep '@V:'".
59 //
60 struct XrdVersionInfo {int vNum; const char vOpt; const char vPfx[3];\
61  const char vStr[40];};
62 
63 // Macro to define the suffix to use when generating the extern version symbol.
64 // This is used by SysPlugin. We cannot use it here as cpp does not expand the
65 // macro when catenating tokens togther and we want to avoid yet another macro.
66 //
67 #define XrdVERSIONINFOSFX "_"
68 
69 // The following macro defines a local copy of version information. Parameters:
70 // x -> The variable name of the version information structure
71 // y -> An unquoted 1- to 15-character component name (e.g. cmsd, seckrb5)
72 // vn -> The integer version number to be used
73 // vs -> The string version number to be used
74 //
75 #define XrdVERSIONINFODEF(x,y,vn,vs) \
76  XrdVersionInfo x = \
77  {vn, (sizeof(#y)-1) & 0x0f,{'@','V',':'}, #y " " vs}
78 
79 // The following macro defines an externally referencable structure that records
80 // the version used to compile code. It is used by the plugin loader. Parms:
81 // x -> The variable name of the version information structure
82 // y -> An unquoted 1- to 15-character component name (e.g. cmsd, seckrb5, etc).
83 //
84 #define XrdVERSIONINFO(x,y) \
85  extern "C" {XrdVERSIONINFODEF(x##_,y,XrdVNUMBER,XrdVERSION);}
86 
87 // The following macro is an easy way to declare externally defined version
88 // information. This macro must be used at file level.
89 //
90 #define XrdVERSIONINFOREF(x) extern "C" XrdVersionInfo x##_
91 
92 // The following macro can be used to reference externally defined version
93 // information. As the composition of the symbolic name may change you should
94 // use this macro to refer to the version information declaration.
95 //
96 #define XrdVERSIONINFOVAR(x) x##_
97 #endif