srsLTE/cmake/modules/CheckFunctionExists.c

26 lines
425 B
C
Raw Normal View History

2014-04-23 02:33:19 -07:00
#ifdef CHECK_FUNCTION_EXISTS
2014-10-17 11:44:01 -07:00
uint8_t CHECK_FUNCTION_EXISTS();
2014-04-23 02:33:19 -07:00
#ifdef __CLASSIC_C__
int main(){
int ac;
2014-10-17 11:44:01 -07:00
uint8_t*av[];
2014-04-23 02:33:19 -07:00
#else
2014-10-17 11:44:01 -07:00
int main(int ac, uint8_t*av[]){
2014-04-23 02:33:19 -07:00
#endif
float ac2 = sqrtf(rand());
CHECK_FUNCTION_EXISTS();
if(ac2 * ac > 1000)
{
return *av[0];
}
return 0;
}
#else /* CHECK_FUNCTION_EXISTS */
# error "CHECK_FUNCTION_EXISTS has to specify the function"
#endif /* CHECK_FUNCTION_EXISTS */