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
#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 */