mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: isolate version information in foamVersion names instead of globals
- For compatibility, access to the old global names is provided via
macros
#define FOAMversion foamVersion::version
#define FOAMbuild foamVersion::build
#define FOAMbuildArch foamVersion::buildArch
- this isolation makes it easier to provide additional scoped methods
for dealing with version related information. Eg, printBuildInfo()
This commit is contained in:
@ -1,3 +1,3 @@
|
||||
Test-foamVersionString.C
|
||||
Test-foamVersion.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-foamVersionString
|
||||
EXE = $(FOAM_USER_APPBIN)/Test-foamVersion
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
|
||||
/* EXE_LIBS = -lfiniteVolume */
|
||||
/* EXE_INC = */
|
||||
/* EXE_LIBS = */
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2018 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -22,24 +22,39 @@ License
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Application
|
||||
foamVersionString.C
|
||||
Test-foamVersion
|
||||
|
||||
Description
|
||||
Print the OpenFOAM version strings.
|
||||
|
||||
Simultaneously the smallest possible program to use a minimal bit of
|
||||
the OpenFOAM library
|
||||
Print the OpenFOAM version information.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include <iostream>
|
||||
#include "foamVersion.H"
|
||||
|
||||
using namespace Foam;
|
||||
|
||||
int main()
|
||||
{
|
||||
std::cout
|
||||
<< "version " << Foam::FOAMversion << "\n"
|
||||
<< "build " << Foam::FOAMbuild << "\n";
|
||||
<< "\nVersion information (macros)\n"
|
||||
<< "version " << Foam::FOAMversion << '\n'
|
||||
<< "build " << Foam::FOAMbuild << '\n'
|
||||
<< "buildArch " << Foam::FOAMbuildArch << '\n';
|
||||
|
||||
std::cout
|
||||
<< "\nVersion information (namespace)\n"
|
||||
<< "version " << foamVersion::version << '\n'
|
||||
<< "build " << foamVersion::build << '\n'
|
||||
<< "buildArch " << foamVersion::buildArch << '\n';
|
||||
|
||||
std::cout
|
||||
<< "\nVerify memory addesses are identical:\n"
|
||||
<< "macro " << long(&(Foam::FOAMversion)) << '\n'
|
||||
<< "namespace " << long(&(foamVersion::version)) << '\n';
|
||||
|
||||
std::cout
|
||||
<< "\nEnd\n";
|
||||
|
||||
return 0;
|
||||
}
|
||||
Reference in New Issue
Block a user