mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: support scalar tokens when testing #if, #ifeq
- this allows use of #eval results in the tests
This commit is contained in:
committed by
Andrew Heather
parent
0838d121c6
commit
a5a222f7cf
@ -1,16 +1,16 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1906 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||
| \\ / O peration | Version: v1912 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object dictionary;
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object dictionary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -26,3 +26,5 @@ FoamFile
|
||||
#else
|
||||
version "other";
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
32
tutorials/IO/dictionary/good-if2.dict
Normal file
32
tutorials/IO/dictionary/good-if2.dict
Normal file
@ -0,0 +1,32 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: v1912 |
|
||||
| \\ / A nd | Website: www.openfoam.com |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object dictionary;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
// Do comparison
|
||||
|
||||
#if #eval "${FOAM_API:-0}"
|
||||
foamApi nonZero;
|
||||
#else
|
||||
foamApi zeroValue;
|
||||
#endif
|
||||
|
||||
#if #eval "${XX_XXX_FOAM_API:-1000}"
|
||||
other "some entry";
|
||||
#else
|
||||
other "unexpected";
|
||||
#endif
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user