Commit c93f87cc authored by Henry's avatar Henry
Browse files

Added support for glibc < 2.18

Resolves bug-report http://www.openfoam.org/mantisbt/view.php?id=1474
parent 380de92a
// 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
(
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment