srsLTE/cmake/modules/CheckFunctionExists.c

39 lines
665 B
C
Raw Normal View History

/**
2019-04-26 08:20:30 -07:00
*
* \section COPYRIGHT
2019-04-26 08:20:30 -07:00
*
* Copyright 2013-2020 Software Radio Systems Limited
2019-04-26 08:20:30 -07:00
*
* By using this file, you agree to the terms and conditions set
* forth in the LICENSE file which can be found at the top level of
* the distribution.
2019-04-26 08:20:30 -07:00
*
*/
2014-04-23 02:33:19 -07:00
#ifdef CHECK_FUNCTION_EXISTS
2014-11-05 05:19:35 -08:00
char CHECK_FUNCTION_EXISTS();
2014-04-23 02:33:19 -07:00
#ifdef __CLASSIC_C__
int main()
{
int ac;
char* av[];
2014-04-23 02:33:19 -07:00
#else
int main(int ac, char* av[])
{
2014-04-23 02:33:19 -07:00
#endif
float ac2 = sqrtf(rand());
CHECK_FUNCTION_EXISTS();
if (ac2 * ac > 1000) {
2014-04-23 02:33:19 -07:00
return *av[0];
}
2014-04-23 02:33:19 -07:00
return 0;
}
#else /* CHECK_FUNCTION_EXISTS */
2014-04-23 02:33:19 -07:00
#error "CHECK_FUNCTION_EXISTS has to specify the function"
2014-04-23 02:33:19 -07:00
#endif /* CHECK_FUNCTION_EXISTS */