mirror of
https://github.com/Z3Prover/z3
synced 2025-04-29 03:45:51 +00:00
remove dependency on ARRAYSIZE for issue #1616
Signed-off-by: Nikolaj Bjorner <nbjorner@microsoft.com>
This commit is contained in:
parent
95963f71f4
commit
2b2f193f2b
11 changed files with 137 additions and 49 deletions
|
@ -49,12 +49,18 @@ static_assert(sizeof(int64_t) == 8, "64 bits");
|
|||
#ifdef _WINDOWS
|
||||
#define SSCANF sscanf_s
|
||||
#define SPRINTF sprintf_s
|
||||
#define SPRINTF_D(_buffer_, _i_) sprintf_s(_buffer_, Z3_ARRAYSIZE(_buffer_), "%d", _i_)
|
||||
#define SPRINTF_U(_buffer_, _u_) sprintf_s(_buffer_, Z3_ARRAYSIZE(_buffer_), "%u", _u_)
|
||||
#define _Exit exit
|
||||
#else
|
||||
#define SSCANF sscanf
|
||||
#define SPRINTF sprintf
|
||||
#define SPRINTF_D(_buffer_, _i_) sprintf(_buffer_, "%d", _i_)
|
||||
#define SPRINTF_U(_buffer_, _u_) sprintf(_buffer_, "%u", _u_)
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
#define VEC2PTR(_x_) ((_x_).size() ? &(_x_)[0] : 0)
|
||||
|
||||
#ifdef _WINDOWS
|
||||
|
@ -142,9 +148,7 @@ static inline uint64_t shift_left(uint64_t x, uint64_t y) {
|
|||
template<class T, size_t N> char (*ArraySizer(T (&)[N]))[N];
|
||||
// For determining the length of an array. See ARRAYSIZE() macro. This function is never actually called.
|
||||
|
||||
#ifndef ARRAYSIZE
|
||||
#define ARRAYSIZE(a) sizeof(*ArraySizer(a))
|
||||
#endif
|
||||
#define Z3_ARRAYSIZE(a) sizeof(*ArraySizer(a))
|
||||
|
||||
template<typename IT>
|
||||
void display(std::ostream & out, const IT & begin, const IT & end, const char * sep, bool & first) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue