You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
894 B
45 lines
894 B
#pragma once
|
|
#ifndef ZARRAY_SIZE
|
|
#define ZARRAY_SIZE(x) (sizeof(x) / sizeof(x[0]))
|
|
#endif
|
|
#define ZMAX(a, b) ((a) > (b) ? (a) : (b))
|
|
#define ZMIN(a, b) ((a) < (b) ? (a) : (b))
|
|
|
|
#ifndef INT8_MIN
|
|
#define INT8_MIN (-128)
|
|
#endif
|
|
#ifndef INT16_MIN
|
|
#define INT16_MIN (-32768)
|
|
#endif
|
|
#ifndef INT32_MIN
|
|
#define INT32_MIN (-2147483647 - 1)
|
|
#endif
|
|
#ifndef INT64_MIN
|
|
#define INT64_MIN (-9223372036854775807LL - 1)
|
|
#endif
|
|
|
|
#ifndef INT8_MAX
|
|
#define INT8_MAX 127
|
|
#endif
|
|
#ifndef INT16_MAX
|
|
#define INT16_MAX 32767
|
|
#endif
|
|
#ifndef INT32_MAX
|
|
#define INT32_MAX 2147483647
|
|
#endif
|
|
#ifndef INT64_MAX
|
|
#define INT64_MAX 9223372036854775807LL
|
|
#endif
|
|
|
|
#ifndef UINT8_MAX
|
|
#define UINT8_MAX 255
|
|
#endif
|
|
#ifndef UINT16_MAX
|
|
#define UINT16_MAX 65535
|
|
#endif
|
|
#ifndef UINT32_MAX
|
|
#define UINT32_MAX 0xffffffffU /* 4294967295U */
|
|
#endif
|
|
#ifndef UINT64_MAX
|
|
#define UINT64_MAX 0xffffffffffffffffULL /* 18446744073709551615ULL */
|
|
#endif
|