mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2024-11-21 19:42:14 +00:00
Merge remote-tracking branch 'origin/GP-604_DecompilerC++11'
This commit is contained in:
commit
0c9cd4b111
@ -517,6 +517,7 @@ model {
|
||||
binaries {
|
||||
all{ b ->
|
||||
if (b.toolChain in Gcc) {
|
||||
b.cppCompiler.args "-std=c++11"
|
||||
b.cppCompiler.args "-Wall"
|
||||
b.cppCompiler.args "-O2" // for DEBUG, comment this line out
|
||||
// b.cppCompiler.args "-g" // for DEBUG, uncomment this line
|
||||
|
@ -29,7 +29,7 @@ endif
|
||||
ifeq ($(OS),Darwin)
|
||||
MAKE_STATIC=
|
||||
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
|
||||
endif
|
||||
|
||||
@ -37,12 +37,12 @@ CC=gcc
|
||||
CXX=g++
|
||||
|
||||
# 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 -fprofile-arcs -ftest-coverage -Wall -Wno-sign-compare
|
||||
|
||||
# Optimization flags
|
||||
OPT_CXXFLAGS=-O2 -Wall -Wno-sign-compare
|
||||
OPT_CXXFLAGS=-O2 -std=c++11 -Wall -Wno-sign-compare
|
||||
|
||||
YACC=bison
|
||||
|
||||
|
@ -19,32 +19,6 @@
|
||||
#include <cmath>
|
||||
#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
|
||||
/// \param sz is the size of the encoding in bytes
|
||||
FloatFormat::FloatFormat(int4 sz)
|
||||
@ -105,10 +79,10 @@ FloatFormat::floatclass FloatFormat::extractExpSig(double x,bool *sgn,uintb *sig
|
||||
{
|
||||
int4 e;
|
||||
|
||||
*sgn = (signbit(x) != 0);
|
||||
*sgn = std::signbit(x);
|
||||
if (x == 0.0) return zero;
|
||||
if (isinf(x)!=0) return infinity;
|
||||
if (isnan(x)!=0) return nan;
|
||||
if (std::isinf(x)) return infinity;
|
||||
if (std::isnan(x)) return nan;
|
||||
if (*sgn)
|
||||
x = -x;
|
||||
double norm = frexp(x,&e); // norm is between 1/2 and 1
|
||||
|
Loading…
Reference in New Issue
Block a user