mirror of
https://github.com/monero-project/monero.git
synced 2024-12-24 20:49:37 +00:00
Merge pull request #2479
58908295
Fixes static_assert on arm and ppc builds (Lee Clagett)
This commit is contained in:
commit
0f071848a1
1 changed files with 3 additions and 1 deletions
|
@ -29,6 +29,7 @@
|
||||||
#include "json_object.h"
|
#include "json_object.h"
|
||||||
|
|
||||||
#include <limits>
|
#include <limits>
|
||||||
|
#include <type_traits>
|
||||||
#include "string_tools.h"
|
#include "string_tools.h"
|
||||||
|
|
||||||
namespace cryptonote
|
namespace cryptonote
|
||||||
|
@ -52,8 +53,9 @@ namespace
|
||||||
void convert_numeric(Source source, Type& i)
|
void convert_numeric(Source source, Type& i)
|
||||||
{
|
{
|
||||||
static_assert(
|
static_assert(
|
||||||
|
(std::is_same<Type, char>() && std::is_same<Source, int>()) ||
|
||||||
std::numeric_limits<Source>::is_signed == std::numeric_limits<Type>::is_signed,
|
std::numeric_limits<Source>::is_signed == std::numeric_limits<Type>::is_signed,
|
||||||
"source and destination signs do not match"
|
"comparisons below may have undefined behavior"
|
||||||
);
|
);
|
||||||
if (source < std::numeric_limits<Type>::min())
|
if (source < std::numeric_limits<Type>::min())
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue