Make TokBuf and Types work with standard C
parent
094d7f769a
commit
55c2edf9c3
|
@ -103,8 +103,8 @@ M_token *M_TokBuf_ReGet(M_tkbuf *tb)
|
|||
//
|
||||
bool M_TokBuf_Drop(M_tkbuf *tb, M_tokty t)
|
||||
{
|
||||
if(tb->get()->type != t) {
|
||||
tb->unget();
|
||||
if(M_TokBuf_Get(tb)->type != t) {
|
||||
M_TokBuf_UnGet(tb);
|
||||
return false;
|
||||
} else {
|
||||
return true;
|
||||
|
|
|
@ -24,12 +24,14 @@ enum M_tkprc
|
|||
|
||||
typedef struct M_tkbuf
|
||||
{
|
||||
#if __GDCC__
|
||||
__prop ctor {call: M_TokBuf_Ctor (this)}
|
||||
__prop dtor {call: M_TokBuf_Dtor (this)}
|
||||
__prop get {call: M_TokBuf_Get (this)}
|
||||
__prop unget {call: M_TokBuf_UnGet(this)}
|
||||
__prop reget {call: M_TokBuf_ReGet(this)}
|
||||
__prop drop {call: M_TokBuf_Drop (this)}
|
||||
#endif
|
||||
|
||||
FILE *fp;
|
||||
M_token *toks;
|
||||
|
|
|
@ -5,16 +5,21 @@
|
|||
#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
|
||||
|
|
Loading…
Reference in New Issue