[BW]: [Ign] #pragma warning enclosed into _MSC_VER to avoid gcc complaining
[BW]: [NIP] Added LLCONST and ULLCONST macros to safely declare large literals incl. setting its type and avoid gcc compile error this way.
This commit is contained in:
parent
10a6e76375
commit
d2eefb7ed4
3 changed files with 18 additions and 8 deletions
|
|
@ -3,8 +3,10 @@
|
||||||
#include <fc/string.hpp>
|
#include <fc/string.hpp>
|
||||||
#include <fc/optional.hpp>
|
#include <fc/optional.hpp>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning (push)
|
#pragma warning (push)
|
||||||
#pragma warning (disable : 4244)
|
#pragma warning (disable : 4244)
|
||||||
|
#endif //// _MSC_VER
|
||||||
|
|
||||||
namespace fc {
|
namespace fc {
|
||||||
class microseconds {
|
class microseconds {
|
||||||
|
|
@ -91,5 +93,6 @@ namespace fc {
|
||||||
typedef fc::optional<time_point> otime_point;
|
typedef fc::optional<time_point> otime_point;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning (pop)
|
#pragma warning (pop)
|
||||||
|
#endif /// #ifdef _MSC_VER
|
||||||
|
|
|
||||||
|
|
@ -2,8 +2,10 @@
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning (push)
|
#pragma warning (push)
|
||||||
#pragma warning (disable : 4244)
|
#pragma warning (disable : 4244)
|
||||||
|
#endif //// _MSC_VER
|
||||||
|
|
||||||
namespace fc
|
namespace fc
|
||||||
{
|
{
|
||||||
|
|
@ -114,5 +116,6 @@ namespace std
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef _MSC_VER
|
||||||
#pragma warning (pop)
|
#pragma warning (pop)
|
||||||
|
#endif ///_MSC_VER
|
||||||
|
|
|
||||||
|
|
@ -59,3 +59,7 @@ namespace fc {
|
||||||
a = fc::move(b);
|
a = fc::move(b);
|
||||||
b = fc::move(tmp);
|
b = fc::move(tmp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#define LLCONST(constant) static_cast<int64_t>(constant##ll)
|
||||||
|
#define ULLCONST(constant) static_cast<uint64_t>(constant##ull)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue