Try: /usr/bin/gcc Line: /usr/bin/gcc -L/usr/local/python/python-2.7/lib cmake_bootstrap_16455_test.c -o cmake_bootstrap_16455_test ---------- file ----------------------- #ifdef __cplusplus # error "The CMAKE_C_COMPILER is set to a C++ compiler" #endif #include #if defined(__CLASSIC_C__) int main(argc, argv) int argc; char* argv[]; #else int main(int argc, char* argv[]) #endif { printf("%d%c", (argv != 0), (char)0x0a); return argc-1; } ------------------------------------------ 1 Test succeded Try: aCC Line: aCC -DTEST1 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: aCC: command not found Test failed to compile Try: aCC Line: aCC -DTEST2 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: aCC: command not found Test failed to compile Try: aCC Line: aCC -DTEST3 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: aCC: command not found Test failed to compile Try: xlC Line: xlC -DTEST1 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: xlC: command not found Test failed to compile Try: xlC Line: xlC -DTEST2 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: xlC: command not found Test failed to compile Try: xlC Line: xlC -DTEST3 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: xlC: command not found Test failed to compile Try: CC Line: CC -DTEST1 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: CC: command not found Test failed to compile Try: CC Line: CC -DTEST2 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: CC: command not found Test failed to compile Try: CC Line: CC -DTEST3 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ ./bootstrap: line 512: CC: command not found Test failed to compile Try: g++ Line: g++ -DTEST1 cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(TEST1) # include #else # include #endif class NeedCXX { public: NeedCXX() { this->Foo = 1; } int GetFoo() { return this->Foo; } private: int Foo; }; int main() { NeedCXX c; #ifdef TEST3 cout << c.GetFoo() << endl; #else std::cout << c.GetFoo() << std::endl; #endif return 0; } ------------------------------------------ 1 Test succeded Try: gmake "/usr/bin/gcc" -L/usr/local/python/python-2.7/lib -o test test.c 1 gmake works Try: g++ Line: g++ cmake_bootstrap_16455_test.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- #if defined(__GNUC__) && !defined(__INTEL_COMPILER) #include int main() { std::cout << "This is GNU" << std::endl; return 0;} #endif ------------------------------------------ This is GNU Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_SETENV /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_UNSETENV /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx: In function 'int main()': /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:450: error: 'environ' was not declared in this scope Test failed to compile Try: g++ Line: g++ -DTEST_KWSYS_STL_HAVE_STD /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_IOS_USE_ANSI /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_IOS_HAVE_STD /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_IOS_USE_SSTREAM /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STL_HAS_ITERATOR_TRAITS -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STL_HAS_ALLOCATOR_REBIND -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx: In function 'void f(const std::allocator&)': /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:256: error: no matching function for call to 'std::allocator::max_size(long unsigned int) const' /usr/lib/gcc/x86_64-redhat-linux/4.4.7/../../../../include/c++/4.4.7/ext/new_allocator.h:98: note: candidates are: size_t __gnu_cxx::new_allocator<_Tp>::max_size() const [with _Tp = char] Test failed to compile Try: g++ Line: g++ -DTEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS -DKWSYS_STL_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_CSTDDEF /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:141: warning: friend declaration 'int f(A&)' declares a non-template function /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:141: note: (if this is not what you intended, make sure the function template has already been declared and add <> after the function name here) /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx: In function 'int f(A&) [with T = int]': /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:147: instantiated from here /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:143: error: 'int A::x' is private /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx:146: error: within this context Test failed to compile Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_STAT_HAS_ST_MTIM /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ -DTEST_KWSYS_IOS_HAVE_BINARY -DKWSYS_IOS_USE_ANSI=1 -DKWSYS_IOS_HAVE_STD=1 /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Source/kwsys/kwsysPlatformTestsCXX.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- /*============================================================================ KWSys - Kitware System Library Copyright 2000-2009 Kitware, Inc., Insight Software Consortium Distributed under the OSI-approved BSD License (the "License"); see accompanying file Copyright.txt for details. This software is distributed WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License for more information. ============================================================================*/ // Setup for tests that use result of stl namespace test. #if defined(KWSYS_STL_HAVE_STD) # if KWSYS_STL_HAVE_STD # define kwsys_stl std # else # define kwsys_stl # endif #endif // Setup for tests that use iostreams. #if defined(KWSYS_IOS_USE_ANSI) && defined(KWSYS_IOS_HAVE_STD) # if defined(_MSC_VER) # pragma warning (push,1) # endif # if KWSYS_IOS_USE_ANSI # include # else # include # endif # if defined(_MSC_VER) # pragma warning (pop) # endif # if KWSYS_IOS_HAVE_STD # define kwsys_ios std # else # define kwsys_ios # endif #endif #ifdef TEST_KWSYS_STL_HAVE_STD #include void f(std ::list*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_ANSI #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_STD #include void f(std ::ostream*) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_SSTREAM #include #if defined(__GNUC__) && __GNUC__ == 2 && __GNUC_MINOR__ == 96 # error "GCC 2.96 stringstream is buggy" #endif int main() { std ::ostringstream ostr; ostr << "hello"; if(ostr.str().size() == 5) { return 0; } return -1; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREAM_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_IOS_USE_STRSTREA_H #include int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_OSTREAM # include # include void f(ostream& os, const kwsys_stl::string& s) { os << s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_ISTREAM # include # include void f(istream& is, kwsys_stl::string& s) { is >> s; } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_STRING_HAVE_NEQ_CHAR # include bool f(const kwsys_stl::string& s) { return s != ""; } int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDIO #include int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CSTDDEF #include void f(size_t) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_LONG_LONG long long f(long long n) { return n; } int main() { long long n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS___INT64 __int64 f(__int64 n) { return n; } int main() { __int64 n = 0; return static_cast(f(n)); } #endif #ifdef TEST_KWSYS_CXX_HAS_NULL_TEMPLATE_ARGS template class A; template int f(A&); template class A { public: // "friend int f<>(A&)" would conform friend int f(A&); private: int x; }; template int f(A& a) { return a.x = 0; } template int f(A&); int main() { A a; return f(a); } #endif #ifdef TEST_KWSYS_CXX_HAS_MEMBER_TEMPLATES template class A { public: U u; A(): u(0) {} template V m(V* p) { return *p = u; } }; int main() { A a; int s = 1; return a.m(&s); } #endif #ifdef TEST_KWSYS_CXX_HAS_FULL_SPECIALIZATION template struct A {}; template <> struct A { static int f() { return 0; } }; int main() { return A::f(); } #endif #ifdef TEST_KWSYS_CXX_HAS_ARGUMENT_DEPENDENT_LOOKUP namespace N { class A {}; int f(A*) { return 0; } } void f(void*); int main() { N::A* a = 0; return f(a); } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_TRAITS #include #include void f(kwsys_stl::iterator_traits::iterator>::iterator_category const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS___ITERATOR_CATEGORY #include #include void f(kwsys_stl::list::iterator x) { kwsys_stl::__iterator_category(x); } int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_TEMPLATE #include template void f(const Alloc&) { typedef typename Alloc::size_type alloc_size_type; } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_NONTEMPLATE #include void f(kwsys_stl::allocator::size_type const&) {} int main() { return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_REBIND #include template void f(const T&, const Alloc&) { typedef typename Alloc::template rebind::other alloc_type; } int main() { f(0, kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_MAX_SIZE_ARGUMENT #include void f(kwsys_stl::allocator const& a) { a.max_size(sizeof(int)); } int main() { f(kwsys_stl::allocator()); return 0; } #endif #ifdef TEST_KWSYS_STL_HAS_ALLOCATOR_OBJECTS #include void f(kwsys_stl::vector const& v1) { kwsys_stl::vector(1, 1, v1.get_allocator()); } int main() { f(kwsys_stl::vector()); return 0; } #endif #ifdef TEST_KWSYS_STAT_HAS_ST_MTIM #include #include #include int main() { struct stat stat1; (void)stat1.st_mtim.tv_sec; (void)stat1.st_mtim.tv_nsec; return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_AND___INT64 void function(long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CXX_SAME_LONG_LONG_AND___INT64 void function(long long**) {} int main() { __int64** p = 0; function(p); return 0; } #endif #ifdef TEST_KWSYS_CAN_CONVERT_UI64_TO_DOUBLE void function(double& l, unsigned __int64 const& r) { l = static_cast(r); } int main() { double tTo = 0.0; unsigned __int64 tFrom = 0; function(tTo, tFrom); return 0; } #endif #ifdef TEST_KWSYS_IOS_HAVE_BINARY int test_binary(int, ...) { return 0; } int main() { return test_binary(1, kwsys_ios::ios::binary); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM_LONG_LONG int test_istream(kwsys_ios::istream& is, long long& x) { return (is >> x)? 1:0; } int main() { long long x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM_LONG_LONG int test_ostream(kwsys_ios::ostream& os, long long x) { return (os << x)? 1:0; } int main() { long long x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_ISTREAM___INT64 int test_istream(kwsys_ios::istream& is, __int64& x) { return (is >> x)? 1:0; } int main() { __int64 x = 0; return test_istream(kwsys_ios::cin, x); } #endif #ifdef TEST_KWSYS_IOS_HAS_OSTREAM___INT64 int test_ostream(kwsys_ios::ostream& os, __int64 x) { return (os << x)? 1:0; } int main() { __int64 x = 0; return test_ostream(kwsys_ios::cout, x); } #endif #ifdef TEST_KWSYS_CHAR_IS_SIGNED /* Return 0 for char signed and 1 for char unsigned. */ int main() { unsigned char uc = 255; return (*reinterpret_cast(&uc) < 0)?0:1; } #endif #ifdef TEST_KWSYS_LFS_WORKS /* Return 0 when LFS is available and 1 otherwise. */ #define _LARGEFILE_SOURCE #define _LARGEFILE64_SOURCE #define _LARGE_FILES #define _FILE_OFFSET_BITS 64 #include #include #include #if KWSYS_CXX_HAS_CSTDIO # include #endif #include int main(int, char **argv) { /* check that off_t can hold 2^63 - 1 and perform basic operations... */ #define OFF_T_64 (((off_t) 1 << 62) - 1 + ((off_t) 1 << 62)) if (OFF_T_64 % 2147483647 != 1) return 1; // stat breaks on SCO OpenServer struct stat buf; stat( argv[0], &buf ); if (!S_ISREG(buf.st_mode)) return 2; FILE *file = fopen( argv[0], "r" ); off_t offset = ftello( file ); fseek( file, offset, SEEK_CUR ); fclose( file ); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_SETENV #include int main() { return setenv("A", "B", 1); } #endif #ifdef TEST_KWSYS_CXX_HAS_UNSETENV #include int main() { unsetenv("A"); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_ENVIRON_IN_STDLIB_H #include int main() { char* e = environ[0]; return e? 0:1; } #endif #ifdef TEST_KWSYS_CXX_HAS_RLIMIT64 # if defined(KWSYS_HAS_LFS) # define _LARGEFILE_SOURCE # define _LARGEFILE64_SOURCE # define _LARGE_FILES # define _FILE_OFFSET_BITS 64 # endif # include int main() { struct rlimit64 rlim; return getrlimit64(0,&rlim); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOLL #include int main() { const char *str="1024"; return static_cast(atoll(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_ATOL #include int main() { const char *str="1024"; return static_cast(atol(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS__ATOI64 #include int main() { const char *str="1024"; return static_cast(_atoi64(str)); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMES #include int main() { struct timeval* current_time = 0; return utimes("/example", current_time); } #endif #ifdef TEST_KWSYS_CXX_HAS_UTIMENSAT #include #include int main() { struct timespec times[2] = {{0,UTIME_OMIT},{0,UTIME_NOW}}; return utimensat(AT_FDCWD, "/example", times, AT_SYMLINK_NOFOLLOW); } #endif #ifdef TEST_KWSYS_CXX_HAS_BACKTRACE #if defined(__PATHSCALE__) || defined(__PATHCC__) \ || (defined(__LSB_VERSION__) && (__LSB_VERSION__ < 41)) backtrace doesnt work with this compiler or os #endif #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { void *stackSymbols[256]; backtrace(stackSymbols,256); backtrace_symbols(&stackSymbols[0],1); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_DLADDR #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { Dl_info info; int ierr=dladdr((void*)main,&info); return 0; } #endif #ifdef TEST_KWSYS_CXX_HAS_CXXABI #if (defined(__GNUC__) || defined(__PGI)) && !defined(_GNU_SOURCE) # define _GNU_SOURCE #endif #include int main() { int status = 0; size_t bufferLen = 512; char buffer[512] = {'\0'}; const char *function="_ZN5kwsys17SystemInformation15GetProgramStackEii"; char *demangledFunction = abi::__cxa_demangle(function, buffer, &bufferLen, &status); return status; } #endif #ifdef TEST_KWSYS_CXX_TYPE_INFO /* Collect fundamental type information and save it to a CMake script. */ /* Include limits.h to get macros indicating long long and __int64. Note that certain compilers need special macros to define these macros in limits.h. */ #if defined(_MSC_VER) && !defined(_MSC_EXTENSIONS) # define _MSC_EXTENSIONS #endif #if defined(__GNUC__) && __GNUC__ < 3 # define _GNU_SOURCE #endif #include #include #include /* Due to shell differences and limitations of ADD_DEFINITIONS the KWSYS_CXX_TYPE_INFO_FILE macro will sometimes have double quotes and sometimes not. This macro will make sure the value is treated as a double-quoted string. */ #define TO_STRING(x) TO_STRING0(x) #define TO_STRING0(x) TO_STRING1(x) #define TO_STRING1(x) #x void f() {} int main() { /* Construct the output file name. Some preprocessors will add an extra level of double quotes, so strip them. */ char fbuf[] = TO_STRING(KWSYS_CXX_TYPE_INFO_FILE); char* fname = fbuf; if(fname[0] == '"') { ++fname; int len = static_cast(strlen(fname)); if(len > 0 && fname[len-1] == '"') { fname[len-1] = 0; } } /* Try to open the output file. */ if(FILE* fout = fopen(fname, "w")) { /* Set the size of standard types. */ fprintf(fout, "SET(KWSYS_SIZEOF_CHAR %d)\n", static_cast(sizeof(char))); fprintf(fout, "SET(KWSYS_SIZEOF_SHORT %d)\n", static_cast(sizeof(short))); fprintf(fout, "SET(KWSYS_SIZEOF_INT %d)\n", static_cast(sizeof(int))); fprintf(fout, "SET(KWSYS_SIZEOF_LONG %d)\n", static_cast(sizeof(long))); /* Set the size of some non-standard but common types. */ /* Check for a limits.h macro for long long to see if the type exists. */ #if defined(LLONG_MAX) || defined(LONG_LONG_MAX) || defined(LONGLONG_MAX) fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG %d)\n", static_cast(sizeof(long long))); #else fprintf(fout, "SET(KWSYS_SIZEOF_LONG_LONG 0) # No long long available.\n"); #endif /* Check for a limits.h macro for __int64 to see if the type exists. */ #if defined(_I64_MIN) fprintf(fout, "SET(KWSYS_SIZEOF___INT64 %d)\n", static_cast(sizeof(__int64))); #else fprintf(fout, "SET(KWSYS_SIZEOF___INT64 0) # No __int64 available.\n"); #endif /* Set the size of some pointer types. */ fprintf(fout, "SET(KWSYS_SIZEOF_PDATA %d)\n", static_cast(sizeof(void*))); fprintf(fout, "SET(KWSYS_SIZEOF_PFUNC %d)\n", static_cast(sizeof(&f))); /* Set whether the native type "char" is signed or unsigned. */ unsigned char uc = 255; fprintf(fout, "SET(KWSYS_CHAR_IS_SIGNED %d)\n", (*reinterpret_cast(&uc) < 0)?1:0); fclose(fout); return 0; } else { fprintf(stderr, "Failed to write fundamental type info to \"%s\".\n", fname); return 1; } } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM int main() { int a = 1; __asm { xor EBX, EBX; mov a, EBX; } return a; } #endif #ifdef TEST_KWSYS_CXX_HAS_BORLAND_ASM_CPUID int main() { int a = 0; __asm { xor EAX, EAX; cpuid; mov a, EAX; } return a; } #endif ------------------------------------------ Test succeded Try: g++ Line: g++ /sps/hep/comet/cometmgr/cvmfs_repo/ICEDUST/sl6/v2r0p1/cmake/cmake-2.8.12.2/Modules/TestForAnsiForScope.cxx -o cmake_bootstrap_16455_test ---------- file ----------------------- int main(int, char*[]) { int i; for(int i=0; i < 1; ++i); (void)i; return 0; } ------------------------------------------ Test succeded