mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-04 02:09:44 +02:00
Build adjustments of C++11
This commit is contained in:
parent
41c453c545
commit
a26cc9e6e3
3 changed files with 7 additions and 32 deletions
|
@ -517,6 +517,7 @@ model {
|
||||||
binaries {
|
binaries {
|
||||||
all{ b ->
|
all{ b ->
|
||||||
if (b.toolChain in Gcc) {
|
if (b.toolChain in Gcc) {
|
||||||
|
b.cppCompiler.args "-std=c++11"
|
||||||
b.cppCompiler.args "-Wall"
|
b.cppCompiler.args "-Wall"
|
||||||
b.cppCompiler.args "-O2" // for DEBUG, comment this line out
|
b.cppCompiler.args "-O2" // for DEBUG, comment this line out
|
||||||
// b.cppCompiler.args "-g" // for DEBUG, uncomment this line
|
// b.cppCompiler.args "-g" // for DEBUG, uncomment this line
|
||||||
|
|
|
@ -29,7 +29,7 @@ endif
|
||||||
ifeq ($(OS),Darwin)
|
ifeq ($(OS),Darwin)
|
||||||
MAKE_STATIC=
|
MAKE_STATIC=
|
||||||
ARCH_TYPE=-arch x86_64
|
ARCH_TYPE=-arch x86_64
|
||||||
ADDITIONAL_FLAGS=-std=c++11 -mmacosx-version-min=10.6 -w
|
ADDITIONAL_FLAGS=-mmacosx-version-min=10.6 -w
|
||||||
OSDIR=osx64
|
OSDIR=osx64
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
@ -37,12 +37,12 @@ CC=gcc
|
||||||
CXX=g++
|
CXX=g++
|
||||||
|
|
||||||
# Debug flags
|
# Debug flags
|
||||||
DBG_CXXFLAGS=-g -Wall -Wno-sign-compare
|
DBG_CXXFLAGS=-g -std=c++11 -Wall -Wno-sign-compare
|
||||||
#DBG_CXXFLAGS=-g -pg -Wall -Wno-sign-compare
|
#DBG_CXXFLAGS=-g -pg -Wall -Wno-sign-compare
|
||||||
#DBG_CXXFLAGS=-g -fprofile-arcs -ftest-coverage -Wall -Wno-sign-compare
|
#DBG_CXXFLAGS=-g -fprofile-arcs -ftest-coverage -Wall -Wno-sign-compare
|
||||||
|
|
||||||
# Optimization flags
|
# Optimization flags
|
||||||
OPT_CXXFLAGS=-O2 -Wall -Wno-sign-compare
|
OPT_CXXFLAGS=-O2 -std=c++11 -Wall -Wno-sign-compare
|
||||||
|
|
||||||
YACC=bison
|
YACC=bison
|
||||||
|
|
||||||
|
|
|
@ -19,32 +19,6 @@
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
#include "address.hh"
|
#include "address.hh"
|
||||||
|
|
||||||
#if defined(_WINDOWS) && !defined(INFINITY)
|
|
||||||
|
|
||||||
// Some definitions for Windows floating point stuff
|
|
||||||
#include <cfloat>
|
|
||||||
|
|
||||||
inline int4 signbit(double x) {
|
|
||||||
return (((_fpclass(x)& (_FPCLASS_NINF | _FPCLASS_NN
|
|
||||||
| _FPCLASS_ND | _FPCLASS_NZ))!=0) ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int4 isnan(double x) {
|
|
||||||
return (((_fpclass(x)& (_FPCLASS_SNAN | _FPCLASS_QNAN))!=0) ? 1 : 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline int4 isinf(double x) {
|
|
||||||
int4 classify = _fpclass(x);
|
|
||||||
if (classify == _FPCLASS_NINF) return -1;
|
|
||||||
if (classify == _FPCLASS_PINF) return 1;
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
#define INFINITY HUGE_VAL
|
|
||||||
#define NAN (INFINITY/INFINITY)
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/// Set format for a given encoding size according to IEEE 754 standards
|
/// Set format for a given encoding size according to IEEE 754 standards
|
||||||
/// \param sz is the size of the encoding in bytes
|
/// \param sz is the size of the encoding in bytes
|
||||||
FloatFormat::FloatFormat(int4 sz)
|
FloatFormat::FloatFormat(int4 sz)
|
||||||
|
@ -105,10 +79,10 @@ FloatFormat::floatclass FloatFormat::extractExpSig(double x,bool *sgn,uintb *sig
|
||||||
{
|
{
|
||||||
int4 e;
|
int4 e;
|
||||||
|
|
||||||
*sgn = (signbit(x) != 0);
|
*sgn = std::signbit(x);
|
||||||
if (x == 0.0) return zero;
|
if (x == 0.0) return zero;
|
||||||
if (isinf(x)!=0) return infinity;
|
if (std::isinf(x)) return infinity;
|
||||||
if (isnan(x)!=0) return nan;
|
if (std::isnan(x)) return nan;
|
||||||
if (*sgn)
|
if (*sgn)
|
||||||
x = -x;
|
x = -x;
|
||||||
double norm = frexp(x,&e); // norm is between 1/2 and 1
|
double norm = frexp(x,&e); // norm is between 1/2 and 1
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue