Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Optionally allow EABase to be used when floating point types are not available #6

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions doc/EABase.html
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,8 @@ <h4>Compiler Definitions<br>

EA_COMPILER_NO_UNWIND<br>

EA_COMPILER_NO_FLOATS<br>

<br>

EA_COMPILER_IS_ANSIC<br>
Expand Down
4 changes: 4 additions & 0 deletions include/Common/EABase/int128.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,11 @@ struct EA_INT128_ALIGNAS int128_t_base
// EA_CONSTEXPR explicit operator char32_t() const;
// EA_CONSTEXPR explicit operator wchar_t() const;
#endif
#if !defined(EA_COMPILER_NO_FLOATS)
EA_CONSTEXPR explicit operator float() const;
EA_CONSTEXPR explicit operator double() const;
EA_CONSTEXPR explicit operator long double() const;
#endif
#if EA_INT128_INTRINSIC_AVAILABLE
EA_CONSTEXPR explicit operator __int128() const;
EA_CONSTEXPR explicit operator unsigned __int128() const;
Expand Down Expand Up @@ -280,9 +282,11 @@ EA_CONSTEXPR inline int128_t_base::operator unsigned int() const { return
EA_CONSTEXPR inline int128_t_base::operator unsigned long long() const { return static_cast<unsigned long long>(Low()); }
EA_CONSTEXPR inline int128_t_base::operator unsigned long() const { return static_cast<unsigned long>(Low()); }
EA_CONSTEXPR inline int128_t_base::operator unsigned short() const { return static_cast<unsigned short>(Low()); }
#if !defined(EA_COMPILER_NO_FLOATS)
EA_CONSTEXPR inline int128_t_base::operator float() const { return static_cast<float>(Low()); }
EA_CONSTEXPR inline int128_t_base::operator double() const { return static_cast<double>(Low()); }
EA_CONSTEXPR inline int128_t_base::operator long double() const { return static_cast<long double>(Low()); }
#endif
#if EA_INT128_INTRINSIC_AVAILABLE
EA_CONSTEXPR inline int128_t_base::operator __int128() const { return static_cast<__int128>(Low()); }
EA_CONSTEXPR inline int128_t_base::operator unsigned __int128() const { return static_cast<unsigned __int128>(Low()); }
Expand Down