Added support for glibc < 2.18

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1474
This commit is contained in:
Henry
2015-01-04 20:13:37 +00:00
parent 3857ba0cda
commit 097f23e11a
13 changed files with 21 additions and 20 deletions

View File

@ -1,6 +1,7 @@
// code taken more-or-less from Paul Hsieh's tests // code taken more-or-less from Paul Hsieh's tests
#include "Hasher.H" #include "Hasher.H"
#include "int.H"
#include <stdio.h> #include <stdio.h>
#include <time.h> #include <time.h>
@ -52,7 +53,6 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
#include <stdio.h> /* defines printf for tests */ #include <stdio.h> /* defines printf for tests */
#include <time.h> /* defines time_t for timings in the test */ #include <time.h> /* defines time_t for timings in the test */
#include <stdint.h> /* defines uint32_t etc */
#include <sys/param.h> /* attempt to define endianness */ #include <sys/param.h> /* attempt to define endianness */
#ifdef linux #ifdef linux
# include <endian.h> /* attempt to define endianness */ # include <endian.h> /* attempt to define endianness */

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,7 +44,6 @@ License
#endif #endif
#include <stdint.h>
#include <limits> #include <limits>
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License

View File

@ -49,7 +49,7 @@ T Foam::dictionary::lookupOrDefault
{ {
IOInfoIn("dictionary::lookupOrDefault", *this) IOInfoIn("dictionary::lookupOrDefault", *this)
<< "Optional entry '" << keyword << "' is not present," << "Optional entry '" << keyword << "' is not present,"
<< " returning the default value '" << deflt << " returning the default value '" << deflt << "'"
<< endl; << endl;
} }
@ -79,7 +79,7 @@ T Foam::dictionary::lookupOrAddDefault
{ {
IOInfoIn("dictionary::lookupOrAddDefault", *this) IOInfoIn("dictionary::lookupOrAddDefault", *this)
<< "Optional entry '" << keyword << "' is not present," << "Optional entry '" << keyword << "' is not present,"
<< " adding and returning the default value '" << deflt << " adding and returning the default value '" << deflt << "'"
<< endl; << endl;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -35,7 +35,7 @@ Description
#ifndef contiguous_H #ifndef contiguous_H
#define contiguous_H #define contiguous_H
#include <stdint.h> #include "int.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,9 +36,7 @@ SeeAlso
#define HasherInt_H #define HasherInt_H
#include "Hasher.H" #include "Hasher.H"
#include "int.H"
#include <cstddef>
#include <stdint.h> // C++0x uses <cstdint>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -44,8 +44,8 @@ SourceFiles
#include <string> #include <string>
#include <cstddef> #include <cstddef>
#include <stdint.h> // C++0x uses <cstdint>
#include "int.H"
#include "SHA1Digest.H" #include "SHA1Digest.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -36,6 +36,7 @@ SourceFiles
#ifndef int32_H #ifndef int32_H
#define int32_H #define int32_H
#define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>
#include <climits> #include <climits>
#include <cstdlib> #include <cstdlib>

View File

@ -36,6 +36,7 @@ SourceFiles
#ifndef int64_H #ifndef int64_H
#define int64_H #define int64_H
#define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>
#include <climits> #include <climits>
#include <cstdlib> #include <cstdlib>

View File

@ -36,6 +36,7 @@ SourceFiles
#ifndef uint32_H #ifndef uint32_H
#define uint32_H #define uint32_H
#define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>
#include <climits> #include <climits>
#include <cstdlib> #include <cstdlib>

View File

@ -36,6 +36,7 @@ SourceFiles
#ifndef uint64_H #ifndef uint64_H
#define uint64_H #define uint64_H
#define __STDC_LIMIT_MACROS
#include <stdint.h> #include <stdint.h>
#include <climits> #include <climits>
#include <cstdlib> #include <cstdlib>

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -513,11 +513,11 @@ Foam::label Foam::ptscotchDecomp::decompose
if (Pstream::master()) if (Pstream::master())
{ {
if (velotabSum > scalar(INT_MAX - 1)) if (velotabSum > scalar(labelMax - 1))
{ {
// 0.9 factor of safety to avoid floating point round-off in // 0.9 factor of safety to avoid floating point round-off in
// rangeScale tipping the subsequent sum over the integer limit. // rangeScale tipping the subsequent sum over the integer limit.
rangeScale = 0.9*scalar(INT_MAX - 1)/velotabSum; rangeScale = 0.9*scalar(labelMax - 1)/velotabSum;
WarningIn WarningIn
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -403,11 +403,11 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
scalar rangeScale(1.0); scalar rangeScale(1.0);
if (velotabSum > scalar(INT_MAX - 1)) if (velotabSum > scalar(labelMax - 1))
{ {
// 0.9 factor of safety to avoid floating point round-off in // 0.9 factor of safety to avoid floating point round-off in
// rangeScale tipping the subsequent sum over the integer limit. // rangeScale tipping the subsequent sum over the integer limit.
rangeScale = 0.9*scalar(INT_MAX - 1)/velotabSum; rangeScale = 0.9*scalar(labelMax - 1)/velotabSum;
WarningIn WarningIn
( (