Warning, /graphics/kamera/ConfigureChecks.cmake is written in an unsupported language. File is not indexed.

0001 include(CheckCXXSourceCompiles)
0002 
0003 set(VA_COPY_TEST_SOURCE
0004 "
0005 #include <stdarg.h>
0006 #include <stdlib.h>
0007 void f (int i, ...) {
0008 va_list args1, args2;
0009 va_start (args1, i);
0010 va_copy (args2, args1);
0011 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
0012   exit (1);
0013 va_end (args1); va_end (args2);
0014 }
0015 int main() {
0016   f (0, 42);
0017   return 0;
0018 }
0019 ")
0020 
0021 set(__VA_COPY_TEST_SOURCE
0022 "
0023 #include <stdarg.h>
0024 #include <stdlib.h>
0025 void f (int i, ...) {
0026 va_list args1, args2;
0027 va_start (args1, i);
0028 __va_copy (args2, args1);
0029 if (va_arg (args2, int) != 42 || va_arg (args1, int) != 42)
0030   exit (1);
0031 va_end (args1); va_end (args2);
0032 }
0033 int main() {
0034   f (0, 42);
0035   return 0;
0036 }
0037 ")
0038 
0039 check_cxx_source_compiles("${VA_COPY_TEST_SOURCE}" HAVE_VA_COPY)
0040 if(HAVE_VA_COPY)
0041   set(VA_COPY va_copy CACHE STRING "va_copy function")
0042 else(HAVE_VA_COPY)
0043   check_cxx_source_compiles("${__VA_COPY_TEST_SOURCE}" HAVE___VA_COPY)
0044   if(HAVE___VA_COPY)
0045     set(VA_COPY __va_copy CACHE STRING "__va_copy function")
0046   else(HAVE___VA_COPY)
0047     message(FATAL_ERROR "Either va_copy or __va_copy must be present. Please check your libc.")
0048   endif(HAVE___VA_COPY)
0049 endif(HAVE_VA_COPY)