__INT64_TYPE__, который на данных настройках значит long long. Затем через жёсткую препроцессорную магию определяются и остальные типы и константы, связанные с int64.# include_next <stdint.h> // то есть самого себя!
. . .
#ifdef __INT64_TYPE__
# ifndef __int8_t_defined /* glibc sys/types.h also defines int64_t*/
typedef __INT64_TYPE__ int64_t;
# endif /* __int8_t_defined */
typedef __UINT64_TYPE__ uint64_t;
# undef __int_least64_t
# define __int_least64_t int64_t
# undef __uint_least64_t
# define __uint_least64_t uint64_t
# undef __int_least32_t
# define __int_least32_t int64_t
# undef __uint_least32_t
# define __uint_least32_t uint64_t
# undef __int_least16_t
# define __int_least16_t int64_t
# undef __uint_least16_t
# define __uint_least16_t uint64_t
# undef __int_least8_t
# define __int_least8_t int64_t
# undef __uint_least8_t
# define __uint_least8_t uint64_t
#endif /* __INT64_TYPE__ */typedef long long int64_t; class World {
public:
bool wasStarPlaced = false;
bool wasStaircasePlaced = false;
std::vector<std::vector<char>> map;
unsigned long long tick = 0; // пригодится ещё
void update(); // стандартное название для функции «исполнить игровой такт»
};constexpr int TICKS_PER_SEC = 60;
void World::update()
{
++tick;
if (tick % TICKS_PER_SEC == 0) {
// происходит каждые 60 тактов
}
} ₃₃₃₃
66666
× 6
------
399996 66666
×66666
----------
399996
399996
399996
399996
399996
----------
4444355556struct OpaqueAddress;
using Address = OpaqueAddress*;using Address = uint32_t;enum class Address : uintptr_t { NUL = 0 };