diff --git a/interpreter.h b/interpreter.h index 7d3f84f..02b90ae 100644 --- a/interpreter.h +++ b/interpreter.h @@ -18,6 +18,28 @@ #define max(a, b) (((a) > (b)) ? (a) : (b)) #endif */ +/* Get the name of a type */ +// #define typename(x) _Generic((x), \ +// _Bool: "_Bool", \ +// unsigned char: "unsigned char", \ +// char: "char", \ +// signed char: "signed char", \ +// short int: "short int", \ +// unsigned short int: "unsigned short int", \ +// int: "int", \ +// unsigned int: "unsigned int", \ +// long int: "long int", \ +// unsigned long int: "unsigned long int", \ +// long long int: "long long int", \ +// unsigned long long int: "unsigned long long int", \ +// float: "float", \ +// double: "double", \ +// long double: "long double", \ +// char *: "pointer to char", \ +// void *: "pointer to void", \ +// int *: "pointer to int", \ +// default: "other") (x) + #define MEM_ALIGN(x) (((x) + sizeof(ALIGN_TYPE)-1) & ~(sizeof(ALIGN_TYPE)-1))