Added support for glibc < 2.18
Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1474
This commit is contained in:
parent
380de92a48
commit
c93f87cc7f
@ -1,6 +1,7 @@
|
||||
// code taken more-or-less from Paul Hsieh's tests
|
||||
|
||||
#include "Hasher.H"
|
||||
#include "int.H"
|
||||
|
||||
#include <stdio.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 <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 */
|
||||
#ifdef linux
|
||||
# include <endian.h> /* attempt to define endianness */
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,7 +44,6 @@ License
|
||||
|
||||
#endif
|
||||
|
||||
#include <stdint.h>
|
||||
#include <limits>
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
|
@ -49,7 +49,7 @@ T Foam::dictionary::lookupOrDefault
|
||||
{
|
||||
IOInfoIn("dictionary::lookupOrDefault", *this)
|
||||
<< "Optional entry '" << keyword << "' is not present,"
|
||||
<< " returning the default value '" << deflt
|
||||
<< " returning the default value '" << deflt << "'"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
@ -79,7 +79,7 @@ T Foam::dictionary::lookupOrAddDefault
|
||||
{
|
||||
IOInfoIn("dictionary::lookupOrAddDefault", *this)
|
||||
<< "Optional entry '" << keyword << "' is not present,"
|
||||
<< " adding and returning the default value '" << deflt
|
||||
<< " adding and returning the default value '" << deflt << "'"
|
||||
<< endl;
|
||||
}
|
||||
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -35,7 +35,7 @@ Description
|
||||
#ifndef contiguous_H
|
||||
#define contiguous_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "int.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -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) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -36,9 +36,7 @@ SeeAlso
|
||||
#define HasherInt_H
|
||||
|
||||
#include "Hasher.H"
|
||||
|
||||
#include <cstddef>
|
||||
#include <stdint.h> // C++0x uses <cstdint>
|
||||
#include "int.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
@ -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) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -44,8 +44,8 @@ SourceFiles
|
||||
|
||||
#include <string>
|
||||
#include <cstddef>
|
||||
#include <stdint.h> // C++0x uses <cstdint>
|
||||
|
||||
#include "int.H"
|
||||
#include "SHA1Digest.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef int32_H
|
||||
#define int32_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef int64_H
|
||||
#define int64_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef uint32_H
|
||||
#define uint32_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
@ -36,6 +36,7 @@ SourceFiles
|
||||
#ifndef uint64_H
|
||||
#define uint64_H
|
||||
|
||||
#define __STDC_LIMIT_MACROS
|
||||
#include <stdint.h>
|
||||
#include <climits>
|
||||
#include <cstdlib>
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -513,11 +513,11 @@ Foam::label Foam::ptscotchDecomp::decompose
|
||||
|
||||
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
|
||||
// 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
|
||||
(
|
||||
|
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -403,11 +403,11 @@ Foam::label Foam::scotchDecomp::decomposeOneProc
|
||||
|
||||
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
|
||||
// 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
|
||||
(
|
||||
|
Loading…
Reference in New Issue
Block a user