-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathctypename.h
31 lines (27 loc) · 1.52 KB
/
ctypename.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef CTYPENAME_H
#define CTYPENAME_H 1
#define C23_PLACEHOLDER 202000L
#if !(defined(__STDC_VERSION__) && __STDC_VERSION__ >= C23_PLACEHOLDER)
#include <stdbool.h>
#endif
/* Get the name of a type. */
#define ctypename(T) _Generic((T), \
_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 * : "char *", \
void * : "void *", \
default : "other")
#endif /* CTYPENAME_H */