mirror of
https://github.com/NationalSecurityAgency/ghidra.git
synced 2025-10-03 17:59:46 +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
|
@ -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…
Add table
Add a link
Reference in a new issue