Skip to content

Commit

Permalink
Fix MSVC build in preprocessor conformance mode (#327)
Browse files Browse the repository at this point in the history
We need to split `""` and `_u` tokens in the `DEFINE_ALIAS_AND_LITERAL`
macro to make it conformant with the C11 preprocessor.
  • Loading branch information
chfast authored Oct 9, 2024
1 parent 72ae825 commit 8885521
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions include/intx/intx.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1581,14 +1581,14 @@ inline constexpr uint256 mulmod(const uint256& x, const uint256& y, const uint25

/// Define type alias uintN = uint<N> and the matching literal ""_uN.
/// The literal operators are defined in the intx::literals namespace.
#define DEFINE_ALIAS_AND_LITERAL(N) \
using uint##N = uint<N>; \
namespace literals \
{ \
consteval uint##N operator""_u##N(const char* s) \
{ \
return from_string<uint##N>(s); \
} \
#define DEFINE_ALIAS_AND_LITERAL(N) \
using uint##N = uint<N>; \
namespace literals \
{ \
consteval uint##N operator"" _u##N(const char* s) \
{ \
return from_string<uint##N>(s); \
} \
}
DEFINE_ALIAS_AND_LITERAL(128);
DEFINE_ALIAS_AND_LITERAL(192);
Expand Down

0 comments on commit 8885521

Please sign in to comment.