Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <stdio.h>
- #define COMPAT_P __builtin_types_compatible_p
- #define COMPAT_S(a,b) ((char*[]){"false","true"}[COMPAT_P(a,b)])
- #define COMPAT_PP(a,b) {printf("%s\n",COMPAT_S(a,b));}
- int main(void)
- {
- typedef int a_t[3];
- COMPAT_PP(a_t[4],int[4][3]);
- COMPAT_PP(a_t[4],int[3][4]);
- return 0;
- }
- #if 0
- [m@monire m]$ ./types_compat_p
- true
- false
- #endif
Add Comment
Please, Sign In to add comment