[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/optional.hpp>
|
||||
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4244)
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4244)
|
||||
#endif //// _MSC_VER
|
||||
|
||||
namespace fc {
|
||||
class microseconds {
|
||||
|
|
@ -91,5 +93,6 @@ namespace fc {
|
|||
typedef fc::optional<time_point> otime_point;
|
||||
}
|
||||
|
||||
#pragma warning (pop)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif /// #ifdef _MSC_VER
|
||||
|
|
|
|||
|
|
@ -2,8 +2,10 @@
|
|||
#include <stdint.h>
|
||||
#include <string>
|
||||
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4244)
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (push)
|
||||
#pragma warning (disable : 4244)
|
||||
#endif //// _MSC_VER
|
||||
|
||||
namespace fc
|
||||
{
|
||||
|
|
@ -114,5 +116,6 @@ namespace std
|
|||
};
|
||||
}
|
||||
|
||||
#pragma warning (pop)
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#pragma warning (pop)
|
||||
#endif ///_MSC_VER
|
||||
|
|
|
|||
|
|
@ -59,3 +59,7 @@ namespace fc {
|
|||
a = fc::move(b);
|
||||
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