1f08c3bdfSopenharmony_citypedef _Bool bool; 2f08c3bdfSopenharmony_citypedef signed char schar; 3f08c3bdfSopenharmony_citypedef unsigned char uchar; 4f08c3bdfSopenharmony_citypedef unsigned short ushort; 5f08c3bdfSopenharmony_citypedef unsigned int uint; 6f08c3bdfSopenharmony_citypedef unsigned long ulong; 7f08c3bdfSopenharmony_citypedef long long longlong; 8f08c3bdfSopenharmony_citypedef unsigned long long ulonglong; 9f08c3bdfSopenharmony_ci 10f08c3bdfSopenharmony_ci#define DEFINE_CAST(from, to) \ 11f08c3bdfSopenharmony_ci static to from##2##to(from x) { \ 12f08c3bdfSopenharmony_ci return x; \ 13f08c3bdfSopenharmony_ci } 14f08c3bdfSopenharmony_ci 15f08c3bdfSopenharmony_ci#define DEFINE_CASTS(from) \ 16f08c3bdfSopenharmony_ci DEFINE_CAST(from, bool) \ 17f08c3bdfSopenharmony_ci DEFINE_CAST(from, char) \ 18f08c3bdfSopenharmony_ci DEFINE_CAST(from, schar) \ 19f08c3bdfSopenharmony_ci DEFINE_CAST(from, uchar) \ 20f08c3bdfSopenharmony_ci DEFINE_CAST(from, short) \ 21f08c3bdfSopenharmony_ci DEFINE_CAST(from, ushort) \ 22f08c3bdfSopenharmony_ci DEFINE_CAST(from, int) \ 23f08c3bdfSopenharmony_ci DEFINE_CAST(from, uint) \ 24f08c3bdfSopenharmony_ci DEFINE_CAST(from, long) \ 25f08c3bdfSopenharmony_ci DEFINE_CAST(from, ulong) \ 26f08c3bdfSopenharmony_ci DEFINE_CAST(from, longlong) \ 27f08c3bdfSopenharmony_ci DEFINE_CAST(from, ulonglong) \ 28f08c3bdfSopenharmony_ci DEFINE_CAST(from, float) \ 29f08c3bdfSopenharmony_ci DEFINE_CAST(from, double) 30f08c3bdfSopenharmony_ci 31f08c3bdfSopenharmony_ciDEFINE_CASTS(bool) 32f08c3bdfSopenharmony_ciDEFINE_CASTS(char) 33f08c3bdfSopenharmony_ciDEFINE_CASTS(schar) 34f08c3bdfSopenharmony_ciDEFINE_CASTS(uchar) 35f08c3bdfSopenharmony_ciDEFINE_CASTS(short) 36f08c3bdfSopenharmony_ciDEFINE_CASTS(ushort) 37f08c3bdfSopenharmony_ciDEFINE_CASTS(int) 38f08c3bdfSopenharmony_ciDEFINE_CASTS(uint) 39f08c3bdfSopenharmony_ciDEFINE_CASTS(long) 40f08c3bdfSopenharmony_ciDEFINE_CASTS(ulong) 41f08c3bdfSopenharmony_ciDEFINE_CASTS(longlong) 42f08c3bdfSopenharmony_ciDEFINE_CASTS(ulonglong) 43f08c3bdfSopenharmony_ciDEFINE_CASTS(float) 44f08c3bdfSopenharmony_ciDEFINE_CASTS(double) 45f08c3bdfSopenharmony_ci 46f08c3bdfSopenharmony_ci/* 47f08c3bdfSopenharmony_ci * check-name: Cast code generation 48f08c3bdfSopenharmony_ci * check-command: sparsec -c $file -o tmp.o 49f08c3bdfSopenharmony_ci */ 50