libmya 0.1.0
Library to parse Mya language.
Loading...
Searching...
No Matches
macro_utils.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ARR_ARG(type, ...)
 Returns an array compound literal with the given type and then this size.
 
#define ARR_TT(...)
 Same as ARR_ARG() macro, but with the specific type token_type_t.
 

Macro Definition Documentation

◆ ARR_ARG

#define ARR_ARG ( type,
... )
Value:
(type[]){ __VA_ARGS__ }, (sizeof((type[]){ __VA_ARGS__ }) / sizeof(type))

Returns an array compound literal with the given type and then this size.

It should be used with functions that expects arguments like: fun(int *arr, size_t arr_size);

Example: fun(ARR_ARG(char, 1, 2, 3));

Definition at line 12 of file macro_utils.h.

◆ ARR_TT

#define ARR_TT ( ...)
Value:
ARR_ARG(token_type_t, __VA_ARGS__)
#define ARR_ARG(type,...)
Returns an array compound literal with the given type and then this size.
Definition macro_utils.h:12
enum token_type token_type_t
Enumeration of token types.

Same as ARR_ARG() macro, but with the specific type token_type_t.

Definition at line 17 of file macro_utils.h.