omi-eikyo/src/m_types.h

42 lines
1.1 KiB
C

// Copyright © 2017 Project Golan, all rights reserved.
#ifndef m_types_h
#define m_types_h
#include <stdbool.h>
#include <stdint.h>
#include <stddef.h>
#if __GDCC__
#include <stdfix.h>
#undef fixed
#endif
#define M_countof(a) (sizeof(a) / sizeof(*a))
// Types ---------------------------------------------------------------------|
#if __GDCC__
typedef unsigned long fract ulfra;
typedef short accum fixed; // Fixed
typedef long fract lfrac; // Long Fractional
#endif
typedef size_t msize; // Machine Size
typedef ptrdiff_t mpdif; // Machine Pointer Difference
typedef uint8_t mbyte; // Machine Byte
typedef uint16_t hword; // Half Word
typedef uint32_t mword; // Machine Word
typedef uint64_t dword; // Double Word
#if __GDCC__
typedef uint96_t tword; // Triple Word
#endif
typedef int8_t chara; // Character
typedef int16_t int16; // Integer (16 bits)
typedef int32_t integ; // Integer (Machine)
typedef int64_t int64; // Integer (64 bits)
#if __GDCC__
typedef int96_t int96; // Integer (96 bits)
#endif
typedef unsigned M_texid; // Texture ID
#endif