mirror of
https://github.com/cuberite/libevent.git
synced 2025-09-12 05:48:51 -04:00
Fix CheckFunctionExistsEx() cmake macro on win32
For example under mingw64 it could not detect that strtok_r() exists, because it checks with: void *p = func_name; And for this you need the function to be defined, so just sync our CheckFunctionExistsEx.c with CheckFunctionExists.c from cmake (and later we should drop them out) since it does correct things to detech functions existence. Also for WIN32 there is -FIwinsock2.h -FIws2tcpip.h, and I guess that is not works for mingw gcc (since -F in gcc is framework, and in windows -FI is like -include in gcc). But looks like we do not need them already (due to fixed CheckFunctionExistsEx()). Refs: #605 (cherry picked from commit accf383e044257ecdef002ea255056a5d15a4811)
This commit is contained in:
parent
0d194c4e49
commit
44fa5b19f7
@ -1,30 +1,28 @@
|
||||
#ifdef CHECK_FUNCTION_EXISTS
|
||||
|
||||
#ifndef _WIN32
|
||||
char CHECK_FUNCTION_EXISTS();
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
#endif
|
||||
|
||||
char
|
||||
CHECK_FUNCTION_EXISTS(void);
|
||||
#ifdef __CLASSIC_C__
|
||||
int main(){
|
||||
int main()
|
||||
{
|
||||
int ac;
|
||||
char*av[];
|
||||
char* av[];
|
||||
#else
|
||||
int main(int ac, char*av[]){
|
||||
int main(int ac, char* av[])
|
||||
{
|
||||
#endif
|
||||
#ifdef _WIN32
|
||||
void * p = &CHECK_FUNCTION_EXISTS;
|
||||
#else
|
||||
CHECK_FUNCTION_EXISTS();
|
||||
#endif
|
||||
if(ac > 1000)
|
||||
{
|
||||
if (ac > 1000) {
|
||||
return *av[0];
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
#else /* CHECK_FUNCTION_EXISTS */
|
||||
#else /* CHECK_FUNCTION_EXISTS */
|
||||
|
||||
# error "CHECK_FUNCTION_EXISTS has to specify the function"
|
||||
#error "CHECK_FUNCTION_EXISTS has to specify the function"
|
||||
|
||||
#endif /* CHECK_FUNCTION_EXISTS */
|
||||
|
Loading…
x
Reference in New Issue
Block a user