2017-09-20 08:42:57 -07:00
|
|
|
// Copyright © 2017 Project Golan, all rights reserved.
|
2017-10-04 17:14:46 -07:00
|
|
|
// See COPYING for more information.
|
2017-09-20 08:42:57 -07:00
|
|
|
#ifndef m_types_h
|
|
|
|
#define m_types_h
|
|
|
|
|
|
|
|
#include <stdbool.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <stddef.h>
|
2017-09-21 20:33:18 -07:00
|
|
|
|
|
|
|
#if __GDCC__
|
2017-09-20 08:42:57 -07:00
|
|
|
#include <stdfix.h>
|
|
|
|
#undef fixed
|
2017-09-21 20:33:18 -07:00
|
|
|
#endif
|
2017-09-20 08:42:57 -07:00
|
|
|
|
|
|
|
#define M_countof(a) (sizeof(a) / sizeof(*a))
|
|
|
|
|
|
|
|
// Types ---------------------------------------------------------------------|
|
|
|
|
|
2017-09-22 17:51:35 -07:00
|
|
|
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
|
2017-09-21 20:33:18 -07:00
|
|
|
#if __GDCC__
|
2017-09-22 17:51:35 -07:00
|
|
|
typedef uint96_t tword; // Triple Word
|
2017-09-21 20:33:18 -07:00
|
|
|
#endif
|
2017-09-22 17:51:35 -07:00
|
|
|
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)
|
2017-09-22 08:37:31 -07:00
|
|
|
#if __GDCC__
|
2017-09-22 17:51:35 -07:00
|
|
|
typedef int96_t int96; // Integer (96 bits)
|
2017-09-22 08:37:31 -07:00
|
|
|
#endif
|
2017-09-22 17:51:35 -07:00
|
|
|
|
2017-09-22 08:37:31 -07:00
|
|
|
#if __GDCC__
|
2017-10-04 02:07:02 -07:00
|
|
|
typedef short accum fixed; // Fixed Point
|
|
|
|
typedef accum lfxpt; // Long Fixed Point
|
2017-09-22 17:51:35 -07:00
|
|
|
typedef unsigned long fract ulfra; // Unsigned Long Fractional
|
|
|
|
typedef long fract lfrac; // Long Fractional
|
|
|
|
#else
|
2017-10-04 02:07:02 -07:00
|
|
|
typedef float fixed;
|
|
|
|
typedef double lfxpt;
|
2017-09-22 08:37:31 -07:00
|
|
|
#endif
|
2017-09-22 17:51:35 -07:00
|
|
|
|
|
|
|
typedef unsigned M_texid; // Texture ID
|
|
|
|
typedef unsigned M_shdid; // Shader ID
|
|
|
|
typedef unsigned M_fntid; // Font ID
|
2017-09-20 08:42:57 -07:00
|
|
|
|
|
|
|
#endif
|