From e81e5c57ec734d27587c36c78ca61492613316f4 Mon Sep 17 00:00:00 2001 From: GCC-XML Date: Fri, 29 Jan 2010 23:49:46 -0500 Subject: [PATCH] gccxml 2010-01-27 (26cdb92b) --- GCC/config_cmake/gcc_asm_tests/CMakeLists.txt | 1 + GCC/gcc/cp/mangle.c | 16 +- GCC/gcc/cp/xml.c | 115 ++-- GCC_XML/GXFront/gxConfiguration.cxx | 35 +- GCC_XML/KWSys/Base64.c | 20 +- GCC_XML/KWSys/Base64.h.in | 20 +- GCC_XML/KWSys/CMakeLists.txt | 139 +++-- GCC_XML/KWSys/CPU.h.in | 20 +- GCC_XML/KWSys/CTestConfig.cmake | 11 + GCC_XML/KWSys/CommandLineArguments.cxx | 20 +- GCC_XML/KWSys/CommandLineArguments.hxx.in | 20 +- GCC_XML/KWSys/Configure.h.in | 37 +- GCC_XML/KWSys/Configure.hxx.in | 29 +- GCC_XML/KWSys/Copyright.txt | 46 +- GCC_XML/KWSys/DateStamp.h.in | 20 +- GCC_XML/KWSys/Directory.cxx | 20 +- GCC_XML/KWSys/Directory.hxx.in | 20 +- GCC_XML/KWSys/DynamicLoader.cxx | 20 +- GCC_XML/KWSys/DynamicLoader.hxx.in | 20 +- GCC_XML/KWSys/EncodeExecutable.c | 20 +- GCC_XML/KWSys/FundamentalType.h.in | 32 +- GCC_XML/KWSys/Glob.cxx | 20 +- GCC_XML/KWSys/Glob.hxx.in | 20 +- GCC_XML/KWSys/IOStream.cxx | 20 +- GCC_XML/KWSys/IOStream.hxx.in | 20 +- GCC_XML/KWSys/MD5.c | 21 +- GCC_XML/KWSys/MD5.h.in | 20 +- GCC_XML/KWSys/Process.h.in | 20 +- GCC_XML/KWSys/ProcessFwd9x.c | 20 +- GCC_XML/KWSys/ProcessUNIX.c | 57 +- GCC_XML/KWSys/ProcessWin32.c | 27 +- GCC_XML/KWSys/Registry.cxx | 20 +- GCC_XML/KWSys/Registry.hxx.in | 20 +- GCC_XML/KWSys/RegularExpression.cxx | 20 +- GCC_XML/KWSys/RegularExpression.hxx.in | 20 +- GCC_XML/KWSys/SharedForward.h.in | 54 +- GCC_XML/KWSys/String.c | 20 +- GCC_XML/KWSys/String.h.in | 20 +- GCC_XML/KWSys/String.hxx.in | 22 +- GCC_XML/KWSys/System.c | 20 +- GCC_XML/KWSys/System.h.in | 20 +- GCC_XML/KWSys/SystemInformation.cxx | 442 +++++++++---- GCC_XML/KWSys/SystemInformation.hxx.in | 31 +- GCC_XML/KWSys/SystemTools.cxx | 129 ++-- GCC_XML/KWSys/SystemTools.hxx.in | 35 +- GCC_XML/KWSys/Terminal.c | 20 +- GCC_XML/KWSys/Terminal.h.in | 20 +- GCC_XML/KWSys/auto_ptr.hxx.in | 20 +- GCC_XML/KWSys/hash_fun.hxx.in | 20 +- GCC_XML/KWSys/hash_map.hxx.in | 20 +- GCC_XML/KWSys/hash_set.hxx.in | 20 +- GCC_XML/KWSys/hashtable.hxx.in | 20 +- GCC_XML/KWSys/kwsysDateStamp.cmake | 17 +- GCC_XML/KWSys/kwsysDateStamp.py | 22 + GCC_XML/KWSys/kwsysHeaderDump.pl | 18 +- GCC_XML/KWSys/kwsysPlatformTests.cmake | 63 ++ GCC_XML/KWSys/kwsysPlatformTestsC.c | 49 ++ GCC_XML/KWSys/kwsysPlatformTestsCXX.cxx | 20 + GCC_XML/KWSys/kwsysPrivate.h | 20 +- GCC_XML/KWSys/kwsys_cstddef.hxx.in | 20 +- GCC_XML/KWSys/kwsys_ios_fstream.h.in | 20 +- GCC_XML/KWSys/kwsys_ios_iosfwd.h.in | 20 +- GCC_XML/KWSys/kwsys_ios_iostream.h.in | 20 +- GCC_XML/KWSys/kwsys_ios_sstream.h.in | 20 +- GCC_XML/KWSys/kwsys_stl.hxx.in | 20 +- GCC_XML/KWSys/kwsys_stl_string.hxx.in | 20 +- GCC_XML/KWSys/testAutoPtr.cxx | 20 +- GCC_XML/KWSys/testCommandLineArguments.cxx | 20 +- GCC_XML/KWSys/testCommandLineArguments1.cxx | 20 +- GCC_XML/KWSys/testDynamicLoader.cxx | 20 +- GCC_XML/KWSys/testDynload.c | 11 + GCC_XML/KWSys/testEncode.c | 26 +- GCC_XML/KWSys/testFail.c | 11 + GCC_XML/KWSys/testHashSTL.cxx | 20 +- GCC_XML/KWSys/testIOS.cxx | 11 + GCC_XML/KWSys/testProcess.c | 22 +- GCC_XML/KWSys/testRegistry.cxx | 21 +- GCC_XML/KWSys/testSharedForward.c.in | 20 +- GCC_XML/KWSys/testSystemInformation.cxx | 20 +- GCC_XML/KWSys/testSystemTools.cxx | 20 +- GCC_XML/KWSys/testSystemTools.h.in | 20 +- GCC_XML/KWSys/testTerminal.c | 20 +- GCC_XML/Support/GCC/3.2/bits/gthr-default.h | 585 ++++++++++++++++++ GCC_XML/Support/GCC/3.4/bits/gthr-default.h | 5 + GCC_XML/Support/GCC/4.1/bits/gthr-default.h | 4 + GCC_XML/Support/GCC/4.4/gccxml_builtins.h | 152 +++++ GCC_XML/Support/MIPSpro/find_flags | 89 +-- GCC_XML/Support/MIPSpro/mipspro_defs.cxx | 63 ++ GCC_XML/VcInstall/vcInstall.cxx | 30 +- 89 files changed, 2367 insertions(+), 1151 deletions(-) create mode 100644 GCC_XML/Support/GCC/3.2/bits/gthr-default.h create mode 100644 GCC_XML/Support/GCC/4.4/gccxml_builtins.h create mode 100644 GCC_XML/Support/MIPSpro/mipspro_defs.cxx diff --git a/GCC/config_cmake/gcc_asm_tests/CMakeLists.txt b/GCC/config_cmake/gcc_asm_tests/CMakeLists.txt index b1bdacb..fcf7ea2 100644 --- a/GCC/config_cmake/gcc_asm_tests/CMakeLists.txt +++ b/GCC/config_cmake/gcc_asm_tests/CMakeLists.txt @@ -1,3 +1,4 @@ +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) PROJECT(GAT C) SET(GAT_AS as) diff --git a/GCC/gcc/cp/mangle.c b/GCC/gcc/cp/mangle.c index 750caea..d268dbe 100644 --- a/GCC/gcc/cp/mangle.c +++ b/GCC/gcc/cp/mangle.c @@ -2157,7 +2157,12 @@ write_expression (tree expr) } /* If it wasn't any of those, recursively expand the expression. */ - write_string (operator_name_info[(int) code].mangled_name); +/* BEGIN GCC-XML MODIFICATIONS 2009-09-25 */ + { + const char *mangled_name = operator_name_info[(int) code].mangled_name; + write_string (mangled_name? mangled_name : "(unmangled-operator)"); + } +/* END GCC-XML MODIFICATIONS 2009-09-25 */ switch (code) { @@ -2224,7 +2229,10 @@ write_expression (tree expr) "cannot be mangled"); continue; } - write_expression (operand); +/* BEGIN GCC-XML MODIFICATIONS 2009-09-25 */ + if(operand) + write_expression (operand); +/* END GCC-XML MODIFICATIONS 2009-09-25 */ } } } @@ -2246,7 +2254,7 @@ write_template_arg_literal (const tree value) switch (TREE_CODE (value)) { case CONST_DECL: -/* BEGIN GCC-XML MODIFICATIONS (2008/02/14 15:26:25) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/09/25 17:34:43) */ /* The mangling code chokes on this code: @@ -2264,7 +2272,7 @@ write_template_arg_literal (const tree value) write_chars (hack, sizeof(hack)-1); break; } -/* END GCC-XML MODIFICATIONS (2008/02/14 15:26:25) */ +/* END GCC-XML MODIFICATIONS (2009/09/25 17:34:43) */ write_integer_cst (DECL_INITIAL (value)); break; diff --git a/GCC/gcc/cp/xml.c b/GCC/gcc/cp/xml.c index dd02bfd..db32c1c 100644 --- a/GCC/gcc/cp/xml.c +++ b/GCC/gcc/cp/xml.c @@ -65,7 +65,7 @@ along with this program; if not, write to the #include "toplev.h" /* ident_hash */ -#define GCC_XML_C_VERSION "$Revision: 1.128 $" +#define GCC_XML_C_VERSION "$Revision: 1.132 $" /*--------------------------------------------------------------------------*/ /* Data structures for the actual XML dump. */ @@ -648,17 +648,21 @@ xml_document_add_attribute_location(xml_document_element_p element, static void xml_print_endline_attribute (xml_dump_info_p xdi, tree body) { - /* Get the last statement in the list. The list may be empty if the - body is for an empty implicitly-generated copy-constructor. */ - tree_stmt_iterator t = tsi_last(body); - if(!tsi_end_p(t)) + tree last = EXPR_P (body)? body : 0; + if (TREE_CODE (body) == STATEMENT_LIST) { - tree stmt = tsi_stmt(t); - if(EXPR_HAS_LOCATION(stmt)) + /* Get the last statement in the list. The list may be empty if the + body is for an empty implicitly-generated copy-constructor. */ + tree_stmt_iterator t = tsi_last (body); + if (!tsi_end_p (t)) { - fprintf (xdi->file, " endline=\"%d\"", EXPR_LINENO(stmt)); + last = tsi_stmt (t); } } + if (last && EXPR_HAS_LOCATION (last)) + { + fprintf (xdi->file, " endline=\"%d\"", EXPR_LINENO (last)); + } } static void @@ -2415,7 +2419,11 @@ xml_output_fundamental_type (xml_dump_info_p xdi, tree t, xml_dump_node_p dn) { fprintf (xdi->file, " = 4) + { + INCLUDES = "-iwrapper\"" + supportPath + "/4.4\" " + INCLUDES; + SPECIAL = "-include \"gccxml_builtins.h\""; + } else if(MAJOR_VERSION == 4 && MINOR_VERSION >= 3) { INCLUDES = "-iwrapper\"" + supportPath + "/4.3\" " + INCLUDES; @@ -2165,8 +2168,8 @@ bool gxConfiguration::FindFlagsMSVC7() std::cerr << "Error finding MSVC 7.0 from registry.\n"; return false; } - std::string msvcPath1 = msvcPath+"/../../Vc7/Include"; - std::string msvcPath2 = msvcPath+"/../../Vc7/PlatformSDK/Include"; + std::string msvcPath1 = msvcPath+"/Include"; + std::string msvcPath2 = msvcPath+"/PlatformSDK/Include"; msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); std::string vcIncludePath1; @@ -2209,8 +2212,8 @@ bool gxConfiguration::FindFlagsMSVC71() std::cerr << "Error finding MSVC 7.1 from registry.\n"; return false; } - std::string msvcPath1 = msvcPath+"/../../Vc7/Include"; - std::string msvcPath2 = msvcPath+"/../../Vc7/PlatformSDK/Include"; + std::string msvcPath1 = msvcPath+"/Include"; + std::string msvcPath2 = msvcPath+"/PlatformSDK/Include"; msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); std::string vcIncludePath1; @@ -2253,8 +2256,8 @@ bool gxConfiguration::FindFlagsMSVC8() std::cerr << "Error finding MSVC 8 from registry.\n"; return false; } - std::string msvcPath1 = msvcPath+"/../../Vc/Include"; - std::string msvcPath2 = msvcPath+"/../../Vc/PlatformSDK/Include"; + std::string msvcPath1 = msvcPath+"/Include"; + std::string msvcPath2 = msvcPath+"/PlatformSDK/Include"; msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); std::string vcIncludePath1; @@ -2317,7 +2320,7 @@ bool gxConfiguration::FindFlagsMSVC8ex() std::cerr << "Error finding MSVC 8 Express from registry.\n"; return false; } - std::string msvcPath1 = msvcPath+"/../../Vc/Include"; + std::string msvcPath1 = msvcPath+"/Include"; msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); std::string vcIncludePath1; if(!this->FindData("Vc8ex/Include", vcIncludePath1)) @@ -2408,7 +2411,7 @@ bool gxConfiguration::FindFlagsMSVC9() std::cerr << "Error finding MSVC 9 Platform SDK from registry.\n"; return false; } - std::string msvcPath1 = msvcPath+"/../../Vc/Include"; + std::string msvcPath1 = msvcPath+"/Include"; std::string msvcPath2 = psdkPath+"/Include"; msvcPath1 = gxSystemTools::CollapseDirectory(msvcPath1.c_str()); msvcPath2 = gxSystemTools::CollapseDirectory(msvcPath2.c_str()); diff --git a/GCC_XML/KWSys/Base64.c b/GCC_XML/KWSys/Base64.c index 50de19c..d07bdd0 100644 --- a/GCC_XML/KWSys/Base64.c +++ b/GCC_XML/KWSys/Base64.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Base64.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Base64.h) diff --git a/GCC_XML/KWSys/Base64.h.in b/GCC_XML/KWSys/Base64.h.in index 78551ff..3468007 100644 --- a/GCC_XML/KWSys/Base64.h.in +++ b/GCC_XML/KWSys/Base64.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Base64.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Base64_h #define @KWSYS_NAMESPACE@_Base64_h diff --git a/GCC_XML/KWSys/CMakeLists.txt b/GCC_XML/KWSys/CMakeLists.txt index f1f95f7..62042e8 100644 --- a/GCC_XML/KWSys/CMakeLists.txt +++ b/GCC_XML/KWSys/CMakeLists.txt @@ -1,15 +1,13 @@ #============================================================================= +# KWSys - Kitware System Library +# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium # -# Program: KWSys - Kitware System Library -# Module: CMakeLists.txt -# -# Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. -# See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the above copyright notices for more information. +# 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. #============================================================================= # The Kitware System Library is intended to be included in other @@ -55,6 +53,8 @@ # KWSYS_INSTALL_INCLUDE_DIR kwsys should be installed by a "make install". # The values should be specified relative to # the installation prefix and NOT start with '/'. +# KWSYS_INSTALL_DOC_DIR = The installation target directory for documentation +# such as copyright information. # # KWSYS_INSTALL_COMPONENT_NAME_RUNTIME = Name of runtime and development # KWSYS_INSTALL_COMPONENT_NAME_DEVELOPMENT installation components. @@ -103,6 +103,14 @@ # any outside mailing list and no documentation of the change will be # written. +CMAKE_MINIMUM_REQUIRED(VERSION 2.4.5 FATAL_ERROR) +IF(COMMAND CMAKE_POLICY) + CMAKE_POLICY(SET CMP0003 NEW) +ENDIF(COMMAND CMAKE_POLICY) + +# Allow empty endif() and such with CMake 2.4. +SET(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS 1) + #----------------------------------------------------------------------------- # If a namespace is not specified, use "kwsys" and enable testing. # This should be the case only when kwsys is not included inside @@ -111,12 +119,6 @@ IF(NOT KWSYS_NAMESPACE) SET(KWSYS_NAMESPACE "kwsys") SET(KWSYS_STANDALONE 1) ENDIF(NOT KWSYS_NAMESPACE) -IF(KWSYS_STANDALONE) - CMAKE_MINIMUM_REQUIRED(VERSION 2.4) - IF(COMMAND CMAKE_POLICY) - CMAKE_POLICY(SET CMP0003 NEW) - ENDIF(COMMAND CMAKE_POLICY) -ENDIF(KWSYS_STANDALONE) #----------------------------------------------------------------------------- # The project name is that of the specified namespace. @@ -139,11 +141,16 @@ IF(COMMAND SET_PROPERTY) "KWSYS_HEADER(%)=<${KWSYS_NAMESPACE}/%>" ) ENDIF(COMMAND SET_PROPERTY) +# add option to disable memory cleanup at exit of putenv memory +IF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) + SET(KWSYS_DO_NOT_CLEAN_PUTENV 1) +ELSE(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) + SET(KWSYS_DO_NOT_CLEAN_PUTENV 0) +ENDIF(DEFINED KWSYS_DO_NOT_CLEAN_PUTENV) # Select library components. IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) SET(KWSYS_ENABLE_C 1) - # Enable all components. SET(KWSYS_USE_Base64 1) SET(KWSYS_USE_Directory 1) @@ -294,13 +301,6 @@ ELSE(COMMAND INSTALL) SET(KWSYS_INSTALL_LIB_DIR) ENDIF(COMMAND INSTALL) -# Work-around for CMake 1.6.7 bug in custom command dependencies when -# there is no executable output path. -IF(NOT EXECUTABLE_OUTPUT_PATH) - SET(EXECUTABLE_OUTPUT_PATH "${PROJECT_BINARY_DIR}" CACHE PATH - "Output directory for executables.") -ENDIF(NOT EXECUTABLE_OUTPUT_PATH) - # Generated source files will need this header. STRING(COMPARE EQUAL "${PROJECT_SOURCE_DIR}" "${PROJECT_BINARY_DIR}" KWSYS_IN_SOURCE_BUILD) @@ -469,19 +469,54 @@ IF(UNIX) ENDIF(UNIX) IF(KWSYS_USE_FundamentalType) - # Determine type sizes. - CHECK_TYPE_SIZE("char" KWSYS_SIZEOF_CHAR) - CHECK_TYPE_SIZE("short" KWSYS_SIZEOF_SHORT) - CHECK_TYPE_SIZE("int" KWSYS_SIZEOF_INT) - CHECK_TYPE_SIZE("long" KWSYS_SIZEOF_LONG) - CHECK_TYPE_SIZE("long long" KWSYS_SIZEOF_LONG_LONG) - CHECK_TYPE_SIZE("__int64" KWSYS_SIZEOF___INT64) - IF(NOT KWSYS_SIZEOF_LONG_LONG) - SET(KWSYS_SIZEOF_LONG_LONG 0) - ENDIF(NOT KWSYS_SIZEOF_LONG_LONG) - IF(NOT KWSYS_SIZEOF___INT64) - SET(KWSYS_SIZEOF___INT64 0) - ENDIF(NOT KWSYS_SIZEOF___INT64) + # Look for type size helper macros. + KWSYS_PLATFORM_INFO_TEST(C KWSYS_C_TYPE_MACROS + "Checking for C type size macros") + SET(macro_regex ".*INFO:macro\\[([^]]*)\\].*") + FOREACH(info ${KWSYS_C_TYPE_MACROS}) + IF("${info}" MATCHES "${macro_regex}") + STRING(REGEX REPLACE "${macro_regex}" "\\1" macro "${info}") + SET(KWSYS_C_HAS_MACRO_${macro} 1) + ENDIF() + ENDFOREACH() + + # Determine type sizes at preprocessing time if possible, and + # otherwise fall back to a try-compile. + SET(KWSYS_C_TYPE_NAME_CHAR "char") + SET(KWSYS_C_TYPE_NAME_SHORT "short") + SET(KWSYS_C_TYPE_NAME_INT "int") + SET(KWSYS_C_TYPE_NAME_LONG "long") + SET(KWSYS_C_TYPE_NAME_LONG_LONG "long long") + SET(KWSYS_C_TYPE_NAME___INT64 "__int64") + FOREACH(type CHAR SHORT INT LONG LONG_LONG __INT64) + IF(KWSYS_C_HAS_MACRO___SIZEOF_${type}__) + # Use __SIZEOF_${type}__ macro. + SET(KWSYS_SIZEOF_${type} TRUE) + SET(KWSYS_C_CODE_SIZEOF_${type} "#define ${KWSYS_NAMESPACE}_SIZEOF_${type} __SIZEOF_${type}__") + ELSEIF(KWSYS_C_HAS_MACRO___${type}_MAX__) + # Use __${type}_MAX__ macro. + SET(KWSYS_SIZEOF_${type} TRUE) + SET(KWSYS_C_CODE_SIZEOF_${type} "#if __${type}_MAX__ == 0x7f +# define ${KWSYS_NAMESPACE}_SIZEOF_${type} 1 +#elif __${type}_MAX__ == 0x7fff +# define ${KWSYS_NAMESPACE}_SIZEOF_${type} 2 +#elif __${type}_MAX__ == 0x7fffffff +# define ${KWSYS_NAMESPACE}_SIZEOF_${type} 4 +#elif __${type}_MAX__>>32 == 0x7fffffff +# define ${KWSYS_NAMESPACE}_SIZEOF_${type} 8 +#else +# error \"Cannot determine sizeof(${KWSYS_C_TYPE_NAME_${type}}).\" +#endif") + ELSE() + # Configure a hard-coded type size. + CHECK_TYPE_SIZE("${KWSYS_C_TYPE_NAME_${type}}" KWSYS_SIZEOF_${type}) + IF(NOT KWSYS_SIZEOF_${type}) + SET(KWSYS_SIZEOF_${type} 0) + ENDIF() + SET(KWSYS_C_CODE_SIZEOF_${type} + "#define ${KWSYS_NAMESPACE}_SIZEOF_${type} ${KWSYS_SIZEOF_${type}}") + ENDIF() + ENDFOREACH() # Check uniqueness of types. IF(KWSYS_SIZEOF___INT64) @@ -525,8 +560,9 @@ ENDIF(KWSYS_USE_FundamentalType) IF(KWSYS_USE_IOStream) # Determine whether iostreams support long long. - CHECK_TYPE_SIZE("long long" KWSYS_SIZEOF_LONG_LONG) - IF(KWSYS_SIZEOF_LONG_LONG) + KWSYS_PLATFORM_CXX_TEST(KWSYS_CXX_HAS_LONG_LONG + "Checking whether C++ compiler has 'long long'" DIRECT) + IF(KWSYS_CXX_HAS_LONG_LONG) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES -DKWSYS_IOS_USE_ANSI=${KWSYS_IOS_USE_ANSI} -DKWSYS_IOS_HAVE_STD=${KWSYS_IOS_HAVE_STD}) @@ -535,10 +571,10 @@ IF(KWSYS_USE_IOStream) KWSYS_PLATFORM_CXX_TEST(KWSYS_IOS_HAS_OSTREAM_LONG_LONG "Checking if ostream supports long long" DIRECT) SET(KWSYS_PLATFORM_CXX_TEST_DEFINES) - ELSE(KWSYS_SIZEOF_LONG_LONG) + ELSE() SET(KWSYS_IOS_HAS_ISTREAM_LONG_LONG 0) SET(KWSYS_IOS_HAS_OSTREAM_LONG_LONG 0) - ENDIF(KWSYS_SIZEOF_LONG_LONG) + ENDIF() ENDIF(KWSYS_USE_IOStream) IF(KWSYS_NAMESPACE MATCHES "^kwsys$") @@ -568,6 +604,22 @@ ENDIF(NOT KWSYS_HEADER_ROOT) SET(KWSYS_HEADER_DIR "${KWSYS_HEADER_ROOT}/${KWSYS_NAMESPACE}") INCLUDE_DIRECTORIES(${KWSYS_HEADER_ROOT}) +#----------------------------------------------------------------------------- +IF(KWSYS_INSTALL_DOC_DIR) + # Assign the license to the runtime component since it must be + # distributed with binary forms of this software. + IF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) + SET(KWSYS_INSTALL_LICENSE_OPTIONS ${KWSYS_INSTALL_LICENSE_OPTIONS} + COMPONENT ${KWSYS_INSTALL_COMPONENT_NAME_RUNTIME} + ) + ENDIF(KWSYS_INSTALL_COMPONENT_NAME_RUNTIME) + + # Install the license under the documentation directory. + INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt + DESTINATION ${KWSYS_INSTALL_DOC_DIR}/${KWSYS_NAMESPACE} + ${KWSYS_INSTALL_LICENSE_OPTIONS}) +ENDIF(KWSYS_INSTALL_DOC_DIR) + #----------------------------------------------------------------------------- # Create STL header wrappers to block warnings in the STL headers and # give standard names by which they may be included. @@ -968,6 +1020,7 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) # If kwsys contains the DynamicLoader, need extra library ADD_LIBRARY(${KWSYS_NAMESPACE}TestDynload MODULE testDynload.c) KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestDynload PROPERTY LABELS ${KWSYS_LABELS_LIB}) + ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestDynload ${KWSYS_NAMESPACE}) ENDIF(KWSYS_USE_DynamicLoader) CREATE_TEST_SOURCELIST( KWSYS_CXX_TEST_SRCS ${KWSYS_NAMESPACE}TestsCxx.cxx @@ -1036,12 +1089,18 @@ IF(KWSYS_STANDALONE OR CMake_SOURCE_DIR) KWSYS_SET_PROPERTY(TEST kwsys.testProcess-${n} PROPERTY LABELS ${KWSYS_LABELS_TEST}) ENDFOREACH(n) + # Some Apple compilers produce bad optimizations in this source. + IF(APPLE AND "${CMAKE_C_COMPILER_ID}" MATCHES "^(GNU|LLVM)$") + SET_SOURCE_FILES_PROPERTIES(testProcess.c PROPERTIES COMPILE_FLAGS -O0) + ENDIF() + # Test SharedForward CONFIGURE_FILE(${PROJECT_SOURCE_DIR}/testSharedForward.c.in ${PROJECT_BINARY_DIR}/testSharedForward.c @ONLY IMMEDIATE) ADD_EXECUTABLE(${KWSYS_NAMESPACE}TestSharedForward ${PROJECT_BINARY_DIR}/testSharedForward.c) KWSYS_SET_PROPERTY(TARGET ${KWSYS_NAMESPACE}TestSharedForward PROPERTY LABELS ${KWSYS_LABELS_EXE}) + ADD_DEPENDENCIES(${KWSYS_NAMESPACE}TestSharedForward ${KWSYS_NAMESPACE}_c) ADD_TEST(kwsys.testSharedForward ${EXEC_DIR}/${KWSYS_NAMESPACE}TestSharedForward 1) KWSYS_SET_PROPERTY(TEST kwsys.testSharedForward PROPERTY LABELS ${KWSYS_LABELS_TEST}) diff --git a/GCC_XML/KWSys/CPU.h.in b/GCC_XML/KWSys/CPU.h.in index 6b2e49c..ecd29d1 100644 --- a/GCC_XML/KWSys/CPU.h.in +++ b/GCC_XML/KWSys/CPU.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: CPU.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_CPU_h #define @KWSYS_NAMESPACE@_CPU_h diff --git a/GCC_XML/KWSys/CTestConfig.cmake b/GCC_XML/KWSys/CTestConfig.cmake index e4e7b0d..9ab6ed8 100644 --- a/GCC_XML/KWSys/CTestConfig.cmake +++ b/GCC_XML/KWSys/CTestConfig.cmake @@ -1,3 +1,14 @@ +#============================================================================= +# 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. +#============================================================================= set (CTEST_PROJECT_NAME "kwsys") set (CTEST_NIGHTLY_START_TIME "21:00:00 EDT") set (CTEST_DART_SERVER_VERSION "2") diff --git a/GCC_XML/KWSys/CommandLineArguments.cxx b/GCC_XML/KWSys/CommandLineArguments.cxx index 0352b6a..9f43a47 100644 --- a/GCC_XML/KWSys/CommandLineArguments.cxx +++ b/GCC_XML/KWSys/CommandLineArguments.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: CommandLineArguments.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(CommandLineArguments.hxx) diff --git a/GCC_XML/KWSys/CommandLineArguments.hxx.in b/GCC_XML/KWSys/CommandLineArguments.hxx.in index 6a36ecd..68e9600 100644 --- a/GCC_XML/KWSys/CommandLineArguments.hxx.in +++ b/GCC_XML/KWSys/CommandLineArguments.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: CommandLineArguments.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_CommandLineArguments_hxx #define @KWSYS_NAMESPACE@_CommandLineArguments_hxx diff --git a/GCC_XML/KWSys/Configure.h.in b/GCC_XML/KWSys/Configure.h.in index f83b7e4..97b2c5d 100644 --- a/GCC_XML/KWSys/Configure.h.in +++ b/GCC_XML/KWSys/Configure.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Configure.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Configure_h #define @KWSYS_NAMESPACE@_Configure_h @@ -27,6 +25,9 @@ # if defined(__BORLANDC__) # pragma warn -8027 /* function not inlined. */ # endif +# if defined(__INTEL_COMPILER) +# pragma warning (disable: 1572) /* floating-point equality test */ +# endif #endif /* Whether kwsys namespace is "kwsys". */ @@ -87,11 +88,17 @@ #endif /* Setup the export macro. */ -#if defined(_WIN32) && @KWSYS_BUILD_SHARED@ -# if defined(@KWSYS_NAMESPACE@_EXPORTS) -# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport) +#if @KWSYS_BUILD_SHARED@ +# if defined(_WIN32) || defined(__CYGWIN__) +# if defined(@KWSYS_NAMESPACE@_EXPORTS) +# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllexport) +# else +# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport) +# endif +# elif __GNUC__ >= 4 +# define @KWSYS_NAMESPACE@_EXPORT __attribute__ ((visibility("default"))) # else -# define @KWSYS_NAMESPACE@_EXPORT __declspec(dllimport) +# define @KWSYS_NAMESPACE@_EXPORT # endif #else # define @KWSYS_NAMESPACE@_EXPORT diff --git a/GCC_XML/KWSys/Configure.hxx.in b/GCC_XML/KWSys/Configure.hxx.in index 444f46f..9310d94 100644 --- a/GCC_XML/KWSys/Configure.hxx.in +++ b/GCC_XML/KWSys/Configure.hxx.in @@ -1,22 +1,29 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Configure.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Configure_hxx #define @KWSYS_NAMESPACE@_Configure_hxx /* Include C configuration. */ #include <@KWSYS_NAMESPACE@/Configure.h> +/* Disable cleanup of putenv memory for issues with GCOV */ +#if @KWSYS_DO_NOT_CLEAN_PUTENV@ +#define KWSYS_DO_NOT_CLEAN_PUTENV +#else +#undef KWSYS_DO_NOT_CLEAN_PUTENV +#endif + + + /* Whether ANSI C++ stream headers are to be used. */ #define @KWSYS_NAMESPACE@_IOS_USE_ANSI @KWSYS_IOS_USE_ANSI@ diff --git a/GCC_XML/KWSys/Copyright.txt b/GCC_XML/KWSys/Copyright.txt index 86e0e73..1549a7d 100644 --- a/GCC_XML/KWSys/Copyright.txt +++ b/GCC_XML/KWSys/Copyright.txt @@ -1,33 +1,31 @@ -Copyright (c) 2000-2003 Kitware, Inc., Insight Consortium. +KWSys - Kitware System Library +Copyright 2000-2009 Kitware, Inc., Insight Software Consortium All rights reserved. Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are -met: +modification, are permitted provided that the following conditions +are met: - * Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. +* Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. - * Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the - distribution. +* Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. - * Neither the name of Kitware nor the names of any contributors may - be used to endorse or promote products derived from this software - without specific prior written permission. - - * Modified source versions must be plainly marked as such, and must - not be misrepresented as being the original software. +* Neither the names of Kitware, Inc., the Insight Software Consortium, + nor the names of their contributors may be used to endorse or promote + products derived from this software without specific prior written + permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR -A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/GCC_XML/KWSys/DateStamp.h.in b/GCC_XML/KWSys/DateStamp.h.in index 4cae20c..c3d0099 100644 --- a/GCC_XML/KWSys/DateStamp.h.in +++ b/GCC_XML/KWSys/DateStamp.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: DateStamp.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_DateStamp_h #define @KWSYS_NAMESPACE@_DateStamp_h diff --git a/GCC_XML/KWSys/Directory.cxx b/GCC_XML/KWSys/Directory.cxx index 76c0c88..b884747 100644 --- a/GCC_XML/KWSys/Directory.cxx +++ b/GCC_XML/KWSys/Directory.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Directory.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Directory.hxx) diff --git a/GCC_XML/KWSys/Directory.hxx.in b/GCC_XML/KWSys/Directory.hxx.in index 642ad79..05217c4 100644 --- a/GCC_XML/KWSys/Directory.hxx.in +++ b/GCC_XML/KWSys/Directory.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Directory.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Directory_hxx #define @KWSYS_NAMESPACE@_Directory_hxx diff --git a/GCC_XML/KWSys/DynamicLoader.cxx b/GCC_XML/KWSys/DynamicLoader.cxx index ec3137d..a337031 100644 --- a/GCC_XML/KWSys/DynamicLoader.cxx +++ b/GCC_XML/KWSys/DynamicLoader.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: DynamicLoader.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(DynamicLoader.hxx) diff --git a/GCC_XML/KWSys/DynamicLoader.hxx.in b/GCC_XML/KWSys/DynamicLoader.hxx.in index 5910c52..325e956 100644 --- a/GCC_XML/KWSys/DynamicLoader.hxx.in +++ b/GCC_XML/KWSys/DynamicLoader.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: DynamicLoader.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_DynamicLoader_hxx #define @KWSYS_NAMESPACE@_DynamicLoader_hxx diff --git a/GCC_XML/KWSys/EncodeExecutable.c b/GCC_XML/KWSys/EncodeExecutable.c index 5acdbce..ba474b8 100644 --- a/GCC_XML/KWSys/EncodeExecutable.c +++ b/GCC_XML/KWSys/EncodeExecutable.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: EncodeExecutable.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include #ifdef __WATCOMC__ #define _unlink unlink diff --git a/GCC_XML/KWSys/FundamentalType.h.in b/GCC_XML/KWSys/FundamentalType.h.in index 28ab548..ff20063 100644 --- a/GCC_XML/KWSys/FundamentalType.h.in +++ b/GCC_XML/KWSys/FundamentalType.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: FundamentalType.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_FundamentalType_h #define @KWSYS_NAMESPACE@_FundamentalType_h @@ -38,12 +36,12 @@ #endif /* The size of fundamental types. Types that do not exist have size 0. */ -#define @KWSYS_NAMESPACE@_SIZEOF_CHAR @KWSYS_SIZEOF_CHAR@ -#define @KWSYS_NAMESPACE@_SIZEOF_SHORT @KWSYS_SIZEOF_SHORT@ -#define @KWSYS_NAMESPACE@_SIZEOF_INT @KWSYS_SIZEOF_INT@ -#define @KWSYS_NAMESPACE@_SIZEOF_LONG @KWSYS_SIZEOF_LONG@ -#define @KWSYS_NAMESPACE@_SIZEOF_LONG_LONG @KWSYS_SIZEOF_LONG_LONG@ -#define @KWSYS_NAMESPACE@_SIZEOF___INT64 @KWSYS_SIZEOF___INT64@ +@KWSYS_C_CODE_SIZEOF_CHAR@ +@KWSYS_C_CODE_SIZEOF_SHORT@ +@KWSYS_C_CODE_SIZEOF_INT@ +@KWSYS_C_CODE_SIZEOF_LONG@ +@KWSYS_C_CODE_SIZEOF_LONG_LONG@ +@KWSYS_C_CODE_SIZEOF___INT64@ /* Whether types "long long" and "__int64" are enabled. If a type is enabled then it is a unique fundamental type. */ diff --git a/GCC_XML/KWSys/Glob.cxx b/GCC_XML/KWSys/Glob.cxx index edf98db..c1f5100 100644 --- a/GCC_XML/KWSys/Glob.cxx +++ b/GCC_XML/KWSys/Glob.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Glob.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Glob.hxx) diff --git a/GCC_XML/KWSys/Glob.hxx.in b/GCC_XML/KWSys/Glob.hxx.in index 1620dfe..cb050ee 100644 --- a/GCC_XML/KWSys/Glob.hxx.in +++ b/GCC_XML/KWSys/Glob.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Glob.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Glob_hxx #define @KWSYS_NAMESPACE@_Glob_hxx diff --git a/GCC_XML/KWSys/IOStream.cxx b/GCC_XML/KWSys/IOStream.cxx index f84453f..57b696e 100644 --- a/GCC_XML/KWSys/IOStream.cxx +++ b/GCC_XML/KWSys/IOStream.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: IOStream.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Configure.hxx) diff --git a/GCC_XML/KWSys/IOStream.hxx.in b/GCC_XML/KWSys/IOStream.hxx.in index f75cb1e..9eb99e0 100644 --- a/GCC_XML/KWSys/IOStream.hxx.in +++ b/GCC_XML/KWSys/IOStream.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: IOStream.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_IOStream_hxx #define @KWSYS_NAMESPACE@_IOStream_hxx diff --git a/GCC_XML/KWSys/MD5.c b/GCC_XML/KWSys/MD5.c index b7ec4a2..1ea0a66 100644 --- a/GCC_XML/KWSys/MD5.c +++ b/GCC_XML/KWSys/MD5.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: MD5.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(MD5.h) @@ -54,7 +52,6 @@ ghost@aladdin.com */ -/* Id */ /* Independent implementation of MD5 (RFC 1321). diff --git a/GCC_XML/KWSys/MD5.h.in b/GCC_XML/KWSys/MD5.h.in index ea10108..3334431 100644 --- a/GCC_XML/KWSys/MD5.h.in +++ b/GCC_XML/KWSys/MD5.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: MD5.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_MD5_h #define @KWSYS_NAMESPACE@_MD5_h diff --git a/GCC_XML/KWSys/Process.h.in b/GCC_XML/KWSys/Process.h.in index 9b6fc28..c5995ea 100644 --- a/GCC_XML/KWSys/Process.h.in +++ b/GCC_XML/KWSys/Process.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Process.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Process_h #define @KWSYS_NAMESPACE@_Process_h diff --git a/GCC_XML/KWSys/ProcessFwd9x.c b/GCC_XML/KWSys/ProcessFwd9x.c index 739b9c3..536c54b 100644 --- a/GCC_XML/KWSys/ProcessFwd9x.c +++ b/GCC_XML/KWSys/ProcessFwd9x.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: ProcessFwd9x.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ /* On Windows9x platforms, this executable is spawned between a parent diff --git a/GCC_XML/KWSys/ProcessUNIX.c b/GCC_XML/KWSys/ProcessUNIX.c index df74658..373e906 100644 --- a/GCC_XML/KWSys/ProcessUNIX.c +++ b/GCC_XML/KWSys/ProcessUNIX.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: ProcessUNIX.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Process.h) #include KWSYS_HEADER(System.h) @@ -1877,9 +1875,8 @@ static int kwsysProcessSetupOutputPipeFile(int* p, const char* name) /* Close the existing descriptor. */ kwsysProcessCleanupDescriptor(p); - /* Open a file for the pipe to write (permissions 644). */ - if((fout = open(name, O_WRONLY | O_CREAT | O_TRUNC, - S_IRUSR | S_IWUSR | S_IRGRP | S_IROTH)) < 0) + /* Open a file for the pipe to write. */ + if((fout = open(name, O_WRONLY | O_CREAT | O_TRUNC, 0666)) < 0) { return 0; } @@ -1923,7 +1920,7 @@ static int kwsysProcessGetTimeoutTime(kwsysProcess* cp, double* userTimeout, { /* The first time this is called, we need to calculate the time at which the child will timeout. */ - if(cp->Timeout && cp->TimeoutTime.tv_sec < 0) + if(cp->Timeout > 0 && cp->TimeoutTime.tv_sec < 0) { kwsysProcessTime length = kwsysProcessTimeFromDouble(cp->Timeout); cp->TimeoutTime = kwsysProcessTimeAdd(cp->StartTime, length); @@ -2379,9 +2376,13 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, #if defined(__linux__) || defined(__APPLE__) || defined(__FreeBSD__) # define KWSYSPE_PS_COMMAND "ps axo pid,ppid" # define KWSYSPE_PS_FORMAT "%d %d\n" -#elif defined(__hpux) || defined(__sparc) || defined(__sgi) || defined(_AIX) +#elif defined(__hpux) || defined(__sun__) || defined(__sgi) || defined(_AIX) \ + || defined(__sparc) # define KWSYSPE_PS_COMMAND "ps -ef" # define KWSYSPE_PS_FORMAT "%*s %d %d %*[^\n]\n" +#elif defined(__QNX__) +# define KWSYSPE_PS_COMMAND "ps -Af" +# define KWSYSPE_PS_FORMAT "%*d %d %d %*[^\n]\n" #elif defined(__CYGWIN__) # define KWSYSPE_PS_COMMAND "ps aux" # define KWSYSPE_PS_FORMAT "%d %d %*[^\n]\n" @@ -2394,13 +2395,8 @@ static void kwsysProcessKill(pid_t process_id) DIR* procdir; #endif - /* Kill the process now to make sure it does not create more - children. Do not reap it yet so we can identify its existing - children. There is a small race condition here. If the child - forks after we begin looking for children below but before it - receives this kill signal we might miss a child. Also we might - not be able to catch up to a fork bomb. */ - kill(process_id, SIGKILL); + /* Suspend the process to be sure it will not create more children. */ + kill(process_id, SIGSTOP); /* Kill all children if we can find them. */ #if defined(__linux__) || defined(__CYGWIN__) @@ -2488,6 +2484,19 @@ static void kwsysProcessKill(pid_t process_id) } #endif } + + /* Kill the process. */ + kill(process_id, SIGKILL); + +#if defined(__APPLE__) + /* On OS X 10.3 the above SIGSTOP occasionally prevents the SIGKILL + from working. Just in case, we resume the child and kill it + again. There is a small race condition in this obscure case. If + the child manages to fork again between these two signals, we + will not catch its children. */ + kill(process_id, SIGCONT); + kill(process_id, SIGKILL); +#endif } /*--------------------------------------------------------------------------*/ @@ -2712,7 +2721,7 @@ static void kwsysProcessesSignalHandler(int signum kwsysProcess_ssize_t status= read(cp->PipeReadEnds[KWSYSPE_PIPE_SIGNAL], &buf, 1); status=write(cp->SignalPipe, &buf, 1); - + (void)status; } } diff --git a/GCC_XML/KWSys/ProcessWin32.c b/GCC_XML/KWSys/ProcessWin32.c index 97fa61e..c5ea6db 100644 --- a/GCC_XML/KWSys/ProcessWin32.c +++ b/GCC_XML/KWSys/ProcessWin32.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: ProcessWin32.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Process.h) #include KWSYS_HEADER(System.h) @@ -2518,6 +2516,11 @@ struct _SYSTEM_PROCESS_INFORMATION /*--------------------------------------------------------------------------*/ /* Toolhelp32 API definitions. */ #define TH32CS_SNAPPROCESS 0x00000002 +#if defined(_WIN64) +typedef unsigned __int64 ProcessULONG_PTR; +#else +typedef unsigned long ProcessULONG_PTR; +#endif typedef struct tagPROCESSENTRY32 PROCESSENTRY32; typedef PROCESSENTRY32* LPPROCESSENTRY32; struct tagPROCESSENTRY32 @@ -2525,7 +2528,7 @@ struct tagPROCESSENTRY32 DWORD dwSize; DWORD cntUsage; DWORD th32ProcessID; - DWORD th32DefaultHeapID; + ProcessULONG_PTR th32DefaultHeapID; DWORD th32ModuleID; DWORD cntThreads; DWORD th32ParentProcessID; diff --git a/GCC_XML/KWSys/Registry.cxx b/GCC_XML/KWSys/Registry.cxx index 5047bab..284e8ad 100644 --- a/GCC_XML/KWSys/Registry.cxx +++ b/GCC_XML/KWSys/Registry.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Registry.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Registry.hxx) diff --git a/GCC_XML/KWSys/Registry.hxx.in b/GCC_XML/KWSys/Registry.hxx.in index 23c1fa2..ed9b010 100644 --- a/GCC_XML/KWSys/Registry.hxx.in +++ b/GCC_XML/KWSys/Registry.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Registry.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Registry_hxx #define @KWSYS_NAMESPACE@_Registry_hxx diff --git a/GCC_XML/KWSys/RegularExpression.cxx b/GCC_XML/KWSys/RegularExpression.cxx index 09db021..f6eeeba 100644 --- a/GCC_XML/KWSys/RegularExpression.cxx +++ b/GCC_XML/KWSys/RegularExpression.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: RegularExpression.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ // // Copyright (C) 1991 Texas Instruments Incorporated. // diff --git a/GCC_XML/KWSys/RegularExpression.hxx.in b/GCC_XML/KWSys/RegularExpression.hxx.in index 98c93a3..62e9cad 100644 --- a/GCC_XML/KWSys/RegularExpression.hxx.in +++ b/GCC_XML/KWSys/RegularExpression.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: RegularExpression.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ // Original Copyright notice: // Copyright (C) 1991 Texas Instruments Incorporated. // diff --git a/GCC_XML/KWSys/SharedForward.h.in b/GCC_XML/KWSys/SharedForward.h.in index a7c34c0..da62d84 100644 --- a/GCC_XML/KWSys/SharedForward.h.in +++ b/GCC_XML/KWSys/SharedForward.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: SharedForward.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_SharedForward_h #define @KWSYS_NAMESPACE@_SharedForward_h @@ -196,31 +194,27 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT # define KWSYS_SHARED_FORWARD_LDD "ldd" # define KWSYS_SHARED_FORWARD_LDD_N 1 # define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH" -#endif /* FreeBSD */ -#if defined(__FreeBSD__) +#elif defined(__FreeBSD__) # define KWSYS_SHARED_FORWARD_LDD "ldd" # define KWSYS_SHARED_FORWARD_LDD_N 1 # define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH" -#endif /* OSX */ -#if defined(__APPLE__) +#elif defined(__APPLE__) # define KWSYS_SHARED_FORWARD_LDD "otool", "-L" # define KWSYS_SHARED_FORWARD_LDD_N 2 # define KWSYS_SHARED_FORWARD_LDPATH "DYLD_LIBRARY_PATH" -#endif /* AIX */ -#if defined(_AIX) +#elif defined(_AIX) # define KWSYS_SHARED_FORWARD_LDD "dump", "-H" # define KWSYS_SHARED_FORWARD_LDD_N 2 # define KWSYS_SHARED_FORWARD_LDPATH "LIBPATH" -#endif /* SUN */ -#if defined(__sparc) && !defined(__linux) +#elif defined(__sun) # define KWSYS_SHARED_FORWARD_LDD "ldd" # define KWSYS_SHARED_FORWARD_LDD_N 1 # include @@ -229,10 +223,9 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT # elif defined(_LP64) # define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH_64" # endif -#endif /* HP-UX */ -#if defined(__hpux) +#elif defined(__hpux) # define KWSYS_SHARED_FORWARD_LDD "chatr" # define KWSYS_SHARED_FORWARD_LDD_N 1 # if defined(__LP64__) @@ -240,10 +233,9 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT # else # define KWSYS_SHARED_FORWARD_LDPATH "SHLIB_PATH" # endif -#endif /* SGI MIPS */ -#if defined(__sgi) && defined(_MIPS_SIM) +#elif defined(__sgi) && defined(_MIPS_SIM) # define KWSYS_SHARED_FORWARD_LDD "ldd" # define KWSYS_SHARED_FORWARD_LDD_N 1 # if _MIPS_SIM == _ABIO32 @@ -253,19 +245,19 @@ static const char kwsys_shared_forward_path_slash[2] = {KWSYS_SHARED_FORWARD_PAT # elif _MIPS_SIM == _ABI64 # define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY64_PATH" # endif -#endif + +/* Cygwin */ +#elif defined(__CYGWIN__) +# define KWSYS_SHARED_FORWARD_LDD "cygcheck" /* TODO: cygwin 1.7 has ldd */ +# define KWSYS_SHARED_FORWARD_LDD_N 1 +# define KWSYS_SHARED_FORWARD_LDPATH "PATH" /* Windows */ -#if defined(_WIN32) -# if defined(__CYGWIN__) -# define KWSYS_SHARED_FORWARD_LDD "cygcheck" -# define KWSYS_SHARED_FORWARD_LDD_N 1 -# endif +#elif defined(_WIN32) # define KWSYS_SHARED_FORWARD_LDPATH "PATH" -#endif /* Guess on this unknown system. */ -#if !defined(KWSYS_SHARED_FORWARD_LDPATH) +#else # define KWSYS_SHARED_FORWARD_LDD "ldd" # define KWSYS_SHARED_FORWARD_LDD_N 1 # define KWSYS_SHARED_FORWARD_LDPATH "LD_LIBRARY_PATH" diff --git a/GCC_XML/KWSys/String.c b/GCC_XML/KWSys/String.c index b3503ef..ed4a6c5 100644 --- a/GCC_XML/KWSys/String.c +++ b/GCC_XML/KWSys/String.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: String.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifdef KWSYS_STRING_C /* All code in this source file is conditionally compiled to work-around diff --git a/GCC_XML/KWSys/String.h.in b/GCC_XML/KWSys/String.h.in index de4d7ea..f5bab6e 100644 --- a/GCC_XML/KWSys/String.h.in +++ b/GCC_XML/KWSys/String.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: String.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_String_h #define @KWSYS_NAMESPACE@_String_h diff --git a/GCC_XML/KWSys/String.hxx.in b/GCC_XML/KWSys/String.hxx.in index 3b5ddac..4386c9e 100644 --- a/GCC_XML/KWSys/String.hxx.in +++ b/GCC_XML/KWSys/String.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: String.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_String_hxx #define @KWSYS_NAMESPACE@_String_hxx @@ -27,7 +25,7 @@ namespace @KWSYS_NAMESPACE@ * simply a subclass of this type with the same interface so that the * name is shorter in debugging symbols and error messages. */ -class @KWSYS_NAMESPACE@_EXPORT String: public @KWSYS_NAMESPACE@_stl::string +class String: public @KWSYS_NAMESPACE@_stl::string { /** The original string type. */ typedef @KWSYS_NAMESPACE@_stl::string stl_string; diff --git a/GCC_XML/KWSys/System.c b/GCC_XML/KWSys/System.c index 6c9f542..5d178bf 100644 --- a/GCC_XML/KWSys/System.c +++ b/GCC_XML/KWSys/System.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: System.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(System.h) diff --git a/GCC_XML/KWSys/System.h.in b/GCC_XML/KWSys/System.h.in index e75330c..549db90 100644 --- a/GCC_XML/KWSys/System.h.in +++ b/GCC_XML/KWSys/System.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: System.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_System_h #define @KWSYS_NAMESPACE@_System_h diff --git a/GCC_XML/KWSys/SystemInformation.cxx b/GCC_XML/KWSys/SystemInformation.cxx index 3e33423..7041d38 100644 --- a/GCC_XML/KWSys/SystemInformation.cxx +++ b/GCC_XML/KWSys/SystemInformation.cxx @@ -1,22 +1,30 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: BatchMake - Module: SystemInformation.cxx - Language: C++ - Date: $Date$ - Version: $Revision$ - Copyright (c) 2005 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. + 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 above copyright notices for more information. -=========================================================================*/ + 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. +============================================================================*/ #ifdef _WIN32 # include // WSADATA, include before sys/types.h #endif +// TODO: +// We need an alternative implementation for many functions in this file +// when USE_ASM_INSTRUCTIONS gets defined as 0. +// +// Consider using these on Win32/Win64 for some of them: +// +// IsProcessorFeaturePresent +// http://msdn.microsoft.com/en-us/library/ms724482(VS.85).aspx +// +// GetProcessMemoryInfo +// http://msdn.microsoft.com/en-us/library/ms683219(VS.85).aspx + #include "kwsysPrivate.h" #include KWSYS_HEADER(FundamentalType.h) #include KWSYS_HEADER(stl/string) @@ -26,6 +34,7 @@ #include KWSYS_HEADER(Process.h) #include KWSYS_HEADER(ios/iostream) #include KWSYS_HEADER(ios/sstream) + // Work-around CMake dependency scanning limitation. This must // duplicate the above list of headers. #if 0 @@ -40,7 +49,6 @@ # include "kwsys_ios_iostream.h.in" #endif - #ifndef WIN32 # include // int uname(struct utsname *buf); #endif @@ -80,7 +88,6 @@ #include - namespace KWSYS_NAMESPACE { @@ -93,12 +100,13 @@ namespace KWSYS_NAMESPACE # error "No Long Long" #endif + // Define SystemInformationImplementation class typedef void (*DELAY_FUNC)(unsigned int uiMS); - -class SystemInformationImplementation -{ + +class SystemInformationImplementation +{ public: SystemInformationImplementation (); ~SystemInformationImplementation (); @@ -132,21 +140,22 @@ class SystemInformationImplementation bool DoesCPUSupportCPUID(); // Retrieve memory information in megabyte. - unsigned long GetTotalVirtualMemory(); - unsigned long GetAvailableVirtualMemory(); - unsigned long GetTotalPhysicalMemory(); - unsigned long GetAvailablePhysicalMemory(); + size_t GetTotalVirtualMemory(); + size_t GetAvailableVirtualMemory(); + size_t GetTotalPhysicalMemory(); + size_t GetAvailablePhysicalMemory(); /** Run the different checks */ void RunCPUCheck(); void RunOSCheck(); void RunMemoryCheck(); + public: #define VENDOR_STRING_LENGTH (12 + 1) #define CHIPNAME_STRING_LENGTH (48 + 1) #define SERIALNUMBER_STRING_LENGTH (29 + 1) - typedef struct tagID + typedef struct tagID { int Type; int Family; @@ -159,14 +168,14 @@ class SystemInformationImplementation char SerialNumber[SERIALNUMBER_STRING_LENGTH]; } ID; - typedef struct tagCPUPowerManagement + typedef struct tagCPUPowerManagement { bool HasVoltageID; bool HasFrequencyID; bool HasTempSenseDiode; } CPUPowerManagement; - typedef struct tagCPUExtendedFeatures + typedef struct tagCPUExtendedFeatures { bool Has3DNow; bool Has3DNowPlus; @@ -177,9 +186,9 @@ class SystemInformationImplementation unsigned int LogicalProcessorsPerPhysical; int APIC_ID; CPUPowerManagement PowerManagement; - } CPUExtendedFeatures; - - typedef struct CPUtagFeatures + } CPUExtendedFeatures; + + typedef struct CPUtagFeatures { bool HasFPU; bool HasTSC; @@ -200,13 +209,14 @@ class SystemInformationImplementation int L3CacheSize; CPUExtendedFeatures ExtendedFeatures; } CPUFeatures; - - enum Manufacturer + + enum Manufacturer { - AMD, Intel, NSC, UMC, Cyrix, NexGen, IDT, Rise, Transmeta, Sun, IBM, Motorola, UnknownManufacturer + AMD, Intel, NSC, UMC, Cyrix, NexGen, IDT, Rise, Transmeta, Sun, IBM, + Motorola, UnknownManufacturer }; -protected: +protected: // Functions. bool RetrieveCPUFeatures(); bool RetrieveCPUIdentity(); @@ -220,7 +230,7 @@ class SystemInformationImplementation bool RetrieveCPUPowerManagement(); bool RetrieveClassicalCPUIdentity(); bool RetrieveExtendedCPUIdentity(); - + Manufacturer ChipManufacturer; CPUFeatures Features; ID ChipID; @@ -246,6 +256,8 @@ class SystemInformationImplementation // For Mac bool ParseSysCtl(); + void CallSwVers(); + void TrimNewline(kwsys_stl::string&); kwsys_stl::string ExtractValueFromSysCtl(const char* word); kwsys_stl::string SysCtlBuffer; @@ -259,10 +271,10 @@ class SystemInformationImplementation // Evaluate the memory information. int QueryMemory(); - unsigned long TotalVirtualMemory; - unsigned long AvailableVirtualMemory; - unsigned long TotalPhysicalMemory; - unsigned long AvailablePhysicalMemory; + size_t TotalVirtualMemory; + size_t AvailableVirtualMemory; + size_t TotalPhysicalMemory; + size_t AvailablePhysicalMemory; size_t CurrentPositionInFile; @@ -274,17 +286,14 @@ class SystemInformationImplementation kwsys_stl::string OSVersion; kwsys_stl::string OSPlatform; }; - - - - + SystemInformation::SystemInformation() { this->Implementation = new SystemInformationImplementation; } -SystemInformation::~SystemInformation () +SystemInformation::~SystemInformation() { delete this->Implementation; } @@ -293,54 +302,67 @@ const char * SystemInformation::GetVendorString() { return this->Implementation->GetVendorString(); } + const char * SystemInformation::GetVendorID() { return this->Implementation->GetVendorID(); } + kwsys_stl::string SystemInformation::GetTypeID() { return this->Implementation->GetTypeID(); } + kwsys_stl::string SystemInformation::GetFamilyID() { return this->Implementation->GetFamilyID(); } + kwsys_stl::string SystemInformation::GetModelID() { return this->Implementation->GetModelID(); } + kwsys_stl::string SystemInformation::GetSteppingCode() { return this->Implementation->GetSteppingCode(); } + const char * SystemInformation::GetExtendedProcessorName() { return this->Implementation->GetExtendedProcessorName(); } + const char * SystemInformation::GetProcessorSerialNumber() { return this->Implementation->GetProcessorSerialNumber(); } + int SystemInformation::GetProcessorCacheSize() { return this->Implementation->GetProcessorCacheSize(); } + unsigned int SystemInformation::GetLogicalProcessorsPerPhysical() { return this->Implementation->GetLogicalProcessorsPerPhysical(); } + float SystemInformation::GetProcessorClockFrequency() { return this->Implementation->GetProcessorClockFrequency(); } + int SystemInformation::GetProcessorAPICID() { return this->Implementation->GetProcessorAPICID(); } + int SystemInformation::GetProcessorCacheXSize(long int l) { return this->Implementation->GetProcessorCacheXSize(l); } + bool SystemInformation::DoesCPUSupportFeature(long int i) { return this->Implementation->DoesCPUSupportFeature(i); @@ -350,18 +372,22 @@ const char * SystemInformation::GetOSName() { return this->Implementation->GetOSName(); } + const char * SystemInformation::GetHostname() { return this->Implementation->GetHostname(); } + const char * SystemInformation::GetOSRelease() { return this->Implementation->GetOSRelease(); } + const char * SystemInformation::GetOSVersion() { return this->Implementation->GetOSVersion(); } + const char * SystemInformation::GetOSPlatform() { return this->Implementation->GetOSPlatform(); @@ -376,6 +402,7 @@ unsigned int SystemInformation::GetNumberOfLogicalCPU() // per physical cpu { return this->Implementation->GetNumberOfLogicalCPU(); } + unsigned int SystemInformation::GetNumberOfPhysicalCPU() { return this->Implementation->GetNumberOfPhysicalCPU(); @@ -387,20 +414,22 @@ bool SystemInformation::DoesCPUSupportCPUID() } // Retrieve memory information in megabyte. -unsigned long SystemInformation::GetTotalVirtualMemory() +size_t SystemInformation::GetTotalVirtualMemory() { return this->Implementation->GetTotalVirtualMemory(); } -unsigned long SystemInformation::GetAvailableVirtualMemory() + +size_t SystemInformation::GetAvailableVirtualMemory() { return this->Implementation->GetAvailableVirtualMemory(); } -unsigned long SystemInformation::GetTotalPhysicalMemory() + +size_t SystemInformation::GetTotalPhysicalMemory() { return this->Implementation->GetTotalPhysicalMemory(); } -unsigned long SystemInformation::GetAvailablePhysicalMemory() +size_t SystemInformation::GetAvailablePhysicalMemory() { return this->Implementation->GetAvailablePhysicalMemory(); } @@ -410,17 +439,18 @@ void SystemInformation::RunCPUCheck() { this->Implementation->RunCPUCheck(); } + void SystemInformation::RunOSCheck() { this->Implementation->RunOSCheck(); } + void SystemInformation::RunMemoryCheck() { this->Implementation->RunMemoryCheck(); } - // -------------------------------------------------------------- // SystemInformationImplementation starts here @@ -442,29 +472,29 @@ void SystemInformation::RunMemoryCheck() #define CPUID_INSTRUCTION _asm _emit 0x0f _asm _emit 0xa2 #endif -#define MMX_FEATURE 0x00000001 -#define MMX_PLUS_FEATURE 0x00000002 -#define SSE_FEATURE 0x00000004 -#define SSE2_FEATURE 0x00000008 +#define MMX_FEATURE 0x00000001 +#define MMX_PLUS_FEATURE 0x00000002 +#define SSE_FEATURE 0x00000004 +#define SSE2_FEATURE 0x00000008 #define AMD_3DNOW_FEATURE 0x00000010 -#define AMD_3DNOW_PLUS_FEATURE 0x00000020 -#define IA64_FEATURE 0x00000040 -#define MP_CAPABLE 0x00000080 -#define HYPERTHREAD_FEATURE 0x00000100 -#define SERIALNUMBER_FEATURE 0x00000200 -#define APIC_FEATURE 0x00000400 -#define SSE_FP_FEATURE 0x00000800 +#define AMD_3DNOW_PLUS_FEATURE 0x00000020 +#define IA64_FEATURE 0x00000040 +#define MP_CAPABLE 0x00000080 +#define HYPERTHREAD_FEATURE 0x00000100 +#define SERIALNUMBER_FEATURE 0x00000200 +#define APIC_FEATURE 0x00000400 +#define SSE_FP_FEATURE 0x00000800 #define SSE_MMX_FEATURE 0x00001000 -#define CMOV_FEATURE 0x00002000 -#define MTRR_FEATURE 0x00004000 +#define CMOV_FEATURE 0x00002000 +#define MTRR_FEATURE 0x00004000 #define L1CACHE_FEATURE 0x00008000 #define L2CACHE_FEATURE 0x00010000 #define L3CACHE_FEATURE 0x00020000 -#define ACPI_FEATURE 0x00040000 -#define THERMALMONITOR_FEATURE 0x00080000 -#define TEMPSENSEDIODE_FEATURE 0x00100000 -#define FREQUENCYID_FEATURE 0x00200000 -#define VOLTAGEID_FREQUENCY 0x00400000 +#define ACPI_FEATURE 0x00040000 +#define THERMALMONITOR_FEATURE 0x00080000 +#define TEMPSENSEDIODE_FEATURE 0x00100000 +#define FREQUENCYID_FEATURE 0x00200000 +#define VOLTAGEID_FREQUENCY 0x00400000 // Status Flag #define HT_NOT_CAPABLE 0 @@ -491,7 +521,6 @@ void SystemInformation::RunMemoryCheck() // Default value = 0xff if HT is not supported - SystemInformationImplementation::SystemInformationImplementation() { this->TotalVirtualMemory = 0; @@ -520,32 +549,48 @@ void SystemInformationImplementation::RunCPUCheck() { #ifdef WIN32 // Check to see if this processor supports CPUID. - if (DoesCPUSupportCPUID()) + bool supportsCPUID = DoesCPUSupportCPUID(); + + if (supportsCPUID) { // Retrieve the CPU details. RetrieveCPUIdentity(); RetrieveCPUFeatures(); - if (!RetrieveCPUClockSpeed()) - { - RetrieveClassicalCPUClockSpeed(); - } + } - // Attempt to retrieve cache information. + // These two may be called without support for the CPUID instruction. + // (But if the instruction is there, they should be called *after* + // the above call to RetrieveCPUIdentity... that's why the two if + // blocks exist with the same "if (supportsCPUID)" logic... + // + if (!RetrieveCPUClockSpeed()) + { + RetrieveClassicalCPUClockSpeed(); + } + + if (supportsCPUID) + { + // Retrieve cache information. if (!RetrieveCPUCacheDetails()) { RetrieveClassicalCPUCacheDetails(); } + // Retrieve the extended CPU details. if (!RetrieveExtendedCPUIdentity()) { RetrieveClassicalCPUIdentity(); } + RetrieveExtendedCPUFeatures(); + RetrieveCPUPowerManagement(); // Now attempt to retrieve the serial number (if possible). RetrieveProcessorSerialNumber(); } + this->CPUCount(); + #elif defined(__APPLE__) this->ParseSysCtl(); #elif defined (__SVR4) && defined (__sun) @@ -561,7 +606,7 @@ void SystemInformationImplementation::RunOSCheck() { this->QueryOSInformation(); } - + void SystemInformationImplementation::RunMemoryCheck() { #if defined(__APPLE__) @@ -615,7 +660,7 @@ const char* SystemInformationImplementation::GetOSPlatform() const char * SystemInformationImplementation::GetVendorID() { // Return the vendor ID. - switch (this->ChipManufacturer) + switch (this->ChipManufacturer) { case Intel: return "Intel Corporation"; @@ -718,7 +763,7 @@ int SystemInformationImplementation::GetProcessorCacheSize() /** Return the chosen cache size. */ int SystemInformationImplementation::GetProcessorCacheXSize(long int dwCacheID) { - switch (dwCacheID) + switch (dwCacheID) { case L1CACHE_FEATURE: return this->Features.L1CacheSize; @@ -730,6 +775,7 @@ int SystemInformationImplementation::GetProcessorCacheXSize(long int dwCacheID) return -1; } + bool SystemInformationImplementation::DoesCPUSupportFeature(long int dwFeature) { bool bHasFeature = false; @@ -803,6 +849,7 @@ bool SystemInformationImplementation::DoesCPUSupportFeature(long int dwFeature) return bHasFeature; } + void SystemInformationImplementation::Delay(unsigned int uiMS) { #ifdef WIN32 @@ -824,6 +871,7 @@ void SystemInformationImplementation::Delay(unsigned int uiMS) (void)uiMS; } + bool SystemInformationImplementation::DoesCPUSupportCPUID() { #if USE_ASM_INSTRUCTIONS @@ -859,19 +907,20 @@ bool SystemInformationImplementation::DoesCPUSupportCPUID() // The cpuid instruction succeeded. return true; + #else // Assume no cpuid instruction. return false; #endif } + bool SystemInformationImplementation::RetrieveCPUFeatures() { #if USE_ASM_INSTRUCTIONS int localCPUFeatures = 0; int localCPUAdvanced = 0; - // Use assembly to detect CPUID information... __try { _asm { @@ -907,17 +956,17 @@ bool SystemInformationImplementation::RetrieveCPUFeatures() } // Retrieve the features of CPU present. - this->Features.HasFPU = ((localCPUFeatures & 0x00000001) != 0); // FPU Present --> Bit 0 - this->Features.HasTSC = ((localCPUFeatures & 0x00000010) != 0); // TSC Present --> Bit 4 + this->Features.HasFPU = ((localCPUFeatures & 0x00000001) != 0); // FPU Present --> Bit 0 + this->Features.HasTSC = ((localCPUFeatures & 0x00000010) != 0); // TSC Present --> Bit 4 this->Features.HasAPIC = ((localCPUFeatures & 0x00000200) != 0); // APIC Present --> Bit 9 this->Features.HasMTRR = ((localCPUFeatures & 0x00001000) != 0); // MTRR Present --> Bit 12 this->Features.HasCMOV = ((localCPUFeatures & 0x00008000) != 0); // CMOV Present --> Bit 15 this->Features.HasSerial = ((localCPUFeatures & 0x00040000) != 0); // Serial Present --> Bit 18 this->Features.HasACPI = ((localCPUFeatures & 0x00400000) != 0); // ACPI Capable --> Bit 22 - this->Features.HasMMX = ((localCPUFeatures & 0x00800000) != 0); // MMX Present --> Bit 23 - this->Features.HasSSE = ((localCPUFeatures & 0x02000000) != 0); // SSE Present --> Bit 25 + this->Features.HasMMX = ((localCPUFeatures & 0x00800000) != 0); // MMX Present --> Bit 23 + this->Features.HasSSE = ((localCPUFeatures & 0x02000000) != 0); // SSE Present --> Bit 25 this->Features.HasSSE2 = ((localCPUFeatures & 0x04000000) != 0); // SSE2 Present --> Bit 26 - this->Features.HasThermal = ((localCPUFeatures & 0x20000000) != 0); // Thermal Monitor Present --> Bit 29 + this->Features.HasThermal = ((localCPUFeatures & 0x20000000) != 0); // Thermal Monitor Present --> Bit 29 this->Features.HasIA64 = ((localCPUFeatures & 0x40000000) != 0); // IA64 Present --> Bit 30 // Retrieve extended SSE capabilities if SSE is available. @@ -961,15 +1010,19 @@ bool SystemInformationImplementation::RetrieveCPUFeatures() this->Features.ExtendedFeatures.APIC_ID = ((localCPUAdvanced & 0xFF000000) >> 24); } } -#endif + return true; + +#else + return false; +#endif } /** Find the manufacturer given the vendor id */ void SystemInformationImplementation::FindManufacturer() { - if (strcmp (this->ChipID.Vendor, "GenuineIntel") == 0) this->ChipManufacturer = Intel; // Intel Corp. + if (strcmp (this->ChipID.Vendor, "GenuineIntel") == 0) this->ChipManufacturer = Intel; // Intel Corp. else if (strcmp (this->ChipID.Vendor, "UMC UMC UMC ") == 0) this->ChipManufacturer = UMC; // United Microelectronics Corp. else if (strcmp (this->ChipID.Vendor, "AuthenticAMD") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices else if (strcmp (this->ChipID.Vendor, "AMD ISBETTER") == 0) this->ChipManufacturer = AMD; // Advanced Micro Devices (1994) @@ -983,9 +1036,10 @@ void SystemInformationImplementation::FindManufacturer() else if (strcmp (this->ChipID.Vendor, "Sun") == 0) this->ChipManufacturer = Sun; // Sun Microelectronics else if (strcmp (this->ChipID.Vendor, "IBM") == 0) this->ChipManufacturer = IBM; // IBM Microelectronics else if (strcmp (this->ChipID.Vendor, "Motorola") == 0) this->ChipManufacturer = Motorola; // Motorola Microelectronics - else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer + else this->ChipManufacturer = UnknownManufacturer; // Unknown manufacturer } + /** */ bool SystemInformationImplementation::RetrieveCPUIdentity() { @@ -1054,11 +1108,15 @@ bool SystemInformationImplementation::RetrieveCPUIdentity() this->ChipID.Family = ((localCPUSignature & 0x00000F00) >> 8); // Bits 11..8 Used this->ChipID.Model = ((localCPUSignature & 0x000000F0) >> 4); // Bits 7..4 Used this->ChipID.Revision = ((localCPUSignature & 0x0000000F) >> 0); // Bits 3..0 Used -#endif return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveCPUCacheDetails() { @@ -1176,6 +1234,7 @@ bool SystemInformationImplementation::RetrieveCPUCacheDetails() return ((this->Features.L1CacheSize == -1) && (this->Features.L2CacheSize == -1)) ? false : true; } + /** */ bool SystemInformationImplementation::RetrieveClassicalCPUCacheDetails() { @@ -1372,18 +1431,51 @@ bool SystemInformationImplementation::RetrieveClassicalCPUCacheDetails() this->Features.L3CacheSize = L3Unified; } -#endif return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveCPUClockSpeed() { + bool retrieved = false; + #if _WIN32 - // First of all we check to see if the RDTSC (0x0F, 0x31) instruction is supported. - if (!this->Features.HasTSC) + // First of all we check to see if the RDTSC (0x0F, 0x31) instruction is + // supported. If not, we fallback to trying to read this value from the + // registry: + // + if (!this->Features.HasTSC) { - return false; + HKEY hKey = NULL; + LONG err = RegOpenKeyEx(HKEY_LOCAL_MACHINE, + "HARDWARE\\DESCRIPTION\\System\\CentralProcessor\\0", 0, + KEY_READ, &hKey); + + if (ERROR_SUCCESS == err) + { + DWORD dwType = 0; + DWORD data = 0; + DWORD dwSize = sizeof(DWORD); + + err = RegQueryValueEx(hKey, "~MHz", 0, + &dwType, (LPBYTE) &data, &dwSize); + + if (ERROR_SUCCESS == err) + { + this->CPUSpeedInMHz = (float) data; + retrieved = true; + } + + RegCloseKey(hKey); + hKey = NULL; + } + + return retrieved; } unsigned int uiRepetitions = 1; @@ -1391,7 +1483,7 @@ bool SystemInformationImplementation::RetrieveCPUClockSpeed() __int64 i64Total = 0; __int64 i64Overhead = 0; - for (unsigned int nCounter = 0; nCounter < uiRepetitions; nCounter ++) + for (unsigned int nCounter = 0; nCounter < uiRepetitions; nCounter ++) { i64Total += GetCyclesDifference (SystemInformationImplementation::Delay, uiMSecPerRepetition); @@ -1409,12 +1501,13 @@ bool SystemInformationImplementation::RetrieveCPUClockSpeed() // Save the CPU speed. this->CPUSpeedInMHz = (float) i64Total; - return true; -#else - return false; + retrieved = true; #endif + + return retrieved; } + /** */ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed() { @@ -1468,11 +1561,15 @@ bool SystemInformationImplementation::RetrieveClassicalCPUClockSpeed() // Save the clock speed. this->Features.CPUSpeed = (int) dFrequency; -#else + return true; + +#else + return false; #endif } + /** */ bool SystemInformationImplementation::RetrieveCPUExtendedLevelSupport(int CPULevelToCheck) { @@ -1518,7 +1615,7 @@ bool SystemInformationImplementation::RetrieveCPUExtendedLevelSupport(int CPULev return false; } } - + #if USE_ASM_INSTRUCTIONS // Use assembly to detect CPUID information... @@ -1566,6 +1663,7 @@ bool SystemInformationImplementation::RetrieveCPUExtendedLevelSupport(int CPULev return true; } + /** */ bool SystemInformationImplementation::RetrieveExtendedCPUFeatures() { @@ -1581,6 +1679,7 @@ bool SystemInformationImplementation::RetrieveExtendedCPUFeatures() { return false; } + #if USE_ASM_INSTRUCTIONS int localCPUExtendedFeatures = 0; @@ -1636,11 +1735,15 @@ bool SystemInformationImplementation::RetrieveExtendedCPUFeatures() { this->Features.ExtendedFeatures.HasMMXPlus = ((localCPUExtendedFeatures & 0x01000000) != 0); // Cyrix specific: Extended MMX --> Bit 24 } -#endif return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() { @@ -1653,7 +1756,6 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() #if USE_ASM_INSTRUCTIONS int SerialNumber[3]; - // Use assembly to detect CPUID information... __try { _asm { @@ -1703,14 +1805,18 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() ((SerialNumber[2] & 0x00ff0000) >> 16), ((SerialNumber[2] & 0x0000ff00) >> 8), ((SerialNumber[2] & 0x000000ff) >> 0)); -#endif return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveCPUPowerManagement() -{ +{ // Check to see if what we are about to do is supported... if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000007))) { @@ -1760,11 +1866,14 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement() this->Features.ExtendedFeatures.PowerManagement.HasFrequencyID = ((localCPUPowerManagement & 0x00000002) != 0); this->Features.ExtendedFeatures.PowerManagement.HasVoltageID = ((localCPUPowerManagement & 0x00000004) != 0); -#endif - return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() { @@ -1775,7 +1884,7 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() return false; if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000004))) return false; - + #if USE_ASM_INSTRUCTIONS int ProcessorNameStartPos = 0; int CPUExtendedIdentity[12]; @@ -1871,11 +1980,15 @@ bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() // Now move the name forward so that there is no white space. memmove(this->ChipID.ProcessorName, &(this->ChipID.ProcessorName[ProcessorNameStartPos]), (CHIPNAME_STRING_LENGTH - ProcessorNameStartPos)); } -#endif return true; + +#else + return false; +#endif } + /** */ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() { @@ -2152,6 +2265,7 @@ bool SystemInformationImplementation::RetrieveClassicalCPUIdentity() return true; } + /** Extract a value from the CPUInfo file */ kwsys_stl::string SystemInformationImplementation::ExtractValueFromCpuInfoFile(kwsys_stl::string buffer,const char* word,size_t init) { @@ -2281,11 +2395,16 @@ int SystemInformationImplementation::QueryMemory() #elif _WIN32 #if _MSC_VER < 1300 MEMORYSTATUS ms; + ms.dwLength = sizeof(ms); GlobalMemoryStatus(&ms); #define MEM_VAL(value) dw##value #else MEMORYSTATUSEX ms; - GlobalMemoryStatusEx(&ms); + ms.dwLength = sizeof(ms); + if (0 == GlobalMemoryStatusEx(&ms)) + { + return 0; + } #define MEM_VAL(value) ull##value #endif unsigned long tv = ms.MEM_VAL(TotalVirtual); @@ -2448,24 +2567,24 @@ int SystemInformationImplementation::QueryMemory() } /** */ -unsigned long SystemInformationImplementation::GetTotalVirtualMemory() +size_t SystemInformationImplementation::GetTotalVirtualMemory() { return this->TotalVirtualMemory; } /** */ -unsigned long SystemInformationImplementation::GetAvailableVirtualMemory() +size_t SystemInformationImplementation::GetAvailableVirtualMemory() { return this->AvailableVirtualMemory; } -unsigned long SystemInformationImplementation::GetTotalPhysicalMemory() +size_t SystemInformationImplementation::GetTotalPhysicalMemory() { return this->TotalPhysicalMemory; } /** */ -unsigned long SystemInformationImplementation::GetAvailablePhysicalMemory() +size_t SystemInformationImplementation::GetAvailablePhysicalMemory() { return this->AvailablePhysicalMemory; } @@ -2517,6 +2636,7 @@ LongLong SystemInformationImplementation::GetCyclesDifference (DELAY_FUNC DelayF #endif } + /** Compute the delay overhead */ void SystemInformationImplementation::DelayOverhead(unsigned int uiMS) { @@ -2546,6 +2666,7 @@ void SystemInformationImplementation::DelayOverhead(unsigned int uiMS) unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) { unsigned int Regebx = 0; + #if USE_ASM_INSTRUCTIONS if (!this->IsHyperThreadingSupported()) { @@ -2572,9 +2693,11 @@ unsigned char SystemInformationImplementation::LogicalCPUPerPhysicalCPU(void) return static_cast(cores_per_package); } #endif + return static_cast ((Regebx & NUM_LOGICAL_BITS) >> 16); } + /** Works only for windows */ unsigned int SystemInformationImplementation::IsHyperThreadingSupported() { @@ -2621,10 +2744,12 @@ unsigned int SystemInformationImplementation::IsHyperThreadingSupported() return 0; // Not genuine Intel processor } + /** Return the APIC Id. Works only for windows. */ unsigned char SystemInformationImplementation::GetAPICId() { unsigned int Regebx = 0; + #if USE_ASM_INSTRUCTIONS if (!this->IsHyperThreadingSupported()) { @@ -2637,9 +2762,11 @@ unsigned char SystemInformationImplementation::GetAPICId() mov Regebx, ebx } #endif + return static_cast((Regebx & INITIAL_APIC_ID_BITS) >> 24); } + /** Count the number of CPUs. Works only on windows. */ int SystemInformationImplementation::CPUCount() { @@ -2753,18 +2880,21 @@ int SystemInformationImplementation::CPUCount() #endif } + /** Return the number of logical CPUs on the system */ unsigned int SystemInformationImplementation::GetNumberOfLogicalCPU() { return this->NumberOfLogicalCPU; } + /** Return the number of physical CPUs on the system */ unsigned int SystemInformationImplementation::GetNumberOfPhysicalCPU() { return this->NumberOfPhysicalCPU; } + /** For Mac use sysctlbyname calls to find system info */ bool SystemInformationImplementation::ParseSysCtl() { @@ -2773,7 +2903,7 @@ bool SystemInformationImplementation::ParseSysCtl() uint64_t value = 0; size_t len = sizeof(value); sysctlbyname("hw.memsize", &value, &len, NULL, 0); - this->TotalPhysicalMemory = value/1048576; + this->TotalPhysicalMemory = static_cast< size_t >( value/1048576 ); // Parse values for Mac this->AvailablePhysicalMemory = 0; @@ -2784,7 +2914,7 @@ bool SystemInformationImplementation::ParseSysCtl() { err = sysctlbyname("hw.pagesize", &value, &len, NULL, 0); int64_t available_memory = vmstat.free_count * value; - this->AvailablePhysicalMemory = available_memory / 1048576; + this->AvailablePhysicalMemory = static_cast< size_t >( available_memory / 1048576 ); } #ifdef VM_SWAPUSAGE @@ -2796,8 +2926,8 @@ bool SystemInformationImplementation::ParseSysCtl() err = sysctl(mib, miblen, &swap, &len, NULL, 0); if (err == 0) { - this->AvailableVirtualMemory = swap.xsu_avail/1048576; - this->TotalVirtualMemory = swap.xsu_total/1048576; + this->AvailableVirtualMemory = static_cast< size_t >( swap.xsu_avail/1048576 ); + this->TotalVirtualMemory = static_cast< size_t >( swap.xsu_total/1048576 ); } #else this->AvailableVirtualMemory = 0; @@ -2813,7 +2943,7 @@ bool SystemInformationImplementation::ParseSysCtl() len = sizeof(value); sysctlbyname("hw.cpufrequency", &value, &len, NULL, 0); - this->CPUSpeedInMHz = value / 1048576; + this->CPUSpeedInMHz = static_cast< float >( value )/ 1048576; // Chip family @@ -2861,14 +2991,14 @@ bool SystemInformationImplementation::ParseSysCtl() // Chip Model len = sizeof(value); err = sysctlbyname("machdep.cpu.model", &value, &len, NULL, 0); - this->ChipID.Model = value; + this->ChipID.Model = static_cast< int >( value ); } // Cache size len = sizeof(value); err = sysctlbyname("hw.l1icachesize", &value, &len, NULL, 0); - this->Features.L1CacheSize = value; + this->Features.L1CacheSize = static_cast< int >( value ); err = sysctlbyname("hw.l2cachesize", &value, &len, NULL, 0); - this->Features.L2CacheSize = value; + this->Features.L2CacheSize = static_cast< int >( value ); return true; #else @@ -2876,6 +3006,7 @@ bool SystemInformationImplementation::ParseSysCtl() #endif } + /** Extract a value from sysctl command */ kwsys_stl::string SystemInformationImplementation::ExtractValueFromSysCtl(const char* word) { @@ -2892,6 +3023,7 @@ kwsys_stl::string SystemInformationImplementation::ExtractValueFromSysCtl(const return ""; } + /** Run a given process */ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector args) { @@ -2952,7 +3084,7 @@ kwsys_stl::string SystemInformationImplementation::RunProcess(kwsys_stl::vector< } return buffer; } - + kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const char* arguments) { @@ -3010,17 +3142,18 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha if(buffer[i] == ' ' || buffer[i] == '\t') { break; - } + } if(buffer[i] != '\n' && buffer[i] != '\r') { kwsys_stl::string val = value; value = buffer[i]; value += val; - } + } } return value; } + /** Querying for system information from Solaris */ bool SystemInformationImplementation::QuerySolarisInfo() { @@ -3066,6 +3199,7 @@ bool SystemInformationImplementation::QuerySolarisInfo() return true; } + /** Querying for system information from Haiku OS */ bool SystemInformationImplementation::QueryHaikuInfo() { @@ -3131,10 +3265,14 @@ bool SystemInformationImplementation::QueryHaikuInfo() this->Features.L1CacheSize = 0; this->Features.L2CacheSize = 0; -#endif return true; + +#else + return false; +#endif } + /** Query the operating system information */ bool SystemInformationImplementation::QueryOSInformation() { @@ -3360,6 +3498,12 @@ bool SystemInformationImplementation::QueryOSInformation() WSACleanup( ); } this->Hostname = name; + + const char* arch = getenv("PROCESSOR_ARCHITECTURE"); + if(arch) + { + this->OSPlatform = arch; + } #else @@ -3373,16 +3517,74 @@ bool SystemInformationImplementation::QueryOSInformation() this->OSVersion = unameInfo.version; this->OSPlatform = unameInfo.machine; } + +#ifdef __APPLE__ + this->CallSwVers(); +#endif + #endif return true; } + +void SystemInformationImplementation::CallSwVers() +{ +#ifdef __APPLE__ + kwsys_stl::string output; + kwsys_stl::vector args; + args.clear(); + + args.push_back("sw_vers"); + args.push_back("-productName"); + args.push_back(0); + output = this->RunProcess(args); + this->TrimNewline(output); + this->OSName = output; + args.clear(); + + args.push_back("sw_vers"); + args.push_back("-productVersion"); + args.push_back(0); + output = this->RunProcess(args); + this->TrimNewline(output); + this->OSRelease = output; + args.clear(); + + args.push_back("sw_vers"); + args.push_back("-buildVersion"); + args.push_back(0); + output = this->RunProcess(args); + this->TrimNewline(output); + this->OSVersion = output; +#endif +} + + +void SystemInformationImplementation::TrimNewline(kwsys_stl::string& output) +{ + // remove \r + kwsys_stl::string::size_type pos=0; + while((pos = output.find("\r", pos)) != kwsys_stl::string::npos) + { + output.erase(pos); + } + + // remove \n + pos = 0; + while((pos = output.find("\n", pos)) != kwsys_stl::string::npos) + { + output.erase(pos); + } +} + + /** Return true if the machine is 64 bits */ bool SystemInformationImplementation::Is64Bits() { return (sizeof(void*) == 8); } + } // namespace @KWSYS_NAMESPACE@ diff --git a/GCC_XML/KWSys/SystemInformation.hxx.in b/GCC_XML/KWSys/SystemInformation.hxx.in index f2adaa9..b6ebe6a 100644 --- a/GCC_XML/KWSys/SystemInformation.hxx.in +++ b/GCC_XML/KWSys/SystemInformation.hxx.in @@ -1,18 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: SystemInformation.hxx.in - Language: C++ - Date: $Date$ - Version: $Revision$ - Copyright (c) 2005 Insight Consortium. All rights reserved. - See ITKCopyright.txt or http://www.itk.org/HTML/Copyright.htm for details. + 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 above copyright notices for more information. -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_SystemInformation_h #define @KWSYS_NAMESPACE@_SystemInformation_h @@ -23,6 +19,7 @@ # define kwsys_ios @KWSYS_NAMESPACE@_ios #endif #include <@KWSYS_NAMESPACE@/stl/string> +#include /* size_t */ namespace @KWSYS_NAMESPACE@ { @@ -67,10 +64,10 @@ public: bool DoesCPUSupportCPUID(); // Retrieve memory information in megabyte. - unsigned long GetTotalVirtualMemory(); - unsigned long GetAvailableVirtualMemory(); - unsigned long GetTotalPhysicalMemory(); - unsigned long GetAvailablePhysicalMemory(); + size_t GetTotalVirtualMemory(); + size_t GetAvailableVirtualMemory(); + size_t GetTotalPhysicalMemory(); + size_t GetAvailablePhysicalMemory(); /** Run the different checks */ void RunCPUCheck(); diff --git a/GCC_XML/KWSys/SystemTools.cxx b/GCC_XML/KWSys/SystemTools.cxx index ac15898..1c00621 100644 --- a/GCC_XML/KWSys/SystemTools.cxx +++ b/GCC_XML/KWSys/SystemTools.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: SystemTools.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(RegularExpression.hxx) #include KWSYS_HEADER(SystemTools.hxx) @@ -64,9 +62,16 @@ #include /* sigprocmask */ #endif -// Windows API. Some parts used even on cygwin. +// Windows API. #if defined(_WIN32) # include +#elif defined (__CYGWIN__) +# include +# undef _WIN32 +#endif + +#ifdef __CYGWIN__ +extern "C" void cygwin_conv_to_win32_path(const char *path, char *win32_path); #endif // getpwnam doesn't exist on Windows and Cray Xt3/Catamount @@ -282,7 +287,7 @@ extern int putenv (char *__string) __THROW; # define FTIME _ftime # define TIMEB _timeb # endif -#elif defined( __CYGWIN__ ) || defined( __linux__ ) +#elif defined( __CYGWIN__ ) || defined( __linux__ ) || defined(__APPLE__) # include # include # define HAVE_GETTIMEOFDAY @@ -410,11 +415,13 @@ class kwsysDeletingCharVector : public kwsys_stl::vector kwsysDeletingCharVector::~kwsysDeletingCharVector() { +#ifndef KWSYS_DO_NOT_CLEAN_PUTENV for(kwsys_stl::vector::iterator i = this->begin(); i != this->end(); ++i) { delete []*i; } +#endif } bool SystemTools::PutEnv(const char* value) { @@ -892,39 +899,69 @@ bool SystemTools::SameFile(const char* file1, const char* file2) #endif } - -// return true if the file exists -bool SystemTools::FileExists(const char* filename, bool isFile) +//---------------------------------------------------------------------------- +#if defined(_WIN32) || defined(__CYGWIN__) +static bool WindowsFileExists(const char* filename) { -#ifdef _MSC_VER -# define access _access -#endif -#ifndef R_OK -# define R_OK 04 + WIN32_FILE_ATTRIBUTE_DATA fd; + return GetFileAttributesExA(filename, GetFileExInfoStandard, &fd) != 0; +} #endif -#ifdef __SYLLABLE__ - if ((filename !=0) && (*filename == 0)) +//---------------------------------------------------------------------------- +bool SystemTools::FileExists(const char* filename) +{ + if(!(filename && *filename)) { return false; - } + } +#if defined(__CYGWIN__) + // Convert filename to native windows path if possible. + char winpath[MAX_PATH]; + if(SystemTools::PathCygwinToWin32(filename, winpath)) + { + return WindowsFileExists(winpath); + } + return access(filename, R_OK) == 0; +#elif defined(_WIN32) + return WindowsFileExists(filename); +#else + return access(filename, R_OK) == 0; #endif +} - if ( access(filename, R_OK) != 0 ) +//---------------------------------------------------------------------------- +bool SystemTools::FileExists(const char* filename, bool isFile) +{ + if(SystemTools::FileExists(filename)) { - return false; + // If isFile is set return not FileIsDirectory, + // so this will only be true if it is a file + return !isFile || !SystemTools::FileIsDirectory(filename); + } + return false; +} + +//---------------------------------------------------------------------------- +#ifdef __CYGWIN__ +bool SystemTools::PathCygwinToWin32(const char *path, char *win32_path) +{ + SystemToolsTranslationMap::iterator i = + SystemTools::Cyg2Win32Map->find(path); + + if (i != SystemTools::Cyg2Win32Map->end()) + { + strncpy(win32_path, i->second.c_str(), MAX_PATH); } else { - // If isFile is set return not FileIsDirectory, - // so this will only be true if it is a file - if(isFile) - { - return !SystemTools::FileIsDirectory(filename); - } - return true; + cygwin_conv_to_win32_path(path, win32_path); + SystemToolsTranslationMap::value_type entry(path, win32_path); + SystemTools::Cyg2Win32Map->insert(entry); } + return win32_path[0] != 0; } +#endif bool SystemTools::Touch(const char* filename, bool create) { @@ -2577,7 +2614,7 @@ bool SystemTools::FileIsDirectory(const char* name) struct stat fs; if(stat(name, &fs) == 0) { -#if defined( _WIN32 ) +#if defined( _WIN32 ) && !defined(__CYGWIN__) return ((fs.st_mode & _S_IFDIR) != 0); #else return S_ISDIR(fs.st_mode); @@ -3922,7 +3959,20 @@ bool SystemTools::GetLineFromStream(kwsys_ios::istream& is, line = ""; long leftToRead = sizeLimit; - + + // Early short circuit return if stream is no good. Just return + // false and the empty line. (Probably means caller tried to + // create a file stream with a non-existent file name...) + // + if(!is) + { + if(has_newline) + { + *has_newline = false; + } + return false; + } + // If no characters are read from the stream, the end of file has // been reached. Clear the fail bit just before reading. while(!haveNewline && @@ -4536,6 +4586,9 @@ bool SystemTools::ParseURL( const kwsys_stl::string& URL, unsigned int SystemToolsManagerCount; SystemToolsTranslationMap *SystemTools::TranslationMap; SystemToolsTranslationMap *SystemTools::LongPathMap; +#ifdef __CYGWIN__ +SystemToolsTranslationMap *SystemTools::Cyg2Win32Map; +#endif // SystemToolsManager manages the SystemTools singleton. // SystemToolsManager should be included in any translation unit @@ -4581,6 +4634,9 @@ void SystemTools::ClassInitialize() // Allocate the translation map first. SystemTools::TranslationMap = new SystemToolsTranslationMap; SystemTools::LongPathMap = new SystemToolsTranslationMap; +#ifdef __CYGWIN__ + SystemTools::Cyg2Win32Map = new SystemToolsTranslationMap; +#endif // Add some special translation paths for unix. These are not added // for windows because drive letters need to be maintained. Also, @@ -4637,6 +4693,9 @@ void SystemTools::ClassFinalize() { delete SystemTools::TranslationMap; delete SystemTools::LongPathMap; +#ifdef __CYGWIN__ + delete SystemTools::Cyg2Win32Map; +#endif } diff --git a/GCC_XML/KWSys/SystemTools.hxx.in b/GCC_XML/KWSys/SystemTools.hxx.in index 6fad217..fd35742 100644 --- a/GCC_XML/KWSys/SystemTools.hxx.in +++ b/GCC_XML/KWSys/SystemTools.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: SystemTools.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_SystemTools_hxx #define @KWSYS_NAMESPACE@_SystemTools_hxx @@ -275,7 +273,17 @@ public: * not a directory. If isFile = false, then return true * if it is a file or a directory. */ - static bool FileExists(const char* filename, bool isFile=false); + static bool FileExists(const char* filename, bool isFile); + static bool FileExists(const char* filename); + + /** + * Converts Cygwin path to Win32 path. Uses dictionary container for + * caching and calls to cygwin_conv_to_win32_path from Cygwin dll + * for actual translation. Returns true on success, else false. + */ +#ifdef __CYGWIN__ + static bool PathCygwinToWin32(const char *path, char *win32_path); +#endif /** * Return file length @@ -890,6 +898,9 @@ private: */ static SystemToolsTranslationMap *TranslationMap; static SystemToolsTranslationMap *LongPathMap; +#ifdef __CYGWIN__ + static SystemToolsTranslationMap *Cyg2Win32Map; +#endif friend class SystemToolsManager; }; diff --git a/GCC_XML/KWSys/Terminal.c b/GCC_XML/KWSys/Terminal.c index 6bae4ec..3bf2579 100644 --- a/GCC_XML/KWSys/Terminal.c +++ b/GCC_XML/KWSys/Terminal.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Terminal.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Terminal.h) diff --git a/GCC_XML/KWSys/Terminal.h.in b/GCC_XML/KWSys/Terminal.h.in index 0fef3be..108cba0 100644 --- a/GCC_XML/KWSys/Terminal.h.in +++ b/GCC_XML/KWSys/Terminal.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: Terminal.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_Terminal_h #define @KWSYS_NAMESPACE@_Terminal_h diff --git a/GCC_XML/KWSys/auto_ptr.hxx.in b/GCC_XML/KWSys/auto_ptr.hxx.in index 24f611b..857b1db 100644 --- a/GCC_XML/KWSys/auto_ptr.hxx.in +++ b/GCC_XML/KWSys/auto_ptr.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: auto_ptr.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_auto_ptr_hxx #define @KWSYS_NAMESPACE@_auto_ptr_hxx diff --git a/GCC_XML/KWSys/hash_fun.hxx.in b/GCC_XML/KWSys/hash_fun.hxx.in index 6000f3f..f21efc5 100644 --- a/GCC_XML/KWSys/hash_fun.hxx.in +++ b/GCC_XML/KWSys/hash_fun.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: hash_fun.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ /* * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. diff --git a/GCC_XML/KWSys/hash_map.hxx.in b/GCC_XML/KWSys/hash_map.hxx.in index b14dea2..6d4379d 100644 --- a/GCC_XML/KWSys/hash_map.hxx.in +++ b/GCC_XML/KWSys/hash_map.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: hash_map.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ /* * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. diff --git a/GCC_XML/KWSys/hash_set.hxx.in b/GCC_XML/KWSys/hash_set.hxx.in index df15acf..5ee01a5 100644 --- a/GCC_XML/KWSys/hash_set.hxx.in +++ b/GCC_XML/KWSys/hash_set.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: hash_set.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ /* * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. diff --git a/GCC_XML/KWSys/hashtable.hxx.in b/GCC_XML/KWSys/hashtable.hxx.in index 6751a23..b36c975 100644 --- a/GCC_XML/KWSys/hashtable.hxx.in +++ b/GCC_XML/KWSys/hashtable.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: hashtable.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ /* * Copyright (c) 1996 * Silicon Graphics Computer Systems, Inc. diff --git a/GCC_XML/KWSys/kwsysDateStamp.cmake b/GCC_XML/KWSys/kwsysDateStamp.cmake index 8e64e4a..b961c1e 100644 --- a/GCC_XML/KWSys/kwsysDateStamp.cmake +++ b/GCC_XML/KWSys/kwsysDateStamp.cmake @@ -1,10 +1,21 @@ # Do not edit! Generated by kwsysDateStamp.py +#============================================================================= +# 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. +#============================================================================= # KWSys version date year component. Format is CCYY. -SET(KWSYS_DATE_STAMP_YEAR 2009) +SET(KWSYS_DATE_STAMP_YEAR 2010) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 09) +SET(KWSYS_DATE_STAMP_MONTH 01) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 14) +SET(KWSYS_DATE_STAMP_DAY 27) diff --git a/GCC_XML/KWSys/kwsysDateStamp.py b/GCC_XML/KWSys/kwsysDateStamp.py index e719a42..bd2e49a 100755 --- a/GCC_XML/KWSys/kwsysDateStamp.py +++ b/GCC_XML/KWSys/kwsysDateStamp.py @@ -1,4 +1,15 @@ #!/usr/bin/python +#============================================================================= +# 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. +#============================================================================= import sys,os import time @@ -18,6 +29,17 @@ # Write the CMake code describing the date. fout.write("""# Do not edit! Generated by kwsysDateStamp.py +#============================================================================= +# 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. +#============================================================================= # KWSys version date year component. Format is CCYY. SET(KWSYS_DATE_STAMP_YEAR %04u) diff --git a/GCC_XML/KWSys/kwsysHeaderDump.pl b/GCC_XML/KWSys/kwsysHeaderDump.pl index 215ee39..0dc4a52 100755 --- a/GCC_XML/KWSys/kwsysHeaderDump.pl +++ b/GCC_XML/KWSys/kwsysHeaderDump.pl @@ -1,15 +1,15 @@ #!/usr/bin/perl +#============================================================================= +# KWSys - Kitware System Library +# Copyright 2000-2009 Kitware, Inc., Insight Software Consortium # -# Program: KWSys - Kitware System Library -# Module: kwsysHeaderDump.pl -# -# Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. -# See Copyright.txt or http://www.kitware.com/Copyright.htm for details. -# -# This software is distributed WITHOUT ANY WARRANTY; without even -# the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the above copyright notices for more information. +# 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. +#============================================================================= if ( $#ARGV+1 < 2 ) { diff --git a/GCC_XML/KWSys/kwsysPlatformTests.cmake b/GCC_XML/KWSys/kwsysPlatformTests.cmake index 5c942af..994b7e7 100644 --- a/GCC_XML/KWSys/kwsysPlatformTests.cmake +++ b/GCC_XML/KWSys/kwsysPlatformTests.cmake @@ -1,3 +1,14 @@ +#============================================================================= +# 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. +#============================================================================= SET(KWSYS_PLATFORM_TEST_FILE_C kwsysPlatformTestsC.c) SET(KWSYS_PLATFORM_TEST_FILE_CXX kwsysPlatformTestsCXX.cxx) @@ -151,3 +162,55 @@ MACRO(KWSYS_PLATFORM_CXX_TEST_RUN var description invert) SET(KWSYS_PLATFORM_TEST_DEFINES) SET(KWSYS_PLATFORM_TEST_EXTRA_FLAGS) ENDMACRO(KWSYS_PLATFORM_CXX_TEST_RUN) + +#----------------------------------------------------------------------------- +# KWSYS_PLATFORM_INFO_TEST(lang var description) +# +# Compile test named by ${var} and store INFO strings extracted from binary. +MACRO(KWSYS_PLATFORM_INFO_TEST lang var description) + # We can implement this macro on CMake 2.6 and above. + IF("${CMAKE_MAJOR_VERSION}.${CMAKE_MINOR_VERSION}" LESS 2.6) + SET(${var} "") + ELSE() + # Choose a location for the result binary. + SET(KWSYS_PLATFORM_INFO_FILE + ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_FILES_DIRECTORY}/${var}.bin) + + # Compile the test binary. + IF(NOT DEFINED ${var}_COMPILED) + MESSAGE(STATUS "${description}") + TRY_COMPILE(${var}_COMPILED + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/${KWSYS_PLATFORM_TEST_FILE_${lang}} + COMPILE_DEFINITIONS -DTEST_${var} + ${KWSYS_PLATFORM_${lang}_TEST_DEFINES} + ${KWSYS_PLATFORM_${lang}_TEST_EXTRA_FLAGS} + OUTPUT_VARIABLE OUTPUT + COPY_FILE ${KWSYS_PLATFORM_INFO_FILE} + ) + IF(${var}_COMPILED) + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeOutput.log + "${description} compiled with the following output:\n${OUTPUT}\n\n") + ELSE() + FILE(APPEND + ${CMAKE_BINARY_DIR}${CMAKE_FILES_DIRECTORY}/CMakeError.log + "${description} failed to compile with the following output:\n${OUTPUT}\n\n") + ENDIF() + IF(${var}_COMPILED) + MESSAGE(STATUS "${description} - compiled") + ELSE() + MESSAGE(STATUS "${description} - failed") + ENDIF() + ENDIF() + + # Parse info strings out of the compiled binary. + IF(${var}_COMPILED) + FILE(STRINGS ${KWSYS_PLATFORM_INFO_FILE} ${var} REGEX "INFO:[A-Za-z0-9]+\\[[^]]*\\]") + ELSE() + SET(${var} "") + ENDIF() + + SET(KWSYS_PLATFORM_INFO_FILE) + ENDIF() +ENDMACRO() diff --git a/GCC_XML/KWSys/kwsysPlatformTestsC.c b/GCC_XML/KWSys/kwsysPlatformTestsC.c index 58b22f3..e602964 100644 --- a/GCC_XML/KWSys/kwsysPlatformTestsC.c +++ b/GCC_XML/KWSys/kwsysPlatformTestsC.c @@ -1,3 +1,14 @@ +/*============================================================================ + 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. +============================================================================*/ /* Macros to define main() in a cross-platform way. @@ -49,3 +60,41 @@ int KWSYS_PLATFORM_TEST_C_MAIN() return f(n); } #endif + +/*--------------------------------------------------------------------------*/ +#ifdef TEST_KWSYS_C_TYPE_MACROS +char* info_macros = +#if defined(__SIZEOF_SHORT__) +"INFO:macro[__SIZEOF_SHORT__]\n" +#endif +#if defined(__SIZEOF_INT__) +"INFO:macro[__SIZEOF_INT__]\n" +#endif +#if defined(__SIZEOF_LONG__) +"INFO:macro[__SIZEOF_LONG__]\n" +#endif +#if defined(__SIZEOF_LONG_LONG__) +"INFO:macro[__SIZEOF_LONG_LONG__]\n" +#endif +#if defined(__SHORT_MAX__) +"INFO:macro[__SHORT_MAX__]\n" +#endif +#if defined(__INT_MAX__) +"INFO:macro[__INT_MAX__]\n" +#endif +#if defined(__LONG_MAX__) +"INFO:macro[__LONG_MAX__]\n" +#endif +#if defined(__LONG_LONG_MAX__) +"INFO:macro[__LONG_LONG_MAX__]\n" +#endif + ""; + +int KWSYS_PLATFORM_TEST_C_MAIN_ARGS(argc, argv) +{ + int require = 0; + require += info_macros[argc]; + (void)argv; + return require; +} +#endif diff --git a/GCC_XML/KWSys/kwsysPlatformTestsCXX.cxx b/GCC_XML/KWSys/kwsysPlatformTestsCXX.cxx index 502e2d8..903be9b 100644 --- a/GCC_XML/KWSys/kwsysPlatformTestsCXX.cxx +++ b/GCC_XML/KWSys/kwsysPlatformTestsCXX.cxx @@ -1,3 +1,14 @@ +/*============================================================================ + 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 @@ -102,6 +113,15 @@ 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_NULL_TEMPLATE_ARGS template class A; template int f(A&); diff --git a/GCC_XML/KWSys/kwsysPrivate.h b/GCC_XML/KWSys/kwsysPrivate.h index 90623e5..3a26c26 100644 --- a/GCC_XML/KWSys/kwsysPrivate.h +++ b/GCC_XML/KWSys/kwsysPrivate.h @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsysPrivate.h + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef KWSYS_NAMESPACE # error "Do not include kwsysPrivate.h outside of kwsys c and cxx files." #endif diff --git a/GCC_XML/KWSys/kwsys_cstddef.hxx.in b/GCC_XML/KWSys/kwsys_cstddef.hxx.in index 41ed12f..925c030 100644 --- a/GCC_XML/KWSys/kwsys_cstddef.hxx.in +++ b/GCC_XML/KWSys/kwsys_cstddef.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_cstddef.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_cstddef #define @KWSYS_NAMESPACE@_cstddef diff --git a/GCC_XML/KWSys/kwsys_ios_fstream.h.in b/GCC_XML/KWSys/kwsys_ios_fstream.h.in index d918b86..4b1a8cf 100644 --- a/GCC_XML/KWSys/kwsys_ios_fstream.h.in +++ b/GCC_XML/KWSys/kwsys_ios_fstream.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_ios_fstream.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_ios_fstream #define @KWSYS_NAMESPACE@_ios_fstream diff --git a/GCC_XML/KWSys/kwsys_ios_iosfwd.h.in b/GCC_XML/KWSys/kwsys_ios_iosfwd.h.in index 0f3b66e..f4fafeb 100644 --- a/GCC_XML/KWSys/kwsys_ios_iosfwd.h.in +++ b/GCC_XML/KWSys/kwsys_ios_iosfwd.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_ios_iosfwd.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_ios_iosfwd #define @KWSYS_NAMESPACE@_ios_iosfwd diff --git a/GCC_XML/KWSys/kwsys_ios_iostream.h.in b/GCC_XML/KWSys/kwsys_ios_iostream.h.in index c3a3f87..43fc4d5 100644 --- a/GCC_XML/KWSys/kwsys_ios_iostream.h.in +++ b/GCC_XML/KWSys/kwsys_ios_iostream.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_ios_iostream.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_ios_iostream #define @KWSYS_NAMESPACE@_ios_iostream diff --git a/GCC_XML/KWSys/kwsys_ios_sstream.h.in b/GCC_XML/KWSys/kwsys_ios_sstream.h.in index 8df86fc..29d250c 100644 --- a/GCC_XML/KWSys/kwsys_ios_sstream.h.in +++ b/GCC_XML/KWSys/kwsys_ios_sstream.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_ios_sstream.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_ios_sstream #define @KWSYS_NAMESPACE@_ios_sstream diff --git a/GCC_XML/KWSys/kwsys_stl.hxx.in b/GCC_XML/KWSys/kwsys_stl.hxx.in index 6b124b8..610e6d4 100644 --- a/GCC_XML/KWSys/kwsys_stl.hxx.in +++ b/GCC_XML/KWSys/kwsys_stl.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_stl.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_stl_@KWSYS_STL_HEADER@ #define @KWSYS_NAMESPACE@_stl_@KWSYS_STL_HEADER@ diff --git a/GCC_XML/KWSys/kwsys_stl_string.hxx.in b/GCC_XML/KWSys/kwsys_stl_string.hxx.in index a81c9b9..cd312cb 100644 --- a/GCC_XML/KWSys/kwsys_stl_string.hxx.in +++ b/GCC_XML/KWSys/kwsys_stl_string.hxx.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: kwsys_stl_string.hxx.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ // This header is extra code for <@KWSYS_NAMESPACE@/stl/string>. #if !defined(@KWSYS_NAMESPACE@_stl_string_including_hxx) diff --git a/GCC_XML/KWSys/testAutoPtr.cxx b/GCC_XML/KWSys/testAutoPtr.cxx index f355283..747d869 100644 --- a/GCC_XML/KWSys/testAutoPtr.cxx +++ b/GCC_XML/KWSys/testAutoPtr.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testAutoPtr.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifdef __BORLANDC__ # pragma warn -8027 /* 'for' not inlined. */ # pragma warn -8026 /* exception not inlined. */ diff --git a/GCC_XML/KWSys/testCommandLineArguments.cxx b/GCC_XML/KWSys/testCommandLineArguments.cxx index 0694f8a..e75a87e 100644 --- a/GCC_XML/KWSys/testCommandLineArguments.cxx +++ b/GCC_XML/KWSys/testCommandLineArguments.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testCommandLineArguments.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(CommandLineArguments.hxx) #include KWSYS_HEADER(ios/iostream) diff --git a/GCC_XML/KWSys/testCommandLineArguments1.cxx b/GCC_XML/KWSys/testCommandLineArguments1.cxx index f924c84..0860c2a 100644 --- a/GCC_XML/KWSys/testCommandLineArguments1.cxx +++ b/GCC_XML/KWSys/testCommandLineArguments1.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testCommandLineArguments1.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(CommandLineArguments.hxx) #include KWSYS_HEADER(ios/iostream) diff --git a/GCC_XML/KWSys/testDynamicLoader.cxx b/GCC_XML/KWSys/testDynamicLoader.cxx index 09a2e74..a7adbca 100644 --- a/GCC_XML/KWSys/testDynamicLoader.cxx +++ b/GCC_XML/KWSys/testDynamicLoader.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testDynamicLoader.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(DynamicLoader.hxx) diff --git a/GCC_XML/KWSys/testDynload.c b/GCC_XML/KWSys/testDynload.c index 67c33c3..ba60bec 100644 --- a/GCC_XML/KWSys/testDynload.c +++ b/GCC_XML/KWSys/testDynload.c @@ -1,3 +1,14 @@ +/*============================================================================ + 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. +============================================================================*/ #ifdef _WIN32 #define DL_EXPORT __declspec( dllexport ) #else diff --git a/GCC_XML/KWSys/testEncode.c b/GCC_XML/KWSys/testEncode.c index 57746ef..26d483b 100644 --- a/GCC_XML/KWSys/testEncode.c +++ b/GCC_XML/KWSys/testEncode.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testEncode.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(MD5.h) @@ -24,9 +22,9 @@ #include static const unsigned char testMD5input1[] = -" Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved.\n" -" See Copyright.txt or http://www.kitware.com/Copyright.htm for details.\n"; -static const char testMD5output1[] = "04051e509e81ef0b1612ddf0e52ca89e"; +" A quick brown fox jumps over the lazy dog.\n" +" This is sample text for MD5 sum input.\n"; +static const char testMD5output1[] = "8f146af46ed4f267921bb937d4d3500c"; static const int testMD5input2len = 28; static const unsigned char testMD5input2[] = "the cow jumped over the moon"; diff --git a/GCC_XML/KWSys/testFail.c b/GCC_XML/KWSys/testFail.c index c9d62f4..7e062c1 100644 --- a/GCC_XML/KWSys/testFail.c +++ b/GCC_XML/KWSys/testFail.c @@ -1,3 +1,14 @@ +/*============================================================================ + 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. +============================================================================*/ #include #include #include diff --git a/GCC_XML/KWSys/testHashSTL.cxx b/GCC_XML/KWSys/testHashSTL.cxx index 212c15a..b861a5b 100644 --- a/GCC_XML/KWSys/testHashSTL.cxx +++ b/GCC_XML/KWSys/testHashSTL.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testHashSTL.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(hash_map.hxx) #include KWSYS_HEADER(hash_set.hxx) diff --git a/GCC_XML/KWSys/testIOS.cxx b/GCC_XML/KWSys/testIOS.cxx index 2839109..3b971e2 100644 --- a/GCC_XML/KWSys/testIOS.cxx +++ b/GCC_XML/KWSys/testIOS.cxx @@ -1,3 +1,14 @@ +/*============================================================================ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(stl/vector) #include KWSYS_HEADER(ios/sstream) diff --git a/GCC_XML/KWSys/testProcess.c b/GCC_XML/KWSys/testProcess.c index 4ab0a09..0060c4d 100644 --- a/GCC_XML/KWSys/testProcess.c +++ b/GCC_XML/KWSys/testProcess.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testProcess.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Process.h) @@ -268,7 +266,7 @@ int runChild2(kwsysProcess* kp, } else { - fwrite(data, 1, length, stdout); + fwrite(data, 1, (size_t) length, stdout); fflush(stdout); } } diff --git a/GCC_XML/KWSys/testRegistry.cxx b/GCC_XML/KWSys/testRegistry.cxx index da044a1..7e9b0d4 100644 --- a/GCC_XML/KWSys/testRegistry.cxx +++ b/GCC_XML/KWSys/testRegistry.cxx @@ -1,17 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: ParaView - Module: testRegistry.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc. - All rights reserved. - See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Registry.hxx) diff --git a/GCC_XML/KWSys/testSharedForward.c.in b/GCC_XML/KWSys/testSharedForward.c.in index e7e4320..ee753ef 100644 --- a/GCC_XML/KWSys/testSharedForward.c.in +++ b/GCC_XML/KWSys/testSharedForward.c.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testSharedForward.c.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #if defined(CMAKE_INTDIR) # define CONFIG_DIR_PRE CMAKE_INTDIR "/" # define CONFIG_DIR_POST "/" CMAKE_INTDIR diff --git a/GCC_XML/KWSys/testSystemInformation.cxx b/GCC_XML/KWSys/testSystemInformation.cxx index 7264f56..b3afc9d 100644 --- a/GCC_XML/KWSys/testSystemInformation.cxx +++ b/GCC_XML/KWSys/testSystemInformation.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testSystemInformation.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(SystemInformation.hxx) #include KWSYS_HEADER(ios/iostream) diff --git a/GCC_XML/KWSys/testSystemTools.cxx b/GCC_XML/KWSys/testSystemTools.cxx index f4a197a..ad35c34 100644 --- a/GCC_XML/KWSys/testSystemTools.cxx +++ b/GCC_XML/KWSys/testSystemTools.cxx @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testSystemTools.cxx + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #if defined(_MSC_VER) diff --git a/GCC_XML/KWSys/testSystemTools.h.in b/GCC_XML/KWSys/testSystemTools.h.in index 0e4f73d..4b94bb6 100644 --- a/GCC_XML/KWSys/testSystemTools.h.in +++ b/GCC_XML/KWSys/testSystemTools.h.in @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testSystemTools.h.in + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #ifndef @KWSYS_NAMESPACE@_testSystemtools_h #define @KWSYS_NAMESPACE@_testSystemtools_h diff --git a/GCC_XML/KWSys/testTerminal.c b/GCC_XML/KWSys/testTerminal.c index 39b9e95..0d2d7a7 100644 --- a/GCC_XML/KWSys/testTerminal.c +++ b/GCC_XML/KWSys/testTerminal.c @@ -1,16 +1,14 @@ -/*========================================================================= +/*============================================================================ + KWSys - Kitware System Library + Copyright 2000-2009 Kitware, Inc., Insight Software Consortium - Program: KWSys - Kitware System Library - Module: testTerminal.c + Distributed under the OSI-approved BSD License (the "License"); + see accompanying file Copyright.txt for details. - Copyright (c) Kitware, Inc., Insight Consortium. All rights reserved. - See Copyright.txt or http://www.kitware.com/Copyright.htm for details. - - This software is distributed WITHOUT ANY WARRANTY; without even - the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR - PURPOSE. See the above copyright notices for more information. - -=========================================================================*/ + 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. +============================================================================*/ #include "kwsysPrivate.h" #include KWSYS_HEADER(Terminal.h) diff --git a/GCC_XML/Support/GCC/3.2/bits/gthr-default.h b/GCC_XML/Support/GCC/3.2/bits/gthr-default.h new file mode 100644 index 0000000..5190041 --- /dev/null +++ b/GCC_XML/Support/GCC/3.2/bits/gthr-default.h @@ -0,0 +1,585 @@ +#if defined(__MINGW32__) +# include_next +#else +/* Threads compatibility routines for libgcc2 and libobjc. */ +/* Compile this one with gcc. */ +/* Copyright (C) 1997, 1999, 2000, 2001 Free Software Foundation, Inc. + +This file is part of GCC. + +GCC is free software; you can redistribute it and/or modify it under +the terms of the GNU General Public License as published by the Free +Software Foundation; either version 2, or (at your option) any later +version. + +GCC is distributed in the hope that it will be useful, but WITHOUT ANY +WARRANTY; without even the implied warranty of MERCHANTABILITY or +FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +for more details. + +You should have received a copy of the GNU General Public License +along with GCC; see the file COPYING. If not, write to the Free +Software Foundation, 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. */ + +/* As a special exception, if you link this library with other files, + some of which are compiled with GCC, to produce an executable, + this library does not by itself cause the resulting executable + to be covered by the GNU General Public License. + This exception does not however invalidate any other reasons why + the executable file might be covered by the GNU General Public License. */ + +#ifndef _GLIBCPP_GCC_GTHR_POSIX_H +#define _GLIBCPP_GCC_GTHR_POSIX_H + +/* POSIX threads specific definitions. + Easy, since the interface is just one-to-one mapping. */ + +#define __GTHREADS 1 + +#include + +typedef pthread_key_t __gthread_key_t; +typedef pthread_once_t __gthread_once_t; +typedef pthread_mutex_t __gthread_mutex_t; + +#define __GTHREAD_MUTEX_INIT PTHREAD_MUTEX_INITIALIZER +#define __GTHREAD_ONCE_INIT PTHREAD_ONCE_INIT + +#if _GLIBCPP_SUPPORTS_WEAK && _GLIBCPP_GTHREAD_USE_WEAK && defined __GNUC_RH_RELEASE__ && __GNUC__ == 3 && __GNUC_MINOR__ == 2 && __GNUC_PATCHLEVEL__ == 3 && __GNUC_RH_RELEASE__ > 53 && !defined __attribute__ +# define __gthrw(name) \ + extern __typeof(name) __gthrw_ ## name + +__gthrw(pthread_once); +__gthrw(pthread_key_create); +__gthrw(pthread_key_delete); +__gthrw(pthread_getspecific); +__gthrw(pthread_setspecific); +__gthrw(pthread_create); + +__gthrw(pthread_mutex_lock ); +__gthrw(pthread_mutex_trylock ); +__gthrw(pthread_mutex_unlock ); + +#ifdef _LIBOBJC +/* Objective C. */ +__gthrw(pthread_cond_broadcast); +__gthrw(pthread_cond_destroy); +__gthrw(pthread_cond_init); +__gthrw(pthread_cond_signal); +__gthrw(pthread_cond_wait); +__gthrw(pthread_exit); +__gthrw(pthread_mutex_init); +__gthrw(pthread_mutex_destroy); +__gthrw(pthread_self); +__gthrw(sched_get_priority_max); +__gthrw(sched_get_priority_min); +__gthrw(sched_yield); +__gthrw(pthread_attr_destroy); +__gthrw(pthread_attr_init); +__gthrw(pthread_attr_setdetachstate); +__gthrw(pthread_getschedparam); +__gthrw(pthread_setschedparam); +#endif +#else +#if _GLIBCPP_SUPPORTS_WEAK && _GLIBCPP_GTHREAD_USE_WEAK + +#pragma weak pthread_once +#pragma weak pthread_key_create +#pragma weak pthread_key_delete +#pragma weak pthread_getspecific +#pragma weak pthread_setspecific +#pragma weak pthread_create + +#pragma weak pthread_mutex_lock +#pragma weak pthread_mutex_trylock +#pragma weak pthread_mutex_unlock + +#ifdef _LIBOBJC +/* Objective C. */ +#pragma weak pthread_cond_broadcast +#pragma weak pthread_cond_destroy +#pragma weak pthread_cond_init +#pragma weak pthread_cond_signal +#pragma weak pthread_cond_wait +#pragma weak pthread_exit +#pragma weak pthread_mutex_init +#pragma weak pthread_mutex_destroy +#pragma weak pthread_self +#pragma weak sched_get_priority_max +#pragma weak sched_get_priority_min +#pragma weak sched_yield +#pragma weak pthread_attr_destroy +#pragma weak pthread_attr_init +#pragma weak pthread_attr_setdetachstate +#pragma weak pthread_getschedparam +#pragma weak pthread_setschedparam +#endif +#endif + +#define __gthrw_pthread_once pthread_once +#define __gthrw_pthread_key_create pthread_key_create +#define __gthrw_pthread_key_delete pthread_key_delete +#define __gthrw_pthread_getspecific pthread_getspecific +#define __gthrw_pthread_setspecific pthread_setspecific +#define __gthrw_pthread_create pthread_create + +#define __gthrw_pthread_mutex_lock pthread_mutex_lock +#define __gthrw_pthread_mutex_trylock pthread_mutex_trylock +#define __gthrw_pthread_mutex_unlock pthread_mutex_unlock + +#ifdef _LIBOBJC +/* Objective C. */ +#define __gthrw_pthread_cond_broadcast pthread_cond_broadcast +#define __gthrw_pthread_cond_destroy pthread_cond_destroy +#define __gthrw_pthread_cond_init pthread_cond_init +#define __gthrw_pthread_cond_signal pthread_cond_signal +#define __gthrw_pthread_cond_wait pthread_cond_wait +#define __gthrw_pthread_exit pthread_exit +#define __gthrw_pthread_mutex_init pthread_mutex_init +#define __gthrw_pthread_mutex_destroy pthread_mutex_destroy +#define __gthrw_pthread_self pthread_self +#define __gthrw_sched_get_priority_max sched_get_priority_max +#define __gthrw_sched_get_priority_min sched_get_priority_min +#define __gthrw_sched_yield sched_yield +#define __gthrw_pthread_attr_destroy pthread_attr_destroy +#define __gthrw_pthread_attr_init pthread_attr_init +#define __gthrw_pthread_attr_setdetachstate pthread_attr_setdetachstate +#define __gthrw_pthread_getschedparam pthread_getschedparam +#define __gthrw_pthread_setschedparam pthread_setschedparam +#endif +#endif + +#if _GLIBCPP_SUPPORTS_WEAK && _GLIBCPP_GTHREAD_USE_WEAK + +static inline int +__gthread_active_p (void) +{ + static void *const __gthread_active_ptr = (void *) &__gthrw_pthread_create; + return __gthread_active_ptr != 0; +} + +#else /* not _GLIBCPP_SUPPORTS_WEAK */ + +static inline int +__gthread_active_p (void) +{ + return 1; +} + +#endif /* _GLIBCPP_SUPPORTS_WEAK */ + +#ifdef _LIBOBJC + +/* This is the config.h file in libobjc/ */ +#include + +#ifdef HAVE_SCHED_H +# include +#endif + +/* Key structure for maintaining thread specific storage */ +static pthread_key_t _objc_thread_storage; +static pthread_attr_t _objc_thread_attribs; + +/* Thread local storage for a single thread */ +static void *thread_local_storage = NULL; + +/* Backend initialization functions */ + +/* Initialize the threads subsystem. */ +static inline int +__gthread_objc_init_thread_system(void) +{ + if (__gthread_active_p ()) + { + /* Initialize the thread storage key */ + if (__gthrw_pthread_key_create(&_objc_thread_storage, NULL) == 0) + { + /* The normal default detach state for threads is + * PTHREAD_CREATE_JOINABLE which causes threads to not die + * when you think they should. */ + if (__gthrw_pthread_attr_init(&_objc_thread_attribs) == 0 + && __gthrw_pthread_attr_setdetachstate(&_objc_thread_attribs, + PTHREAD_CREATE_DETACHED) == 0) + return 0; + } + } + + return -1; +} + +/* Close the threads subsystem. */ +static inline int +__gthread_objc_close_thread_system(void) +{ + if (__gthread_active_p () + && __gthrw_pthread_key_delete(_objc_thread_storage) == 0 + && __gthrw_pthread_attr_destroy(&_objc_thread_attribs) == 0) + return 0; + + return -1; +} + +/* Backend thread functions */ + +/* Create a new thread of execution. */ +static inline objc_thread_t +__gthread_objc_thread_detach(void (*func)(void *), void *arg) +{ + objc_thread_t thread_id; + pthread_t new_thread_handle; + + if (!__gthread_active_p ()) + return NULL; + + if ( !(__gthrw_pthread_create(&new_thread_handle, NULL, (void *)func, arg)) ) + thread_id = (objc_thread_t) new_thread_handle; + else + thread_id = NULL; + + return thread_id; +} + +/* Set the current thread's priority. */ +static inline int +__gthread_objc_thread_set_priority(int priority) +{ + if (!__gthread_active_p()) + return -1; + else { + pthread_t thread_id = __gthrw_pthread_self(); + int policy; + struct sched_param params; + int priority_min, priority_max; + + if (__gthrw_pthread_getschedparam(thread_id, &policy, ¶ms) == 0) + { + if ((priority_max = __gthrw_sched_get_priority_max(policy)) != 0) + return -1; + + if ((priority_min = __gthrw_sched_get_priority_min(policy)) != 0) + return -1; + + if (priority > priority_max) + priority = priority_max; + else if (priority < priority_min) + priority = priority_min; + params.sched_priority = priority; + + /* + * The solaris 7 and several other man pages incorrectly state that + * this should be a pointer to policy but pthread.h is universally + * at odds with this. + */ + if (__gthrw_pthread_setschedparam(thread_id, policy, ¶ms) == 0) + return 0; + } + return -1; + } +} + +/* Return the current thread's priority. */ +static inline int +__gthread_objc_thread_get_priority(void) +{ + if (__gthread_active_p ()) + { + int policy; + struct sched_param params; + + if (__gthrw_pthread_getschedparam(__gthrw_pthread_self(), &policy, ¶ms) == 0) + return params.sched_priority; + else + return -1; + } + else + return OBJC_THREAD_INTERACTIVE_PRIORITY; +} + +/* Yield our process time to another thread. */ +static inline void +__gthread_objc_thread_yield(void) +{ + if (__gthread_active_p ()) + __gthrw_sched_yield(); +} + +/* Terminate the current thread. */ +static inline int +__gthread_objc_thread_exit(void) +{ + if (__gthread_active_p ()) + /* exit the thread */ + __gthrw_pthread_exit(&__objc_thread_exit_status); + + /* Failed if we reached here */ + return -1; +} + +/* Returns an integer value which uniquely describes a thread. */ +static inline objc_thread_t +__gthread_objc_thread_id(void) +{ + if (__gthread_active_p ()) + return (objc_thread_t) __gthrw_pthread_self(); + else + return (objc_thread_t) 1; +} + +/* Sets the thread's local storage pointer. */ +static inline int +__gthread_objc_thread_set_data(void *value) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_setspecific(_objc_thread_storage, value); + else + { + thread_local_storage = value; + return 0; + } +} + +/* Returns the thread's local storage pointer. */ +static inline void * +__gthread_objc_thread_get_data(void) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_getspecific(_objc_thread_storage); + else + return thread_local_storage; +} + +/* Backend mutex functions */ + +/* Allocate a mutex. */ +static inline int +__gthread_objc_mutex_allocate(objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + { + mutex->backend = objc_malloc(sizeof(pthread_mutex_t)); + + if (__gthrw_pthread_mutex_init((pthread_mutex_t *)mutex->backend, NULL)) + { + objc_free(mutex->backend); + mutex->backend = NULL; + return -1; + } + } + + return 0; +} + +/* Deallocate a mutex. */ +static inline int +__gthread_objc_mutex_deallocate(objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + { + int count; + + /* + * Posix Threads specifically require that the thread be unlocked + * for __gthrw_pthread_mutex_destroy to work. + */ + + do + { + count = __gthrw_pthread_mutex_unlock((pthread_mutex_t *)mutex->backend); + if (count < 0) + return -1; + } + while (count); + + if (__gthrw_pthread_mutex_destroy((pthread_mutex_t *)mutex->backend)) + return -1; + + objc_free(mutex->backend); + mutex->backend = NULL; + } + return 0; +} + +/* Grab a lock on a mutex. */ +static inline int +__gthread_objc_mutex_lock(objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_lock((pthread_mutex_t *)mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Try to grab a lock on a mutex. */ +static inline int +__gthread_objc_mutex_trylock(objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_trylock((pthread_mutex_t *)mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Unlock the mutex */ +static inline int +__gthread_objc_mutex_unlock(objc_mutex_t mutex) +{ + if (__gthread_active_p () + && __gthrw_pthread_mutex_unlock((pthread_mutex_t *)mutex->backend) != 0) + { + return -1; + } + + return 0; +} + +/* Backend condition mutex functions */ + +/* Allocate a condition. */ +static inline int +__gthread_objc_condition_allocate(objc_condition_t condition) +{ + if (__gthread_active_p ()) + { + condition->backend = objc_malloc(sizeof(pthread_cond_t)); + + if (__gthrw_pthread_cond_init((pthread_cond_t *)condition->backend, NULL)) + { + objc_free(condition->backend); + condition->backend = NULL; + return -1; + } + } + + return 0; +} + +/* Deallocate a condition. */ +static inline int +__gthread_objc_condition_deallocate(objc_condition_t condition) +{ + if (__gthread_active_p ()) + { + if (__gthrw_pthread_cond_destroy((pthread_cond_t *)condition->backend)) + return -1; + + objc_free(condition->backend); + condition->backend = NULL; + } + return 0; +} + +/* Wait on the condition */ +static inline int +__gthread_objc_condition_wait(objc_condition_t condition, objc_mutex_t mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_wait((pthread_cond_t *)condition->backend, + (pthread_mutex_t *)mutex->backend); + else + return 0; +} + +/* Wake up all threads waiting on this condition. */ +static inline int +__gthread_objc_condition_broadcast(objc_condition_t condition) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_broadcast((pthread_cond_t *)condition->backend); + else + return 0; +} + +/* Wake up one thread waiting on this condition. */ +static inline int +__gthread_objc_condition_signal(objc_condition_t condition) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_cond_signal((pthread_cond_t *)condition->backend); + else + return 0; +} + +#else /* _LIBOBJC */ + +static inline int +__gthread_once (__gthread_once_t *once, void (*func) (void)) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_once (once, func); + else + return -1; +} + +static inline int +__gthread_key_create (__gthread_key_t *key, void (*dtor) (void *)) +{ + return __gthrw_pthread_key_create (key, dtor); +} + +static inline int +__gthread_key_dtor (__gthread_key_t key, void *ptr) +{ + /* Just reset the key value to zero. */ + if (ptr) + return __gthrw_pthread_setspecific (key, 0); + else + return 0; +} + +static inline int +__gthread_key_delete (__gthread_key_t key) +{ + return __gthrw_pthread_key_delete (key); +} + +static inline void * +__gthread_getspecific (__gthread_key_t key) +{ + return __gthrw_pthread_getspecific (key); +} + +static inline int +__gthread_setspecific (__gthread_key_t key, const void *ptr) +{ + return __gthrw_pthread_setspecific (key, ptr); +} + +static inline int +__gthread_mutex_lock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_lock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_trylock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_trylock (mutex); + else + return 0; +} + +static inline int +__gthread_mutex_unlock (__gthread_mutex_t *mutex) +{ + if (__gthread_active_p ()) + return __gthrw_pthread_mutex_unlock (mutex); + else + return 0; +} + +#endif /* _LIBOBJC */ + +#endif /* ! _GLIBCPP_GCC_GTHR_POSIX_H */ +#endif diff --git a/GCC_XML/Support/GCC/3.4/bits/gthr-default.h b/GCC_XML/Support/GCC/3.4/bits/gthr-default.h index d543a90..f97c9b3 100644 --- a/GCC_XML/Support/GCC/3.4/bits/gthr-default.h +++ b/GCC_XML/Support/GCC/3.4/bits/gthr-default.h @@ -1,3 +1,6 @@ +#if defined(__MINGW32__) +# include_next +#else /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ /* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003 @@ -662,3 +665,5 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) #endif /* _LIBOBJC */ #endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ +#endif + diff --git a/GCC_XML/Support/GCC/4.1/bits/gthr-default.h b/GCC_XML/Support/GCC/4.1/bits/gthr-default.h index 57142e5..b889492 100644 --- a/GCC_XML/Support/GCC/4.1/bits/gthr-default.h +++ b/GCC_XML/Support/GCC/4.1/bits/gthr-default.h @@ -1,3 +1,6 @@ +#if defined(__MINGW32__) +# include_next +#else /* Threads compatibility routines for libgcc2 and libobjc. */ /* Compile this one with gcc. */ /* Copyright (C) 1997, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007 @@ -616,3 +619,4 @@ __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *mutex) #endif /* _LIBOBJC */ #endif /* ! _GLIBCXX_GCC_GTHR_POSIX_H */ +#endif diff --git a/GCC_XML/Support/GCC/4.4/gccxml_builtins.h b/GCC_XML/Support/GCC/4.4/gccxml_builtins.h new file mode 100644 index 0000000..9167fde --- /dev/null +++ b/GCC_XML/Support/GCC/4.4/gccxml_builtins.h @@ -0,0 +1,152 @@ +#define __builtin_apply(x,y,z) ((void*)0) +#define __builtin_nan(x) (0.0) +#define __builtin_nanf(x) (0.0f) +#define __builtin_nanl(x) (0.0l) +#define __builtin_huge_val(x) (0.0) +#define __builtin_huge_valf(x) (0.0f) +#define __builtin_huge_vall(x) (0.0l) +#define __builtin_apply_args(x) ((void*)0) +#define __builtin_types_compatible_p(x,y) 0 +#define __builtin_choose_expr(x,y,z) int +#define __builtin_constant_p(x) 0 +void* __builtin_memchr(void const*, int, unsigned int); +void __builtin_return (void *RESULT); +void * __builtin_return_address (unsigned int LEVEL); +void * __builtin_frame_address (unsigned int LEVEL); +long __builtin_expect (long EXP, long C); +void __builtin_prefetch (const void *ADDR, ...); +double __builtin_inf (void); +float __builtin_inff (void); +long double __builtin_infl (void); +double __builtin_nans (const char *str); +float __builtin_nansf (const char *str); +long double __builtin_nansl (const char *str); +double __builtin_acos(double); +float __builtin_acosf(float); +long double __builtin_acosl(long double); +double __builtin_asin(double); +float __builtin_asinf(float); +long double __builtin_asinl(long double); +double __builtin_atan(double); +double __builtin_atan2(double, double); +float __builtin_atan2f(float, float); +long double __builtin_atan2l(long double, long double); +float __builtin_atanf(float); +long double __builtin_atanl(long double); +double __builtin_ceil(double); +float __builtin_ceilf(float); +long double __builtin_ceill(long double); +double __builtin_cos(double); +float __builtin_cosf(float); +double __builtin_cosh(double); +float __builtin_coshf(float); +long double __builtin_coshl(long double); +long double __builtin_cosl(long double); +double __builtin_exp(double); +float __builtin_expf(float); +long double __builtin_expl(long double); +double __builtin_fabs(double); +float __builtin_fabsf(float); +long double __builtin_fabsl(long double); +double __builtin_floor(double); +float __builtin_floorf(float); +long double __builtin_floorl(long double); +float __builtin_fmodf(float, float); +long double __builtin_fmodl(long double, long double); +double __builtin_frexp(double, int*); +float __builtin_frexpf(float, int*); +long double __builtin_frexpl(long double, int*); +double __builtin_ldexp(double, int); +float __builtin_ldexpf(float, int); +long double __builtin_ldexpl(long double, int); +double __builtin_log(double); +double __builtin_log10(double); +float __builtin_log10f(float); +long double __builtin_log10l(long double); +float __builtin_logf(float); +long double __builtin_logl(long double); +float __builtin_modff(float, float*); +long double __builtin_modfl(long double, long double*); +float __builtin_powf(float, float); +long double __builtin_powl(long double, long double); +double __builtin_powi(double, int); +float __builtin_powif(float, int); +long double __builtin_powil(long double, int); +double __builtin_sin(double); +float __builtin_sinf(float); +double __builtin_sinh(double); +float __builtin_sinhf(float); +long double __builtin_sinhl(long double); +long double __builtin_sinl(long double); +double __builtin_sqrt(double); +float __builtin_sqrtf(float); +long double __builtin_sqrtl(long double); +double __builtin_tan(double); +float __builtin_tanf(float); +double __builtin_tanh(double); +float __builtin_tanhf(float); +long double __builtin_tanhl(long double); +long double __builtin_tanl(long double); +float __builtin_cabsf(float __complex__); +double __builtin_cabs(double __complex__); +long double __builtin_cabsl(long double __complex__); +float __builtin_cargf(float __complex__); +double __builtin_carg(double __complex__); +long double __builtin_cargl(long double __complex__); +int __builtin_ctz(int); +int __builtin_ctzl(long); +int __builtin_ctzll(long long); +int __builtin_popcount(int); +int __builtin_popcountl(long); +int __builtin_popcountll(long long); +float __complex__ __builtin_ccosf(float __complex__); +double __complex__ __builtin_ccos(double __complex__); +long double __complex__ __builtin_ccosl(long double __complex__); +float __complex__ __builtin_ccoshf(float __complex__); +double __complex__ __builtin_ccosh(double __complex__); +long double __complex__ __builtin_ccoshl(long double __complex__); +float __complex__ __builtin_cexpf(float __complex__); +double __complex__ __builtin_cexp(double __complex__); +long double __complex__ __builtin_cexpl(long double __complex__); +float __complex__ __builtin_clogf(float __complex__); +double __complex__ __builtin_clog(double __complex__); +long double __complex__ __builtin_clogl(long double __complex__); +float __complex__ __builtin_csinf(float __complex__); +double __complex__ __builtin_csin(double __complex__); +long double __complex__ __builtin_csinl(long double __complex__); +float __complex__ __builtin_csinhf(float __complex__); +double __complex__ __builtin_csinh(double __complex__); +long double __complex__ __builtin_csinhl(long double __complex__); +float __complex__ __builtin_csqrtf(float __complex__); +double __complex__ __builtin_csqrt(double __complex__); +long double __complex__ __builtin_csqrtl(long double __complex__); +float __complex__ __builtin_ctanf(float __complex__); +double __complex__ __builtin_ctan(double __complex__); +long double __complex__ __builtin_ctanl(long double __complex__); +float __complex__ __builtin_ctanhf(float __complex__); +double __complex__ __builtin_ctanh(double __complex__); +long double __complex__ __builtin_ctanhl(long double __complex__); +float __complex__ __builtin_cpowf(float __complex__, float __complex__); +double __complex__ __builtin_cpow(double __complex__, double __complex__); +long double __complex__ __builtin_cpowl(long double __complex__, long double __complex__); + +/* The GCC 4.4 parser hard-codes handling of these, so they do not + have real signatures. */ +bool __builtin_fpclassify(...); +bool __builtin_isfinite(...); +bool __builtin_isgreater(...); +bool __builtin_isgreaterequal(...); +bool __builtin_isinf(...); +bool __builtin_isinf_sign(...); +bool __builtin_isless(...); +bool __builtin_islessequal(...); +bool __builtin_islessgreater(...); +bool __builtin_isnan(...); +bool __builtin_isnormal(...); +bool __builtin_isunordered(...); +bool __builtin_va_arg_pack(...); + +/* We fake some constant expressions from GCC 4.4 parser. */ +#define __is_pod(x) false +#define __is_empty(x) false +#define __has_trivial_destructor(x) false diff --git a/GCC_XML/Support/MIPSpro/find_flags b/GCC_XML/Support/MIPSpro/find_flags index 06a9d2d..80497c8 100755 --- a/GCC_XML/Support/MIPSpro/find_flags +++ b/GCC_XML/Support/MIPSpro/find_flags @@ -27,83 +27,18 @@ else CXXFLAGS="$@" fi -GCCXML_PID="$$" -TESTFILE="find_flags_temp$GCCXML_PID" +SELFDIR=`cd "\`dirname \"$0\"\`";pwd` -# Construct a test input file that checks for some builtin definitions -# in the compiler that are not displayed by the -v option. This list -# was obtained by running "strings /usr/lib32/cmplrs/fecc" and testing -# for definitions with a giant version of the string below. -echo " -#ifdef _BOOL -D_BOOL _BOOL -#endif -#ifdef _EXPLICIT_IS_KEYWORD -D_EXPLICIT_IS_KEYWORD _EXPLICIT_IS_KEYWORD -#endif -#ifdef _LIBC_IN_NAMESPACE_STD_ -D_LIBC_IN_NAMESPACE_STD_ _LIBC_IN_NAMESPACE_STD_ -#endif -#ifdef _MEMBER_TEMPLATES -D_MEMBER_TEMPLATES _MEMBER_TEMPLATES -#endif -#ifdef _MUTABLE_IS_KEYWORD -D_MUTABLE_IS_KEYWORD _MUTABLE_IS_KEYWORD -#endif -#ifdef _NAMESPACES -D_NAMESPACES _NAMESPACES -#endif -#ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES -D_PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES -#endif -#ifdef _STANDARD_C_PLUS_PLUS -D_STANDARD_C_PLUS_PLUS _STANDARD_C_PLUS_PLUS -#endif -#ifdef _TYPENAME_IS_KEYWORD -D_TYPENAME_IS_KEYWORD _TYPENAME_IS_KEYWORD -#endif -#ifdef _WCHAR_T -D_WCHAR_T _WCHAR_T -#endif -#ifdef _WCHAR_T_IS_KEYWORD -D_WCHAR_T_IS_KEYWORD _WCHAR_T_IS_KEYWORD -#endif -#ifdef __ANSI_CPP__ -D__ANSI_CPP__ __ANSI_CPP__ -#endif -#ifdef __ARRAY_OPERATORS -D__ARRAY_OPERATORS __ARRAY_OPERATORS -#endif -#ifdef __EDG_ABI_COMPATIBILITY_VERSION -D__EDG_ABI_COMPATIBILITY_VERSION __EDG_ABI_COMPATIBILITY_VERSION -#endif -#ifdef __EDG_RUNTIME_USES_NAMESPACES -D__EDG_RUNTIME_USES_NAMESPACES __EDG_RUNTIME_USES_NAMESPACES -#endif -#ifdef __EDG_VERSION__ -D__EDG_VERSION__ __EDG_VERSION__ -#endif -#ifdef __EDG__ -D__EDG__ __EDG__ -#endif -#ifdef __EXCEPTIONS -D__EXCEPTIONS __EXCEPTIONS -#endif -#ifdef __LIBC_MATH_OVERLOAD__ -D__LIBC_MATH_OVERLOAD__ __LIBC_MATH_OVERLOAD__ -#endif -#ifdef __RTTI -D__RTTI __RTTI -#endif -#ifdef __STDC__ -D__STDC__ __STDC__ -#endif -" > /tmp/$TESTFILE.cxx +# This test input file checks for some builtin definitions in the +# compiler that are not displayed by the -v option. Its list was +# obtained by running "strings /usr/lib32/cmplrs/fecc" and testing for +# definitions with a giant version of the string below. +DEFS_FILE="${SELFDIR}/mipspro_defs.cxx" # Find the macro definition options. MACROS=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | -sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// +${CXX} ${CXXFLAGS} -E -v "${DEFS_FILE}" 2>&1 | +sed -n '/_COMPILER_VERSION/{s| '"${DEFS_FILE}"'.*$|| s/ -/\\ -/g;p;}' | sed -n '/^-D.*$/{s/-D\([^=]*\)=\([^ ]\{1,\} .*\)/-D\1='\''\2'\''/;p;}' | @@ -111,14 +46,14 @@ sed -n 'H;${g;s/\n/ /g;p;}'` # Find the internally defined macros. LANGSTD=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | +${CXX} ${CXXFLAGS} -E -v "${DEFS_FILE}" 2>&1 | sed -n '/^D/ {s/^D/-D/;s/ /=/;p;}' | sed -n 'H;${g;s/\n/ /g;p;}'` # Find the include path options. INCLUDES=` -${CXX} ${CXXFLAGS} -E -v /tmp/$TESTFILE.cxx 2>&1 | -sed -n '/_COMPILER_VERSION/{s/ \/tmp\/'$TESTFILE'.cxx.*$// +${CXX} ${CXXFLAGS} -E -v "${DEFS_FILE}" 2>&1 | +sed -n '/_COMPILER_VERSION/{s| '"${DEFS_FILE}"'.*$|| s/ -/\\ -/g;p;}' | sed -n '/^-I.*$/{p;}' | @@ -130,8 +65,6 @@ if test "x$SELFPATH" = "x" ; then SELFPATH="." ; fi SELFPATH=`cd "$SELFPATH" ; pwd` INCLUDES="-iwrapper\"$SELFPATH/7.3\" $INCLUDES" -rm -f /tmp/$TESTFILE.cxx - # Format and print out the options. OPTIONS="$MACROS $LANGSTD $INCLUDES" echo $OPTIONS diff --git a/GCC_XML/Support/MIPSpro/mipspro_defs.cxx b/GCC_XML/Support/MIPSpro/mipspro_defs.cxx new file mode 100644 index 0000000..14a34bc --- /dev/null +++ b/GCC_XML/Support/MIPSpro/mipspro_defs.cxx @@ -0,0 +1,63 @@ +#ifdef _BOOL +D_BOOL _BOOL +#endif +#ifdef _EXPLICIT_IS_KEYWORD +D_EXPLICIT_IS_KEYWORD _EXPLICIT_IS_KEYWORD +#endif +#ifdef _LIBC_IN_NAMESPACE_STD_ +D_LIBC_IN_NAMESPACE_STD_ _LIBC_IN_NAMESPACE_STD_ +#endif +#ifdef _MEMBER_TEMPLATES +D_MEMBER_TEMPLATES _MEMBER_TEMPLATES +#endif +#ifdef _MUTABLE_IS_KEYWORD +D_MUTABLE_IS_KEYWORD _MUTABLE_IS_KEYWORD +#endif +#ifdef _NAMESPACES +D_NAMESPACES _NAMESPACES +#endif +#ifdef _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES +D_PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES _PARTIAL_SPECIALIZATION_OF_CLASS_TEMPLATES +#endif +#ifdef _STANDARD_C_PLUS_PLUS +D_STANDARD_C_PLUS_PLUS _STANDARD_C_PLUS_PLUS +#endif +#ifdef _TYPENAME_IS_KEYWORD +D_TYPENAME_IS_KEYWORD _TYPENAME_IS_KEYWORD +#endif +#ifdef _WCHAR_T +D_WCHAR_T _WCHAR_T +#endif +#ifdef _WCHAR_T_IS_KEYWORD +D_WCHAR_T_IS_KEYWORD _WCHAR_T_IS_KEYWORD +#endif +#ifdef __ANSI_CPP__ +D__ANSI_CPP__ __ANSI_CPP__ +#endif +#ifdef __ARRAY_OPERATORS +D__ARRAY_OPERATORS __ARRAY_OPERATORS +#endif +#ifdef __EDG_ABI_COMPATIBILITY_VERSION +D__EDG_ABI_COMPATIBILITY_VERSION __EDG_ABI_COMPATIBILITY_VERSION +#endif +#ifdef __EDG_RUNTIME_USES_NAMESPACES +D__EDG_RUNTIME_USES_NAMESPACES __EDG_RUNTIME_USES_NAMESPACES +#endif +#ifdef __EDG_VERSION__ +D__EDG_VERSION__ __EDG_VERSION__ +#endif +#ifdef __EDG__ +D__EDG__ __EDG__ +#endif +#ifdef __EXCEPTIONS +D__EXCEPTIONS __EXCEPTIONS +#endif +#ifdef __LIBC_MATH_OVERLOAD__ +D__LIBC_MATH_OVERLOAD__ __LIBC_MATH_OVERLOAD__ +#endif +#ifdef __RTTI +D__RTTI __RTTI +#endif +#ifdef __STDC__ +D__STDC__ __STDC__ +#endif diff --git a/GCC_XML/VcInstall/vcInstall.cxx b/GCC_XML/VcInstall/vcInstall.cxx index 47c07a7..2d65aea 100644 --- a/GCC_XML/VcInstall/vcInstall.cxx +++ b/GCC_XML/VcInstall/vcInstall.cxx @@ -64,11 +64,11 @@ int main(int argc, char* argv[]) "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\" "DevStudio\\6.0\\Products\\Microsoft Visual C++;ProductDir"; const char* vc7Registry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0;InstallDir"; + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.0\\Setup\\VC;ProductDir"; const char* vc71Registry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1;InstallDir"; + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\7.1\\Setup\\VC;ProductDir"; const char* vc8Registry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0;InstallDir"; + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\Setup\\VC;ProductDir"; const char* vc8sp1Registry[] = { // English SP1 @@ -78,7 +78,7 @@ int main(int argc, char* argv[]) 0 }; const char* vc8exRegistry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\8.0;InstallDir"; + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\8.0\\Setup\\VC;ProductDir"; const char* vc8exSP1Registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\8.0\\InstalledProducts\\KB926748;"; const char* vc8sdkRegistry = @@ -86,8 +86,7 @@ int main(int argc, char* argv[]) const char* vc8sdk2Registry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\MicrosoftSDK\\InstalledSDKs\\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1;Install Dir"; const char* vc9Registry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0;InstallDir"; - //"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VisualStudio\\9.0;InstallDir"; // _WIN64 ? + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VisualStudio\\9.0\\Setup\\VC;ProductDir"; const char* vc9sp1Registry[] = { // English SP1 @@ -95,8 +94,7 @@ int main(int argc, char* argv[]) 0 }; const char* vc9exRegistry = - "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0;InstallDir"; - //"HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Microsoft\\VCExpress\\9.0;InstallDir"; // _WIN64 ? + "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\VCExpress\\9.0\\Setup\\VC;ProductDir"; const char* vc9sdkRegistry = "HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Microsoft SDKs\\Windows\\v6.0A;InstallationFolder"; // Check which versions of MSVC are installed. @@ -205,8 +203,8 @@ int main(int argc, char* argv[]) if(have7) { - std::string msvc7i = msvc7 + "/../../Vc7/Include"; - std::string msvc7p = msvc7 + "/../../Vc7/PlatformSDK/Include"; + std::string msvc7i = msvc7 + "/Include"; + std::string msvc7p = msvc7 + "/PlatformSDK/Include"; msvc7i = gxSystemTools::CollapseDirectory(msvc7i.c_str()); msvc7p = gxSystemTools::CollapseDirectory(msvc7p.c_str()); std::string patchI = patchDir + "/vc7Include.patch"; @@ -242,8 +240,8 @@ int main(int argc, char* argv[]) } if(have71) { - std::string msvc71i = msvc71 + "/../../Vc7/Include"; - std::string msvc71p = msvc71 + "/../../Vc7/PlatformSDK/Include"; + std::string msvc71i = msvc71 + "/Include"; + std::string msvc71p = msvc71 + "/PlatformSDK/Include"; msvc71i = gxSystemTools::CollapseDirectory(msvc71i.c_str()); msvc71p = gxSystemTools::CollapseDirectory(msvc71p.c_str()); std::string patchI = patchDir + "/vc71Include.patch"; @@ -279,8 +277,8 @@ int main(int argc, char* argv[]) } if(have8) { - std::string msvc8i = msvc8 + "/../../Vc/Include"; - std::string msvc8p = msvc8 + "/../../Vc/PlatformSDK/Include"; + std::string msvc8i = msvc8 + "/Include"; + std::string msvc8p = msvc8 + "/PlatformSDK/Include"; msvc8i = gxSystemTools::CollapseDirectory(msvc8i.c_str()); msvc8p = gxSystemTools::CollapseDirectory(msvc8p.c_str()); std::string patchIname = "vc8Include.patch"; @@ -332,7 +330,7 @@ int main(int argc, char* argv[]) if(have8ex) { - std::string msvc8i = msvc8ex + "/../../Vc/Include"; + std::string msvc8i = msvc8ex + "/Include"; msvc8i = gxSystemTools::CollapseDirectory(msvc8i.c_str()); std::string patchIname = "vc8ExpressInclude.patch"; std::string destPathI = gccxmlRoot+"/Vc8ex/Include"; @@ -385,7 +383,7 @@ int main(int argc, char* argv[]) if(have9) { - std::string msvc9i = msvc9 + "/../../Vc/Include"; + std::string msvc9i = msvc9 + "/Include"; msvc9i = gxSystemTools::CollapseDirectory(msvc9i.c_str()); std::string patchIname = "vc9Include.patch"; std::string destPathI = gccxmlRoot+"/Vc9/Include";