libevent/cmake/CheckFunctionExistsEx.c

29 lines
421 B
C
Raw Normal View History

2013-12-09 18:05:32 +01:00
#ifdef CHECK_FUNCTION_EXISTS
#ifdef __cplusplus
extern "C"
2013-12-09 18:05:32 +01:00
#endif
char
CHECK_FUNCTION_EXISTS(void);
2013-12-09 18:05:32 +01:00
#ifdef __CLASSIC_C__
int main()
{
2013-12-09 18:05:32 +01:00
int ac;
char* av[];
2013-12-09 18:05:32 +01:00
#else
int main(int ac, char* av[])
{
2013-12-09 18:05:32 +01:00
#endif
CHECK_FUNCTION_EXISTS();
if (ac > 1000) {
2013-12-09 18:05:32 +01:00
return *av[0];
}
2013-12-09 18:05:32 +01:00
return 0;
}
#else /* CHECK_FUNCTION_EXISTS */
2013-12-09 18:05:32 +01:00
#error "CHECK_FUNCTION_EXISTS has to specify the function"
2013-12-09 18:05:32 +01:00
#endif /* CHECK_FUNCTION_EXISTS */