1*1f5207b7SJohn Levon 2*1f5207b7SJohn Levon extern float strtof(const char *__restrict__ ptr, char **__restrict__ endptr); 3*1f5207b7SJohn Levon extern double strtod(const char *__restrict ptr, char **__restrict endptr); 4*1f5207b7SJohn Levon /* restrict: -std=c99 or -std=gnu99 or -std=c11 */ 5*1f5207b7SJohn Levon extern long double strtold(const char *restrict ptr, char **restrict endptr); 6*1f5207b7SJohn Levon 7*1f5207b7SJohn Levon extern int (*funcs[])(void); 8*1f5207b7SJohn Levon 9*1f5207b7SJohn Levon /* typeof: no -std or -std=gnu90 or -std=gnu99 or -std=gnu11 */ 10*1f5207b7SJohn Levon extern typeof (funcs[0]) f0; 11*1f5207b7SJohn Levon extern __typeof (funcs[1]) f1; 12*1f5207b7SJohn Levon extern __typeof__(funcs[2]) f2; 13*1f5207b7SJohn Levon 14*1f5207b7SJohn Levon typedef unsigned short uint16_t; 15*1f5207b7SJohn Levon typedef unsigned int uint32_t; 16*1f5207b7SJohn Levon typedef unsigned long long uint64_t; 17*1f5207b7SJohn Levon swap16(uint16_t val)18*1f5207b7SJohn Levonstatic __inline__ uint16_t swap16(uint16_t val) 19*1f5207b7SJohn Levon { 20*1f5207b7SJohn Levon return ((((uint16_t)(val) & (uint16_t)0x00ffU) << 8) | 21*1f5207b7SJohn Levon (((uint16_t)(val) & (uint16_t)0xff00U) >> 8)); 22*1f5207b7SJohn Levon } 23*1f5207b7SJohn Levon swap32(uint32_t val)24*1f5207b7SJohn Levonstatic __inline uint32_t swap32(uint32_t val) 25*1f5207b7SJohn Levon { 26*1f5207b7SJohn Levon return ((((uint32_t)(val) & (uint32_t)0x000000ffUL) << 24) | 27*1f5207b7SJohn Levon (((uint32_t)(val) & (uint32_t)0x0000ff00UL) << 8) | 28*1f5207b7SJohn Levon (((uint32_t)(val) & (uint32_t)0x00ff0000UL) >> 8) | 29*1f5207b7SJohn Levon (((uint32_t)(val) & (uint32_t)0xff000000UL) >> 24)); 30*1f5207b7SJohn Levon } 31*1f5207b7SJohn Levon 32*1f5207b7SJohn Levon /* inline: no -std or -std=gnu90 or -std=c99 or -std=c11 */ swap64(uint64_t val)33*1f5207b7SJohn Levonstatic inline uint64_t swap64(uint64_t val) 34*1f5207b7SJohn Levon { 35*1f5207b7SJohn Levon return ((((uint64_t)(val) & (uint64_t)0x00000000000000ffULL) << 56) | 36*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x000000000000ff00ULL) << 40) | 37*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x0000000000ff0000ULL) << 24) | 38*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x00000000ff000000ULL) << 8) | 39*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x000000ff00000000ULL) >> 8) | 40*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x0000ff0000000000ULL) >> 24) | 41*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0x00ff000000000000ULL) >> 40) | 42*1f5207b7SJohn Levon (((uint64_t)(val) & (uint64_t)0xff00000000000000ULL) >> 56)); 43*1f5207b7SJohn Levon } 44*1f5207b7SJohn Levon /* 45*1f5207b7SJohn Levon * check-name: alternate keywords 46*1f5207b7SJohn Levon */ 47