diff --git a/GCC/gcc/config/i386/winnt-cxx.c b/GCC/gcc/config/i386/winnt-cxx.c index efe29b6..121c155 100644 --- a/GCC/gcc/config/i386/winnt-cxx.c +++ b/GCC/gcc/config/i386/winnt-cxx.c @@ -117,8 +117,28 @@ i386_pe_type_dllexport_p (tree decl) static inline void maybe_add_dllimport (tree decl) { +/* BEGIN GCC-XML MODIFICATIONS 2009-04-24 */ +/* Somehow dllimport ends up on the VAR_DECL for the 'B' vtable: + + class A {}; + struct __attribute__((dllimport)) B: virtual public A { ~B() {} }; + + Then 'maybe_emit_vtables' calls 'store_init_value' which eventually + calls 'initializer_constant_valid_p' and 'staticp'. The + DECL_DLLIMPORT_P mark requires runtime initialization of the + vtable, which is not allowed, and results in an ICE. + + There is code in "class.c" which removes the dllimport attribute + but it never seems to be called for the vtable VAR_DECL. We + workaround the problem for gccxml by disabling the mark altogether, + as it seems to be used only for code generation. */ +#if 0 if (i386_pe_type_dllimport_p (decl)) DECL_DLLIMPORT_P (decl) = 1; +#else + (void)decl; +#endif +/* END GCC-XML MODIFICATIONS 2009-04-24 */ } void diff --git a/GCC/gcc/cp/decl2.c b/GCC/gcc/cp/decl2.c index e7d5ea4..26f9909 100644 --- a/GCC/gcc/cp/decl2.c +++ b/GCC/gcc/cp/decl2.c @@ -1159,13 +1159,13 @@ coerce_new_type (tree type) e = 2; if (args && args != void_list_node) args = TREE_CHAIN (args); -/* BEGIN GCC-XML MODIFICATIONS (2009/03/02 14:29:19) */ +/* BEGIN GCC-XML MODIFICATIONS (2009/03/03 16:31:15) */ /* Ignore whether the native compiler breaks the operator new signature. */ #if 0 pedwarn ("% takes type % (%qT) " "as first parameter", size_type_node); #endif -/* END GCC-XML MODIFICATIONS (2009/03/02 14:29:19) */ +/* END GCC-XML MODIFICATIONS (2009/03/03 16:31:15) */ } switch (e) { @@ -3498,7 +3498,9 @@ mark_used (tree decl) /* BEGIN GCC-XML MODIFICATIONS 2008-03-02 */ if(diagnostic_xml_synthesize_test && - TREE_CODE (decl) == FUNCTION_DECL && GCCXML_DECL_ERROR (decl)) + ((TREE_CODE (decl) == FUNCTION_DECL && GCCXML_DECL_ERROR (decl)) || + (DECL_CLONED_FUNCTION_P (decl) && + GCCXML_DECL_ERROR (DECL_CLONED_FUNCTION (decl))))) { /* This is a method synth test and we recursively encountered a previously synthesized invalid method. */ diff --git a/GCC_XML/KWSys/Base64.h.in b/GCC_XML/KWSys/Base64.h.in index 0afcf0d..78551ff 100644 --- a/GCC_XML/KWSys/Base64.h.in +++ b/GCC_XML/KWSys/Base64.h.in @@ -24,13 +24,15 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysBase64 kwsys_ns(Base64) -#define kwsysBase64_Decode kwsys_ns(Base64_Decode) -#define kwsysBase64_Decode3 kwsys_ns(Base64_Decode3) -#define kwsysBase64_Encode kwsys_ns(Base64_Encode) -#define kwsysBase64_Encode1 kwsys_ns(Base64_Encode1) -#define kwsysBase64_Encode2 kwsys_ns(Base64_Encode2) -#define kwsysBase64_Encode3 kwsys_ns(Base64_Encode3) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysBase64 kwsys_ns(Base64) +# define kwsysBase64_Decode kwsys_ns(Base64_Decode) +# define kwsysBase64_Decode3 kwsys_ns(Base64_Decode3) +# define kwsysBase64_Encode kwsys_ns(Base64_Encode) +# define kwsysBase64_Encode1 kwsys_ns(Base64_Encode1) +# define kwsysBase64_Encode2 kwsys_ns(Base64_Encode2) +# define kwsysBase64_Encode3 kwsys_ns(Base64_Encode3) +#endif #if defined(__cplusplus) extern "C" @@ -106,13 +108,15 @@ kwsysEXPORT unsigned long kwsysBase64_Decode(const unsigned char *input, #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysBase64 -# undef kwsysBase64_Decode -# undef kwsysBase64_Decode3 -# undef kwsysBase64_Encode -# undef kwsysBase64_Encode1 -# undef kwsysBase64_Encode2 -# undef kwsysBase64_Encode3 +# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysBase64 +# undef kwsysBase64_Decode +# undef kwsysBase64_Decode3 +# undef kwsysBase64_Encode +# undef kwsysBase64_Encode1 +# undef kwsysBase64_Encode2 +# undef kwsysBase64_Encode3 +# endif #endif #endif diff --git a/GCC_XML/KWSys/CommandLineArguments.cxx b/GCC_XML/KWSys/CommandLineArguments.cxx index 190116a..0352b6a 100644 --- a/GCC_XML/KWSys/CommandLineArguments.cxx +++ b/GCC_XML/KWSys/CommandLineArguments.cxx @@ -521,7 +521,7 @@ unsigned int CommandLineArguments::GetLastArgument() void CommandLineArguments::GenerateHelp() { kwsys_ios::ostringstream str; - + // Collapse all arguments into the map of vectors of all arguments that do // the same thing. CommandLineArguments::Internal::CallbacksMap::iterator it; @@ -660,7 +660,7 @@ void CommandLineArguments::GenerateHelp() skip = cc; } } - str.write(ptr, skip); + str.write(ptr, static_cast(skip)); str << kwsys_ios::endl; ptr += skip; len -= skip; @@ -701,7 +701,7 @@ void CommandLineArguments::PopulateVariable( int* variable, const kwsys_stl::string& value) { char* res = 0; - *variable = strtol(value.c_str(), &res, 10); + *variable = static_cast(strtol(value.c_str(), &res, 10)); //if ( res && *res ) // { // Can handle non-int @@ -759,7 +759,7 @@ void CommandLineArguments::PopulateVariable( kwsys_stl::vector* variable, const kwsys_stl::string& value) { char* res = 0; - variable->push_back(strtol(value.c_str(), &res, 10)); + variable->push_back(static_cast(strtol(value.c_str(), &res, 10))); //if ( res && *res ) // { // Can handle non-int diff --git a/GCC_XML/KWSys/Configure.h.in b/GCC_XML/KWSys/Configure.h.in index d509f13..2cb5813 100644 --- a/GCC_XML/KWSys/Configure.h.in +++ b/GCC_XML/KWSys/Configure.h.in @@ -22,6 +22,9 @@ # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif +/* Whether kwsys namespace is "kwsys". */ +#define @KWSYS_NAMESPACE@_NAME_IS_KWSYS @KWSYS_NAME_IS_KWSYS@ + /* If we are building a kwsys .c or .cxx file, suppress the Microsoft deprecation warnings. */ #if defined(KWSYS_NAMESPACE) diff --git a/GCC_XML/KWSys/Configure.hxx.in b/GCC_XML/KWSys/Configure.hxx.in index 30f8acc..4916c12 100644 --- a/GCC_XML/KWSys/Configure.hxx.in +++ b/GCC_XML/KWSys/Configure.hxx.in @@ -17,9 +17,6 @@ /* Include C configuration. */ #include <@KWSYS_NAMESPACE@/Configure.h> -/* Whether kwsys namespace is "kwsys". */ -#define @KWSYS_NAMESPACE@_NAME_IS_KWSYS @KWSYS_NAME_IS_KWSYS@ - /* 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/FundamentalType.h.in b/GCC_XML/KWSys/FundamentalType.h.in index 4f105df..28ab548 100644 --- a/GCC_XML/KWSys/FundamentalType.h.in +++ b/GCC_XML/KWSys/FundamentalType.h.in @@ -24,15 +24,18 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysFundamentalType kwsys_ns(FundamentalType) -#define kwsysFundamentalType_Int8 kwsys_ns(FundamentalType_Int8) -#define kwsysFundamentalType_UInt8 kwsys_ns(FundamentalType_UInt8) -#define kwsysFundamentalType_Int16 kwsys_ns(FundamentalType_Int16) -#define kwsysFundamentalType_UInt16 kwsys_ns(FundamentalType_UInt16) -#define kwsysFundamentalType_Int32 kwsys_ns(FundamentalType_Int32) -#define kwsysFundamentalType_UInt32 kwsys_ns(FundamentalType_UInt32) -#define kwsysFundamentalType_Int64 kwsys_ns(FundamentalType_Int64) -#define kwsysFundamentalType_UInt64 kwsys_ns(FundamentalType_UInt64) + +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysFundamentalType kwsys_ns(FundamentalType) +# define kwsysFundamentalType_Int8 kwsys_ns(FundamentalType_Int8) +# define kwsysFundamentalType_UInt8 kwsys_ns(FundamentalType_UInt8) +# define kwsysFundamentalType_Int16 kwsys_ns(FundamentalType_Int16) +# define kwsysFundamentalType_UInt16 kwsys_ns(FundamentalType_UInt16) +# define kwsysFundamentalType_Int32 kwsys_ns(FundamentalType_Int32) +# define kwsysFundamentalType_UInt32 kwsys_ns(FundamentalType_UInt32) +# define kwsysFundamentalType_Int64 kwsys_ns(FundamentalType_Int64) +# define kwsysFundamentalType_UInt64 kwsys_ns(FundamentalType_UInt64) +#endif /* The size of fundamental types. Types that do not exist have size 0. */ #define @KWSYS_NAMESPACE@_SIZEOF_CHAR @KWSYS_SIZEOF_CHAR@ @@ -114,15 +117,17 @@ typedef unsigned __int64 kwsysFundamentalType_UInt64; #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysFundamentalType -# undef kwsysFundamentalType_Int8 -# undef kwsysFundamentalType_UInt8 -# undef kwsysFundamentalType_Int16 -# undef kwsysFundamentalType_UInt16 -# undef kwsysFundamentalType_Int32 -# undef kwsysFundamentalType_UInt32 -# undef kwsysFundamentalType_Int64 -# undef kwsysFundamentalType_UInt64 +# if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysFundamentalType +# undef kwsysFundamentalType_Int8 +# undef kwsysFundamentalType_UInt8 +# undef kwsysFundamentalType_Int16 +# undef kwsysFundamentalType_UInt16 +# undef kwsysFundamentalType_Int32 +# undef kwsysFundamentalType_UInt32 +# undef kwsysFundamentalType_Int64 +# undef kwsysFundamentalType_UInt64 +# endif #endif /* If building a C or C++ file in kwsys itself, give the source file diff --git a/GCC_XML/KWSys/Glob.cxx b/GCC_XML/KWSys/Glob.cxx index b6705fd..f3a952d 100644 --- a/GCC_XML/KWSys/Glob.cxx +++ b/GCC_XML/KWSys/Glob.cxx @@ -380,13 +380,13 @@ bool Glob::FindFiles(const kwsys_stl::string& inexpr) } kwsys_stl::string fexpr = expr; - int skip = 0; - int last_slash = 0; + kwsys_stl::string::size_type skip = 0; + kwsys_stl::string::size_type last_slash = 0; for ( cc = 0; cc < expr.size(); cc ++ ) { if ( cc > 0 && expr[cc] == '/' && expr[cc-1] != '\\' ) { - last_slash = static_cast(cc); + last_slash = cc; } if ( cc > 0 && (expr[cc] == '[' || expr[cc] == '?' || expr[cc] == '*') && diff --git a/GCC_XML/KWSys/MD5.h.in b/GCC_XML/KWSys/MD5.h.in index 49c5a5c..ea10108 100644 --- a/GCC_XML/KWSys/MD5.h.in +++ b/GCC_XML/KWSys/MD5.h.in @@ -24,15 +24,17 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysMD5 kwsys_ns(MD5) -#define kwsysMD5_s kwsys_ns(MD5_s) -#define kwsysMD5_New kwsys_ns(MD5_New) -#define kwsysMD5_Delete kwsys_ns(MD5_Delete) -#define kwsysMD5_Initialize kwsys_ns(MD5_Initialize) -#define kwsysMD5_Append kwsys_ns(MD5_Append) -#define kwsysMD5_Finalize kwsys_ns(MD5_Finalize) -#define kwsysMD5_FinalizeHex kwsys_ns(MD5_FinalizeHex) -#define kwsysMD5_DigestToHex kwsys_ns(MD5_DigestToHex) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysMD5 kwsys_ns(MD5) +# define kwsysMD5_s kwsys_ns(MD5_s) +# define kwsysMD5_New kwsys_ns(MD5_New) +# define kwsysMD5_Delete kwsys_ns(MD5_Delete) +# define kwsysMD5_Initialize kwsys_ns(MD5_Initialize) +# define kwsysMD5_Append kwsys_ns(MD5_Append) +# define kwsysMD5_Finalize kwsys_ns(MD5_Finalize) +# define kwsysMD5_FinalizeHex kwsys_ns(MD5_FinalizeHex) +# define kwsysMD5_DigestToHex kwsys_ns(MD5_DigestToHex) +#endif #if defined(__cplusplus) extern "C" @@ -91,15 +93,17 @@ kwsysEXPORT void kwsysMD5_DigestToHex(unsigned char const digest[16], #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysMD5 -# undef kwsysMD5_s -# undef kwsysMD5_New -# undef kwsysMD5_Delete -# undef kwsysMD5_Initialize -# undef kwsysMD5_Append -# undef kwsysMD5_Finalize -# undef kwsysMD5_FinalizeHex -# undef kwsysMD5_DigestToHex +# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysMD5 +# undef kwsysMD5_s +# undef kwsysMD5_New +# undef kwsysMD5_Delete +# undef kwsysMD5_Initialize +# undef kwsysMD5_Append +# undef kwsysMD5_Finalize +# undef kwsysMD5_FinalizeHex +# undef kwsysMD5_DigestToHex +# endif #endif #endif diff --git a/GCC_XML/KWSys/Process.h.in b/GCC_XML/KWSys/Process.h.in index 01822d3..9b6fc28 100644 --- a/GCC_XML/KWSys/Process.h.in +++ b/GCC_XML/KWSys/Process.h.in @@ -24,57 +24,59 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysProcess kwsys_ns(Process) -#define kwsysProcess_s kwsys_ns(Process_s) -#define kwsysProcess_New kwsys_ns(Process_New) -#define kwsysProcess_Delete kwsys_ns(Process_Delete) -#define kwsysProcess_SetCommand kwsys_ns(Process_SetCommand) -#define kwsysProcess_AddCommand kwsys_ns(Process_AddCommand) -#define kwsysProcess_SetTimeout kwsys_ns(Process_SetTimeout) -#define kwsysProcess_SetWorkingDirectory kwsys_ns(Process_SetWorkingDirectory) -#define kwsysProcess_SetPipeFile kwsys_ns(Process_SetPipeFile) -#define kwsysProcess_SetPipeNative kwsys_ns(Process_SetPipeNative) -#define kwsysProcess_SetPipeShared kwsys_ns(Process_SetPipeShared) -#define kwsysProcess_Option_Detach kwsys_ns(Process_Option_Detach) -#define kwsysProcess_Option_HideWindow kwsys_ns(Process_Option_HideWindow) -#define kwsysProcess_Option_Verbatim kwsys_ns(Process_Option_Verbatim) -#define kwsysProcess_GetOption kwsys_ns(Process_GetOption) -#define kwsysProcess_SetOption kwsys_ns(Process_SetOption) -#define kwsysProcess_Option_e kwsys_ns(Process_Option_e) -#define kwsysProcess_State_Starting kwsys_ns(Process_State_Starting) -#define kwsysProcess_State_Error kwsys_ns(Process_State_Error) -#define kwsysProcess_State_Exception kwsys_ns(Process_State_Exception) -#define kwsysProcess_State_Executing kwsys_ns(Process_State_Executing) -#define kwsysProcess_State_Exited kwsys_ns(Process_State_Exited) -#define kwsysProcess_State_Expired kwsys_ns(Process_State_Expired) -#define kwsysProcess_State_Killed kwsys_ns(Process_State_Killed) -#define kwsysProcess_State_Disowned kwsys_ns(Process_State_Disowned) -#define kwsysProcess_GetState kwsys_ns(Process_GetState) -#define kwsysProcess_State_e kwsys_ns(Process_State_e) -#define kwsysProcess_Exception_None kwsys_ns(Process_Exception_None) -#define kwsysProcess_Exception_Fault kwsys_ns(Process_Exception_Fault) -#define kwsysProcess_Exception_Illegal kwsys_ns(Process_Exception_Illegal) -#define kwsysProcess_Exception_Interrupt kwsys_ns(Process_Exception_Interrupt) -#define kwsysProcess_Exception_Numerical kwsys_ns(Process_Exception_Numerical) -#define kwsysProcess_Exception_Other kwsys_ns(Process_Exception_Other) -#define kwsysProcess_GetExitException kwsys_ns(Process_GetExitException) -#define kwsysProcess_Exception_e kwsys_ns(Process_Exception_e) -#define kwsysProcess_GetExitCode kwsys_ns(Process_GetExitCode) -#define kwsysProcess_GetExitValue kwsys_ns(Process_GetExitValue) -#define kwsysProcess_GetErrorString kwsys_ns(Process_GetErrorString) -#define kwsysProcess_GetExceptionString kwsys_ns(Process_GetExceptionString) -#define kwsysProcess_Execute kwsys_ns(Process_Execute) -#define kwsysProcess_Disown kwsys_ns(Process_Disown) -#define kwsysProcess_WaitForData kwsys_ns(Process_WaitForData) -#define kwsysProcess_Pipes_e kwsys_ns(Process_Pipes_e) -#define kwsysProcess_Pipe_None kwsys_ns(Process_Pipe_None) -#define kwsysProcess_Pipe_STDIN kwsys_ns(Process_Pipe_STDIN) -#define kwsysProcess_Pipe_STDOUT kwsys_ns(Process_Pipe_STDOUT) -#define kwsysProcess_Pipe_STDERR kwsys_ns(Process_Pipe_STDERR) -#define kwsysProcess_Pipe_Timeout kwsys_ns(Process_Pipe_Timeout) -#define kwsysProcess_Pipe_Handle kwsys_ns(Process_Pipe_Handle) -#define kwsysProcess_WaitForExit kwsys_ns(Process_WaitForExit) -#define kwsysProcess_Kill kwsys_ns(Process_Kill) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysProcess kwsys_ns(Process) +# define kwsysProcess_s kwsys_ns(Process_s) +# define kwsysProcess_New kwsys_ns(Process_New) +# define kwsysProcess_Delete kwsys_ns(Process_Delete) +# define kwsysProcess_SetCommand kwsys_ns(Process_SetCommand) +# define kwsysProcess_AddCommand kwsys_ns(Process_AddCommand) +# define kwsysProcess_SetTimeout kwsys_ns(Process_SetTimeout) +# define kwsysProcess_SetWorkingDirectory kwsys_ns(Process_SetWorkingDirectory) +# define kwsysProcess_SetPipeFile kwsys_ns(Process_SetPipeFile) +# define kwsysProcess_SetPipeNative kwsys_ns(Process_SetPipeNative) +# define kwsysProcess_SetPipeShared kwsys_ns(Process_SetPipeShared) +# define kwsysProcess_Option_Detach kwsys_ns(Process_Option_Detach) +# define kwsysProcess_Option_HideWindow kwsys_ns(Process_Option_HideWindow) +# define kwsysProcess_Option_Verbatim kwsys_ns(Process_Option_Verbatim) +# define kwsysProcess_GetOption kwsys_ns(Process_GetOption) +# define kwsysProcess_SetOption kwsys_ns(Process_SetOption) +# define kwsysProcess_Option_e kwsys_ns(Process_Option_e) +# define kwsysProcess_State_Starting kwsys_ns(Process_State_Starting) +# define kwsysProcess_State_Error kwsys_ns(Process_State_Error) +# define kwsysProcess_State_Exception kwsys_ns(Process_State_Exception) +# define kwsysProcess_State_Executing kwsys_ns(Process_State_Executing) +# define kwsysProcess_State_Exited kwsys_ns(Process_State_Exited) +# define kwsysProcess_State_Expired kwsys_ns(Process_State_Expired) +# define kwsysProcess_State_Killed kwsys_ns(Process_State_Killed) +# define kwsysProcess_State_Disowned kwsys_ns(Process_State_Disowned) +# define kwsysProcess_GetState kwsys_ns(Process_GetState) +# define kwsysProcess_State_e kwsys_ns(Process_State_e) +# define kwsysProcess_Exception_None kwsys_ns(Process_Exception_None) +# define kwsysProcess_Exception_Fault kwsys_ns(Process_Exception_Fault) +# define kwsysProcess_Exception_Illegal kwsys_ns(Process_Exception_Illegal) +# define kwsysProcess_Exception_Interrupt kwsys_ns(Process_Exception_Interrupt) +# define kwsysProcess_Exception_Numerical kwsys_ns(Process_Exception_Numerical) +# define kwsysProcess_Exception_Other kwsys_ns(Process_Exception_Other) +# define kwsysProcess_GetExitException kwsys_ns(Process_GetExitException) +# define kwsysProcess_Exception_e kwsys_ns(Process_Exception_e) +# define kwsysProcess_GetExitCode kwsys_ns(Process_GetExitCode) +# define kwsysProcess_GetExitValue kwsys_ns(Process_GetExitValue) +# define kwsysProcess_GetErrorString kwsys_ns(Process_GetErrorString) +# define kwsysProcess_GetExceptionString kwsys_ns(Process_GetExceptionString) +# define kwsysProcess_Execute kwsys_ns(Process_Execute) +# define kwsysProcess_Disown kwsys_ns(Process_Disown) +# define kwsysProcess_WaitForData kwsys_ns(Process_WaitForData) +# define kwsysProcess_Pipes_e kwsys_ns(Process_Pipes_e) +# define kwsysProcess_Pipe_None kwsys_ns(Process_Pipe_None) +# define kwsysProcess_Pipe_STDIN kwsys_ns(Process_Pipe_STDIN) +# define kwsysProcess_Pipe_STDOUT kwsys_ns(Process_Pipe_STDOUT) +# define kwsysProcess_Pipe_STDERR kwsys_ns(Process_Pipe_STDERR) +# define kwsysProcess_Pipe_Timeout kwsys_ns(Process_Pipe_Timeout) +# define kwsysProcess_Pipe_Handle kwsys_ns(Process_Pipe_Handle) +# define kwsysProcess_WaitForExit kwsys_ns(Process_WaitForExit) +# define kwsysProcess_Kill kwsys_ns(Process_Kill) +#endif #if defined(__cplusplus) extern "C" @@ -370,57 +372,59 @@ kwsysEXPORT void kwsysProcess_Kill(kwsysProcess* cp); #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysProcess -# undef kwsysProcess_s -# undef kwsysProcess_New -# undef kwsysProcess_Delete -# undef kwsysProcess_SetCommand -# undef kwsysProcess_AddCommand -# undef kwsysProcess_SetTimeout -# undef kwsysProcess_SetWorkingDirectory -# undef kwsysProcess_SetPipeFile -# undef kwsysProcess_SetPipeNative -# undef kwsysProcess_SetPipeShared -# undef kwsysProcess_Option_Detach -# undef kwsysProcess_Option_HideWindow -# undef kwsysProcess_Option_Verbatim -# undef kwsysProcess_GetOption -# undef kwsysProcess_SetOption -# undef kwsysProcess_Option_e -# undef kwsysProcess_State_Starting -# undef kwsysProcess_State_Error -# undef kwsysProcess_State_Exception -# undef kwsysProcess_State_Executing -# undef kwsysProcess_State_Exited -# undef kwsysProcess_State_Expired -# undef kwsysProcess_State_Killed -# undef kwsysProcess_State_Disowned -# undef kwsysProcess_GetState -# undef kwsysProcess_State_e -# undef kwsysProcess_Exception_None -# undef kwsysProcess_Exception_Fault -# undef kwsysProcess_Exception_Illegal -# undef kwsysProcess_Exception_Interrupt -# undef kwsysProcess_Exception_Numerical -# undef kwsysProcess_Exception_Other -# undef kwsysProcess_GetExitException -# undef kwsysProcess_Exception_e -# undef kwsysProcess_GetExitCode -# undef kwsysProcess_GetExitValue -# undef kwsysProcess_GetErrorString -# undef kwsysProcess_GetExceptionString -# undef kwsysProcess_Execute -# undef kwsysProcess_Disown -# undef kwsysProcess_WaitForData -# undef kwsysProcess_Pipes_e -# undef kwsysProcess_Pipe_None -# undef kwsysProcess_Pipe_STDIN -# undef kwsysProcess_Pipe_STDOUT -# undef kwsysProcess_Pipe_STDERR -# undef kwsysProcess_Pipe_Timeout -# undef kwsysProcess_Pipe_Handle -# undef kwsysProcess_WaitForExit -# undef kwsysProcess_Kill +# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysProcess +# undef kwsysProcess_s +# undef kwsysProcess_New +# undef kwsysProcess_Delete +# undef kwsysProcess_SetCommand +# undef kwsysProcess_AddCommand +# undef kwsysProcess_SetTimeout +# undef kwsysProcess_SetWorkingDirectory +# undef kwsysProcess_SetPipeFile +# undef kwsysProcess_SetPipeNative +# undef kwsysProcess_SetPipeShared +# undef kwsysProcess_Option_Detach +# undef kwsysProcess_Option_HideWindow +# undef kwsysProcess_Option_Verbatim +# undef kwsysProcess_GetOption +# undef kwsysProcess_SetOption +# undef kwsysProcess_Option_e +# undef kwsysProcess_State_Starting +# undef kwsysProcess_State_Error +# undef kwsysProcess_State_Exception +# undef kwsysProcess_State_Executing +# undef kwsysProcess_State_Exited +# undef kwsysProcess_State_Expired +# undef kwsysProcess_State_Killed +# undef kwsysProcess_State_Disowned +# undef kwsysProcess_GetState +# undef kwsysProcess_State_e +# undef kwsysProcess_Exception_None +# undef kwsysProcess_Exception_Fault +# undef kwsysProcess_Exception_Illegal +# undef kwsysProcess_Exception_Interrupt +# undef kwsysProcess_Exception_Numerical +# undef kwsysProcess_Exception_Other +# undef kwsysProcess_GetExitException +# undef kwsysProcess_Exception_e +# undef kwsysProcess_GetExitCode +# undef kwsysProcess_GetExitValue +# undef kwsysProcess_GetErrorString +# undef kwsysProcess_GetExceptionString +# undef kwsysProcess_Execute +# undef kwsysProcess_Disown +# undef kwsysProcess_WaitForData +# undef kwsysProcess_Pipes_e +# undef kwsysProcess_Pipe_None +# undef kwsysProcess_Pipe_STDIN +# undef kwsysProcess_Pipe_STDOUT +# undef kwsysProcess_Pipe_STDERR +# undef kwsysProcess_Pipe_Timeout +# undef kwsysProcess_Pipe_Handle +# undef kwsysProcess_WaitForExit +# undef kwsysProcess_Kill +# endif #endif #endif diff --git a/GCC_XML/KWSys/ProcessUNIX.c b/GCC_XML/KWSys/ProcessUNIX.c index 765d1e0..76b5848 100644 --- a/GCC_XML/KWSys/ProcessUNIX.c +++ b/GCC_XML/KWSys/ProcessUNIX.c @@ -390,7 +390,8 @@ int kwsysProcess_AddCommand(kwsysProcess* cp, char const* const* command) /* Allocate a new array for command pointers. */ newNumberOfCommands = cp->NumberOfCommands + 1; - if(!(newCommands = (char***)malloc(sizeof(char**) * newNumberOfCommands))) + if(!(newCommands = + (char***)malloc(sizeof(char**) *(size_t)(newNumberOfCommands)))) { /* Out of memory. */ return 0; @@ -427,7 +428,8 @@ int kwsysProcess_AddCommand(kwsysProcess* cp, char const* const* command) kwsysProcess_ptrdiff_t i = 0; while(*c++); n = c - command - 1; - newCommands[cp->NumberOfCommands] = (char**)malloc((n+1)*sizeof(char*)); + newCommands[cp->NumberOfCommands] = + (char**)malloc((size_t)(n+1)*sizeof(char*)); if(!newCommands[cp->NumberOfCommands]) { /* Out of memory. */ @@ -1049,7 +1051,7 @@ static int kwsysProcessWaitForPipe(kwsysProcess* cp, char** data, int* length, { /* Report this data. */ *data = cp->PipeBuffer; - *length = n; + *length = (int)(n); switch(i) { case KWSYSPE_PIPE_STDOUT: @@ -1399,23 +1401,24 @@ static int kwsysProcessInitialize(kwsysProcess* cp) { free(cp->ForkPIDs); } - cp->ForkPIDs = (pid_t*)malloc(sizeof(pid_t)*cp->NumberOfCommands); + cp->ForkPIDs = (pid_t*)malloc(sizeof(pid_t)*(size_t)(cp->NumberOfCommands)); if(!cp->ForkPIDs) { return 0; } - memset(cp->ForkPIDs, 0, sizeof(pid_t)*cp->NumberOfCommands); + memset(cp->ForkPIDs, 0, sizeof(pid_t)*(size_t)(cp->NumberOfCommands)); if(cp->CommandExitCodes) { free(cp->CommandExitCodes); } - cp->CommandExitCodes = (int*)malloc(sizeof(int)*cp->NumberOfCommands); + cp->CommandExitCodes = (int*)malloc(sizeof(int)* + (size_t)(cp->NumberOfCommands)); if(!cp->CommandExitCodes) { return 0; } - memset(cp->CommandExitCodes, 0, sizeof(int)*cp->NumberOfCommands); + memset(cp->CommandExitCodes, 0, sizeof(int)*(size_t)(cp->NumberOfCommands)); /* Allocate memory to save the real working directory. */ if ( cp->WorkingDirectory ) @@ -1951,7 +1954,7 @@ static kwsysProcessTime kwsysProcessTimeGetCurrent(void) /*--------------------------------------------------------------------------*/ static double kwsysProcessTimeToDouble(kwsysProcessTime t) { - return (double)t.tv_sec + t.tv_usec*0.000001; + return (double)t.tv_sec + (double)(t.tv_usec)*0.000001; } /*--------------------------------------------------------------------------*/ @@ -1959,7 +1962,7 @@ static kwsysProcessTime kwsysProcessTimeFromDouble(double d) { kwsysProcessTime t; t.tv_sec = (long)d; - t.tv_usec = (long)((d-t.tv_sec)*1000000); + t.tv_usec = (long)((d-(double)(t.tv_sec))*1000000); return t; } @@ -2134,10 +2137,12 @@ static void kwsysProcessChildErrorExit(int errorPipe) { /* Construct the error message. */ char buffer[KWSYSPE_PIPE_BUFFER_SIZE]; + kwsysProcess_ssize_t result; strncpy(buffer, strerror(errno), KWSYSPE_PIPE_BUFFER_SIZE); /* Report the error to the parent through the special pipe. */ - write(errorPipe, buffer, strlen(buffer)); + result=write(errorPipe, buffer, strlen(buffer)); + (void)result; /* Terminate without cleanup. */ _exit(1); @@ -2265,6 +2270,9 @@ static pid_t kwsysProcessFork(kwsysProcess* cp, if(cp->OptionDetach) { /* Create an intermediate process. */ +#ifdef __VMS +#define fork vfork +#endif pid_t middle_pid = fork(); if(middle_pid < 0) { @@ -2379,7 +2387,7 @@ static void kwsysProcessKill(pid_t process_id) FILE* f = fopen(fname, "r"); if(f) { - int nread = fread(buffer, 1, KWSYSPE_PIPE_BUFFER_SIZE, f); + size_t nread = fread(buffer, 1, KWSYSPE_PIPE_BUFFER_SIZE, f); buffer[nread] = '\0'; if(nread > 0) { @@ -2513,14 +2521,14 @@ static int kwsysProcessesAdd(kwsysProcess* cp) /* Try allocating the new block of memory. */ if((newProcesses.Processes = ((kwsysProcess**) - malloc(newProcesses.Size* + malloc((size_t)(newProcesses.Size)* sizeof(kwsysProcess*))))) { /* Copy the old pipe set to the new memory. */ if(oldProcesses.Count > 0) { memcpy(newProcesses.Processes, oldProcesses.Processes, - (oldProcesses.Count * sizeof(kwsysProcess*))); + ((size_t)(oldProcesses.Count) * sizeof(kwsysProcess*))); } } else @@ -2638,8 +2646,10 @@ static void kwsysProcessesSignalHandler(int signum /* Set the pipe in a signalled state. */ char buf = 1; kwsysProcess* cp = kwsysProcesses.Processes[i]; - read(cp->PipeReadEnds[KWSYSPE_PIPE_SIGNAL], &buf, 1); - write(cp->SignalPipe, &buf, 1); + kwsysProcess_ssize_t status= + read(cp->PipeReadEnds[KWSYSPE_PIPE_SIGNAL], &buf, 1); + status=write(cp->SignalPipe, &buf, 1); + } } @@ -2672,7 +2682,7 @@ static int kwsysProcessAppendByte(char* local, { return 0; } - memcpy(newBuffer, *begin, length*sizeof(char)); + memcpy(newBuffer, *begin, (size_t)(length)*sizeof(char)); if(*begin != local) { free(*begin); @@ -2705,12 +2715,12 @@ static int kwsysProcessAppendArgument(char** local, if((*end - *begin) >= *size) { kwsysProcess_ptrdiff_t length = *end - *begin; - char** newPointers = (char**)malloc(*size*2*sizeof(char*)); + char** newPointers = (char**)malloc((size_t)(*size)*2*sizeof(char*)); if(!newPointers) { return 0; } - memcpy(newPointers, *begin, length*sizeof(char*)); + memcpy(newPointers, *begin, (size_t)(length)*sizeof(char*)); if(*begin != local) { free(*begin); @@ -2878,14 +2888,14 @@ static char** kwsysProcessParseVerbatimCommand(const char* command) if(!failed) { kwsysProcess_ptrdiff_t n = pointer_end - pointer_begin; - newCommand = (char**)malloc((n+1)*sizeof(char*)); + newCommand = (char**)malloc((size_t)(n+1)*sizeof(char*)); } if(newCommand) { /* Copy the arguments into the new command buffer. */ kwsysProcess_ptrdiff_t n = pointer_end - pointer_begin; - memcpy(newCommand, pointer_begin, sizeof(char*)*n); + memcpy(newCommand, pointer_begin, sizeof(char*)*(size_t)(n)); newCommand[n] = 0; } else diff --git a/GCC_XML/KWSys/RegularExpression.cxx b/GCC_XML/KWSys/RegularExpression.cxx index 84cf857..09db021 100644 --- a/GCC_XML/KWSys/RegularExpression.cxx +++ b/GCC_XML/KWSys/RegularExpression.cxx @@ -269,7 +269,7 @@ const unsigned char MAGIC = 0234; * Utility definitions. */ -#define UCHARAT(p) ((const unsigned char*)(p))[0] +#define UCHARAT(p) (reinterpret_cast(p))[0] #define FAIL(m) { regerror(m); return(0); } @@ -316,7 +316,7 @@ static char* regatom (int*); static char* regnode (char); static const char* regnext (register const char*); static char* regnext (register char*); -static void regc (unsigned char); +static void regc (char); static void reginsert (char, char*); static void regtail (char*, const char*); static void regoptail (char*, const char*); @@ -348,7 +348,7 @@ static int strcspn (); bool RegularExpression::compile (const char* exp) { register const char* scan; register const char* longest; - register unsigned long len; + register size_t len; int flags; if (exp == 0) { @@ -362,7 +362,7 @@ bool RegularExpression::compile (const char* exp) { regnpar = 1; regsize = 0L; regcode = ®dummy; - regc(MAGIC); + regc(static_cast(MAGIC)); if(!reg(0, &flags)) { printf ("RegularExpression::compile(): Error in compile.\n"); @@ -394,7 +394,7 @@ bool RegularExpression::compile (const char* exp) { regparse = exp; regnpar = 1; regcode = this->program; - regc(MAGIC); + regc(static_cast(MAGIC)); reg(0, &flags); // Dig out information for optimizations. @@ -426,7 +426,7 @@ bool RegularExpression::compile (const char* exp) { for (; scan != 0; scan = regnext(scan)) if (OP(scan) == EXACTLY && strlen(OPERAND(scan)) >= len) { longest = OPERAND(scan); - len = int(strlen(OPERAND(scan))); + len = strlen(OPERAND(scan)); } this->regmust = longest; this->regmlen = len; @@ -675,7 +675,7 @@ static char* regatom (int *flagp) { return 0; } for (; rxpclass <= rxpclassend; rxpclass++) - regc(static_cast(rxpclass)); + regc(static_cast(rxpclass)); regparse++; } } @@ -778,7 +778,7 @@ static char* regnode (char op) { /* - regc - emit (if appropriate) a byte of code */ -static void regc (unsigned char b) { +static void regc (char b) { if (regcode != ®dummy) *regcode++ = b; else @@ -1018,14 +1018,14 @@ static int regmatch (const char* prog) { reginput++; break; case EXACTLY:{ - register int len; + register size_t len; register const char* opnd; opnd = OPERAND(scan); // Inline the first character, for speed. if (*opnd != *reginput) return (0); - len = int(strlen(opnd)); + len = strlen(opnd); if (len > 1 && strncmp(opnd, reginput, len) != 0) return (0); reginput += len; @@ -1234,7 +1234,6 @@ static const char* regnext (register const char* p) { return (p + offset); } - static char* regnext (register char* p) { register int offset; diff --git a/GCC_XML/KWSys/RegularExpression.hxx.in b/GCC_XML/KWSys/RegularExpression.hxx.in index 4411c0b..827452a 100644 --- a/GCC_XML/KWSys/RegularExpression.hxx.in +++ b/GCC_XML/KWSys/RegularExpression.hxx.in @@ -281,7 +281,7 @@ private: char regstart; // Internal use only char reganch; // Internal use only const char* regmust; // Internal use only - unsigned long regmlen; // Internal use only + kwsys_stl::string::size_type regmlen; // Internal use only char* program; int progsize; const char* searchstring; @@ -323,7 +323,8 @@ inline RegularExpression::~RegularExpression () */ inline kwsys_stl::string::size_type RegularExpression::start () const { - return(this->startp[0] - searchstring); + return static_cast( + this->startp[0] - searchstring); } @@ -332,7 +333,8 @@ inline kwsys_stl::string::size_type RegularExpression::start () const */ inline kwsys_stl::string::size_type RegularExpression::end () const { - return(this->endp[0] - searchstring); + return static_cast( + this->endp[0] - searchstring); } /** @@ -367,7 +369,8 @@ inline void RegularExpression::set_invalid () */ inline kwsys_stl::string::size_type RegularExpression::start(int n) const { - return this->startp[n] - searchstring; + return static_cast( + this->startp[n] - searchstring); } @@ -376,7 +379,8 @@ inline kwsys_stl::string::size_type RegularExpression::start(int n) const */ inline kwsys_stl::string::size_type RegularExpression::end(int n) const { - return this->endp[n] - searchstring; + return static_cast( + this->endp[n] - searchstring); } /** @@ -390,7 +394,9 @@ inline kwsys_stl::string RegularExpression::match(int n) const } else { - return kwsys_stl::string(this->startp[n], this->endp[n] - this->startp[n]); + return kwsys_stl::string(this->startp[n], + static_cast( + this->endp[n] - this->startp[n])); } } diff --git a/GCC_XML/KWSys/String.h.in b/GCC_XML/KWSys/String.h.in index fe4a0ee..de4d7ea 100644 --- a/GCC_XML/KWSys/String.h.in +++ b/GCC_XML/KWSys/String.h.in @@ -26,8 +26,10 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysString_strcasecmp kwsys_ns(String_strcasecmp) -#define kwsysString_strncasecmp kwsys_ns(String_strncasecmp) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysString_strcasecmp kwsys_ns(String_strcasecmp) +# define kwsysString_strncasecmp kwsys_ns(String_strncasecmp) +#endif #if defined(__cplusplus) extern "C" @@ -58,8 +60,10 @@ kwsysEXPORT int kwsysString_strncasecmp(const char* lhs, const char* rhs, #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysString_strcasecmp -# undef kwsysString_strncasecmp +# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysString_strcasecmp +# undef kwsysString_strncasecmp +# endif #endif #endif diff --git a/GCC_XML/KWSys/System.h.in b/GCC_XML/KWSys/System.h.in index 86e5845..f6b531a 100644 --- a/GCC_XML/KWSys/System.h.in +++ b/GCC_XML/KWSys/System.h.in @@ -24,18 +24,29 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysSystem_Shell_GetArgumentForWindows kwsys_ns(System_Shell_GetArgumentForWindows) -#define kwsysSystem_Shell_GetArgumentForUnix kwsys_ns(System_Shell_GetArgumentForUnix) -#define kwsysSystem_Shell_GetArgumentSizeForWindows kwsys_ns(System_Shell_GetArgumentSizeForWindows) -#define kwsysSystem_Shell_GetArgumentSizeForUnix kwsys_ns(System_Shell_GetArgumentSizeForUnix) -#define kwsysSystem_Shell_Flag_e kwsys_ns(System_Shell_Flag_e) -#define kwsysSystem_Shell_Flag_Make kwsys_ns(System_Shell_Flag_Make) -#define kwsysSystem_Shell_Flag_VSIDE kwsys_ns(System_Shell_Flag_VSIDE) -#define kwsysSystem_Shell_Flag_EchoWindows kwsys_ns(System_Shell_Flag_EchoWindows) -#define kwsysSystem_Shell_Flag_WatcomWMake kwsys_ns(System_Shell_Flag_WatcomWMake) -#define kwsysSystem_Shell_Flag_MinGWMake kwsys_ns(System_Shell_Flag_MinGWMake) -#define kwsysSystem_Shell_Flag_NMake kwsys_ns(System_Shell_Flag_NMake) -#define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysSystem_Shell_GetArgumentForWindows kwsys_ns(System_Shell_GetArgumentForWindows) +# define kwsysSystem_Shell_GetArgumentForUnix kwsys_ns(System_Shell_GetArgumentForUnix) +# define kwsysSystem_Shell_GetArgumentSizeForWindows kwsys_ns(System_Shell_GetArgumentSizeForWindows) +# define kwsysSystem_Shell_GetArgumentSizeForUnix kwsys_ns(System_Shell_GetArgumentSizeForUnix) +# define kwsysSystem_Shell_Flag_e kwsys_ns(System_Shell_Flag_e) +# define kwsysSystem_Shell_Flag_Make kwsys_ns(System_Shell_Flag_Make) +# define kwsysSystem_Shell_Flag_VSIDE kwsys_ns(System_Shell_Flag_VSIDE) +# define kwsysSystem_Shell_Flag_EchoWindows kwsys_ns(System_Shell_Flag_EchoWindows) +# define kwsysSystem_Shell_Flag_WatcomWMake kwsys_ns(System_Shell_Flag_WatcomWMake) +# define kwsysSystem_Shell_Flag_MinGWMake kwsys_ns(System_Shell_Flag_MinGWMake) +# define kwsysSystem_Shell_Flag_NMake kwsys_ns(System_Shell_Flag_NMake) +# define kwsysSystem_Shell_Flag_AllowMakeVariables kwsys_ns(System_Shell_Flag_AllowMakeVariables) +#endif + +#ifdef __VMS +#define @KWSYS_NAMESPACE@System_Shell_GetArgumentForUnix \ + @KWSYS_NAMESPACE@System_Shell_UnixGA +#define @KWSYS_NAMESPACE@System_Shell_GetArgumentSizeForUnix \ + @KWSYS_NAMESPACE@System_Shell_UnixGAS +#define @KWSYS_NAMESPACE@System_Shell_GetArgumentForWindows \ + @KWSYS_NAMESPACE@System_Shell_WindowsGA +#endif #if defined(__cplusplus) extern "C" @@ -111,18 +122,20 @@ enum kwsysSystem_Shell_Flag_e #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysSystem_Shell_GetArgumentForWindows -# undef kwsysSystem_Shell_GetArgumentForUnix -# undef kwsysSystem_Shell_GetArgumentSizeForWindows -# undef kwsysSystem_Shell_GetArgumentSizeForUnix -# undef kwsysSystem_Shell_Flag_e -# undef kwsysSystem_Shell_Flag_Make -# undef kwsysSystem_Shell_Flag_VSIDE -# undef kwsysSystem_Shell_Flag_EchoWindows -# undef kwsysSystem_Shell_Flag_WatcomWMake -# undef kwsysSystem_Shell_Flag_MinGWMake -# undef kwsysSystem_Shell_Flag_NMake -# undef kwsysSystem_Shell_Flag_AllowMakeVariables +# if !defined(KWSYS_NAMESPACE) && !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysSystem_Shell_GetArgumentForWindows +# undef kwsysSystem_Shell_GetArgumentForUnix +# undef kwsysSystem_Shell_GetArgumentSizeForWindows +# undef kwsysSystem_Shell_GetArgumentSizeForUnix +# undef kwsysSystem_Shell_Flag_e +# undef kwsysSystem_Shell_Flag_Make +# undef kwsysSystem_Shell_Flag_VSIDE +# undef kwsysSystem_Shell_Flag_EchoWindows +# undef kwsysSystem_Shell_Flag_WatcomWMake +# undef kwsysSystem_Shell_Flag_MinGWMake +# undef kwsysSystem_Shell_Flag_NMake +# undef kwsysSystem_Shell_Flag_AllowMakeVariables +# endif #endif #endif diff --git a/GCC_XML/KWSys/SystemInformation.cxx b/GCC_XML/KWSys/SystemInformation.cxx index 8b3e52e..397be63 100644 --- a/GCC_XML/KWSys/SystemInformation.cxx +++ b/GCC_XML/KWSys/SystemInformation.cxx @@ -104,7 +104,7 @@ class SystemInformationImplementation const char * GetExtendedProcessorName(); const char * GetProcessorSerialNumber(); int GetProcessorCacheSize(); - int GetLogicalProcessorsPerPhysical(); + unsigned int GetLogicalProcessorsPerPhysical(); float GetProcessorClockFrequency(); int GetProcessorAPICID(); int GetProcessorCacheXSize(long int); @@ -166,7 +166,7 @@ class SystemInformationImplementation bool HasMMXPlus; bool HasSSEMMX; bool SupportsHyperthreading; - int LogicalProcessorsPerPhysical; + unsigned int LogicalProcessorsPerPhysical; int APIC_ID; CPUPowerManagement PowerManagement; } CPUExtendedFeatures; @@ -317,7 +317,7 @@ int SystemInformation::GetProcessorCacheSize() { return this->Implementation->GetProcessorCacheSize(); } -int SystemInformation::GetLogicalProcessorsPerPhysical() +unsigned int SystemInformation::GetLogicalProcessorsPerPhysical() { return this->Implementation->GetLogicalProcessorsPerPhysical(); } @@ -680,7 +680,7 @@ const char * SystemInformationImplementation::GetProcessorSerialNumber() } /** Return the logical processors per physical */ -int SystemInformationImplementation::GetLogicalProcessorsPerPhysical() +unsigned int SystemInformationImplementation::GetLogicalProcessorsPerPhysical() { return this->Features.ExtendedFeatures.LogicalProcessorsPerPhysical; } @@ -1563,7 +1563,7 @@ bool SystemInformationImplementation::RetrieveExtendedCPUFeatures() } // Check to see if what we are about to do is supported... - if (!RetrieveCPUExtendedLevelSupport (0x80000001)) + if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000001))) { return false; } @@ -1698,7 +1698,7 @@ bool SystemInformationImplementation::RetrieveProcessorSerialNumber() bool SystemInformationImplementation::RetrieveCPUPowerManagement() { // Check to see if what we are about to do is supported... - if (!RetrieveCPUExtendedLevelSupport (0x80000007)) + if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000007))) { this->Features.ExtendedFeatures.PowerManagement.HasFrequencyID = false; this->Features.ExtendedFeatures.PowerManagement.HasVoltageID = false; @@ -1755,9 +1755,12 @@ bool SystemInformationImplementation::RetrieveCPUPowerManagement() bool SystemInformationImplementation::RetrieveExtendedCPUIdentity() { // Check to see if what we are about to do is supported... - if (!RetrieveCPUExtendedLevelSupport(0x80000002)) return false; - if (!RetrieveCPUExtendedLevelSupport(0x80000003)) return false; - if (!RetrieveCPUExtendedLevelSupport(0x80000004)) return false; + if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000002))) + return false; + if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000003))) + return false; + if (!RetrieveCPUExtendedLevelSupport(static_cast(0x80000004))) + return false; #if USE_ASM_INSTRUCTIONS int ProcessorNameStartPos = 0; @@ -2169,7 +2172,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() size_t fileSize = 0; while(!feof(fd)) { - buffer += static_cast(fgetc(fd)); + buffer += static_cast(fgetc(fd)); fileSize++; } fclose( fd ); @@ -2204,7 +2207,8 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() kwsys_stl::string cores = this->ExtractValueFromCpuInfoFile(buffer,"cpu cores"); int numberOfCoresPerCPU=atoi(cores.c_str()); - this->NumberOfPhysicalCPU=numberOfCoresPerCPU*(maxId+1); + this->NumberOfPhysicalCPU=static_cast( + numberOfCoresPerCPU*(maxId+1)); #else // __CYGWIN__ // does not have "physical id" entries, neither "cpu cores" @@ -2222,7 +2226,7 @@ int SystemInformationImplementation::RetreiveInformationFromCpuInfoFile() } // LogicalProcessorsPerPhysical>1 => hyperthreading. this->Features.ExtendedFeatures.LogicalProcessorsPerPhysical= - this->NumberOfLogicalCPU/this->NumberOfPhysicalCPU; + this->NumberOfLogicalCPU/this->NumberOfPhysicalCPU; // CPU speed (checking only the first proc kwsys_stl::string CPUSpeed = this->ExtractValueFromCpuInfoFile(buffer,"cpu MHz"); @@ -2284,7 +2288,7 @@ int SystemInformationImplementation::QueryMemory() unsigned long av=0; unsigned long ap=0; - char buffer[1024]; // for skipping unused lines + char buffer[1024]; // for reading lines int linuxMajor = 0; int linuxMinor = 0; @@ -2327,34 +2331,39 @@ int SystemInformationImplementation::QueryMemory() // new /proc/meminfo format since kernel 2.6.x // Rigorously, this test should check from the developping version 2.5.x // that introduced the new format... - - long freeMem; - long buffersMem; - long cachedMem; - - fscanf(fd,"MemTotal:%ld kB\n", &this->TotalPhysicalMemory); - fscanf(fd,"MemFree:%ld kB\n", &freeMem); - fscanf(fd,"Buffers:%ld kB\n", &buffersMem); - fscanf(fd,"Cached:%ld kB\n", &cachedMem); - - this->TotalPhysicalMemory /= 1024; - this->AvailablePhysicalMemory = freeMem+cachedMem+buffersMem; - this->AvailablePhysicalMemory /= 1024; - - // Skip SwapCached, Active, Inactive, HighTotal, HighFree, LowTotal - // and LowFree. - int i=0; - while(i<7) + + enum { mMemTotal, mMemFree, mBuffers, mCached, mSwapTotal, mSwapFree }; + const char* format[6] = + { "MemTotal:%lu kB", "MemFree:%lu kB", "Buffers:%lu kB", + "Cached:%lu kB", "SwapTotal:%lu kB", "SwapFree:%lu kB" }; + bool have[6] = { false, false, false, false, false, false }; + unsigned long value[6]; + int count = 0; + while(fgets(buffer, sizeof(buffer), fd)) { - fgets(buffer, sizeof(buffer), fd); // skip a line - ++i; + for(int i=0; i < 6; ++i) + { + if(!have[i] && sscanf(buffer, format[i], &value[i]) == 1) + { + have[i] = true; + ++count; + } + } + } + if(count == 6) + { + this->TotalPhysicalMemory = value[mMemTotal] / 1024; + this->AvailablePhysicalMemory = + (value[mMemFree] + value[mBuffers] + value[mCached]) / 1024; + this->TotalVirtualMemory = value[mSwapTotal] / 1024; + this->AvailableVirtualMemory = value[mSwapFree] / 1024; + } + else + { + kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl; + fclose(fd); + return 0; } - - fscanf(fd,"SwapTotal:%ld kB\n", &this->TotalVirtualMemory); - fscanf(fd,"SwapFree:%ld kB\n", &this->AvailableVirtualMemory); - - this->TotalVirtualMemory /= 1024; - this->AvailableVirtualMemory /= 1024; } else { @@ -2363,16 +2372,30 @@ int SystemInformationImplementation::QueryMemory() unsigned long temp; unsigned long cachedMem; unsigned long buffersMem; - fgets(buffer, sizeof(buffer), fd); // Skip "total: used:..." - - fscanf(fd, "Mem: %lu %lu %lu %lu %lu %lu\n", - &tp, &temp, &ap, &temp, &buffersMem, &cachedMem); - fscanf(fd, "Swap: %lu %lu %lu\n", &tv, &temp, &av); - - this->TotalVirtualMemory = tv>>10>>10; - this->TotalPhysicalMemory = tp>>10>>10; - this->AvailableVirtualMemory = av>>10>>10; - this->AvailablePhysicalMemory = (ap+buffersMem+cachedMem)>>10>>10; + char *r=fgets(buffer, sizeof(buffer), fd); // Skip "total: used:..." + int status=0; + if(r==buffer) + { + status+=fscanf(fd, "Mem: %lu %lu %lu %lu %lu %lu\n", + &tp, &temp, &ap, &temp, &buffersMem, &cachedMem); + } + if(status==6) + { + status+=fscanf(fd, "Swap: %lu %lu %lu\n", &tv, &temp, &av); + } + if(status==9) + { + this->TotalVirtualMemory = tv>>10>>10; + this->TotalPhysicalMemory = tp>>10>>10; + this->AvailableVirtualMemory = av>>10>>10; + this->AvailablePhysicalMemory = (ap+buffersMem+cachedMem)>>10>>10; + } + else + { + kwsys_ios::cout << "Problem parsing /proc/meminfo" << kwsys_ios::endl; + fclose(fd); + return 0; + } } fclose( fd ); return 1; @@ -2725,13 +2748,14 @@ bool SystemInformationImplementation::ParseSysCtl() this->SysCtlBuffer = this->RunProcess(args); // Parse values for Mac - this->TotalPhysicalMemory = atoi(this->ExtractValueFromSysCtl("hw.memsize:").c_str())/(1024*1024); + this->TotalPhysicalMemory = static_cast( + atoi(this->ExtractValueFromSysCtl("hw.memsize:").c_str())/(1024*1024)); this->TotalVirtualMemory = 0; this->AvailablePhysicalMemory = 0; this->AvailableVirtualMemory = 0; - this->NumberOfPhysicalCPU = atoi(this->ExtractValueFromSysCtl("hw.physicalcpu:").c_str()); - this->NumberOfLogicalCPU = atoi(this->ExtractValueFromSysCtl("hw.logicalcpu:").c_str()); + this->NumberOfPhysicalCPU = static_cast(atoi(this->ExtractValueFromSysCtl("hw.physicalcpu:").c_str())); + this->NumberOfLogicalCPU = static_cast(atoi(this->ExtractValueFromSysCtl("hw.logicalcpu:").c_str())); if(this->NumberOfPhysicalCPU!=0) { @@ -2908,7 +2932,8 @@ kwsys_stl::string SystemInformationImplementation::ParseValueFromKStat(const cha bool SystemInformationImplementation::QuerySolarisInfo() { // Parse values - this->NumberOfPhysicalCPU = atoi(this->ParseValueFromKStat("-n syste_misc -s ncpus").c_str()); + this->NumberOfPhysicalCPU = static_cast( + atoi(this->ParseValueFromKStat("-n syste_misc -s ncpus").c_str())); this->NumberOfLogicalCPU = this->NumberOfPhysicalCPU; if(this->NumberOfPhysicalCPU!=0) diff --git a/GCC_XML/KWSys/SystemInformation.hxx.in b/GCC_XML/KWSys/SystemInformation.hxx.in index 0aad466..f2adaa9 100644 --- a/GCC_XML/KWSys/SystemInformation.hxx.in +++ b/GCC_XML/KWSys/SystemInformation.hxx.in @@ -47,7 +47,7 @@ public: const char * GetExtendedProcessorName(); const char * GetProcessorSerialNumber(); int GetProcessorCacheSize(); - int GetLogicalProcessorsPerPhysical(); + unsigned int GetLogicalProcessorsPerPhysical(); float GetProcessorClockFrequency(); int GetProcessorAPICID(); int GetProcessorCacheXSize(long int); diff --git a/GCC_XML/KWSys/SystemTools.cxx b/GCC_XML/KWSys/SystemTools.cxx index f8311fc..2fddfb8 100644 --- a/GCC_XML/KWSys/SystemTools.cxx +++ b/GCC_XML/KWSys/SystemTools.cxx @@ -53,12 +53,14 @@ #ifndef _WIN32 #include #include -#include #include #include #include #include +#ifndef __VMS +#include #include +#endif #include /* sigprocmask */ #endif @@ -311,11 +313,11 @@ SystemTools::GetTime(void) struct timeval t; #ifdef GETTIMEOFDAY_NO_TZ if (gettimeofday(&t) == 0) - return static_cast(t.tv_sec) + t.tv_usec*0.000001; #else /* !GETTIMEOFDAY_NO_TZ */ if (gettimeofday(&t, static_cast(NULL)) == 0) - return static_cast(t.tv_sec) + t.tv_usec*0.000001; #endif /* !GETTIMEOFDAY_NO_TZ */ + return static_cast(t.tv_sec) + + static_cast(t.tv_usec)*0.000001; } #endif /* !HAVE_GETTIMEOFDAY */ { @@ -1660,7 +1662,7 @@ bool SystemTools::CopyFileIfDifferent(const char* source, #define KWSYS_ST_BUFFER 4096 bool SystemTools::FilesDiffer(const char* source, - const char* destination) + const char* destination) { struct stat statSource; if (stat(source, &statSource) != 0) @@ -1715,10 +1717,11 @@ bool SystemTools::FilesDiffer(const char* source, { return true; } - + // If this block differs the file differs. if(memcmp(static_cast(source_buf), - static_cast(dest_buf), nnext) != 0) + static_cast(dest_buf), + static_cast(nnext)) != 0) { return true; } @@ -1999,7 +2002,7 @@ bool SystemTools::ConvertDateMacroString(const char *str, time_t *tmt) return false; } - int month = (ptr - month_names) / 3; + int month = static_cast((ptr - month_names) / 3); int day = atoi(buffer + 4); int year = atoi(buffer + 7); @@ -2050,7 +2053,7 @@ bool SystemTools::ConvertTimeStampMacroString(const char *str, time_t *tmt) return false; } - int month = (ptr - month_names) / 3; + int month = static_cast((ptr - month_names) / 3); int day = atoi(buffer + 8); int hour = atoi(buffer + 11); int min = atoi(buffer + 14); @@ -2100,6 +2103,19 @@ bool SystemTools::RemoveFile(const char* source) bool SystemTools::RemoveADirectory(const char* source) { + // Add write permission to the directory so we can modify its + // content to remove files and directories from it. + mode_t mode; + if(SystemTools::GetPermissions(source, mode)) + { +#if defined(_WIN32) && !defined(__CYGWIN__) + mode |= S_IWRITE; +#else + mode |= S_IWUSR; +#endif + SystemTools::SetPermissions(source, mode); + } + Directory dir; dir.Load(source); size_t fileNum; @@ -2495,7 +2511,7 @@ bool SystemTools::FileIsDirectory(const char* name) { // Remove any trailing slash from the name. char buffer[KWSYS_SYSTEMTOOLS_MAXPATH]; - int last = static_cast(strlen(name))-1; + size_t last = strlen(name)-1; if(last > 0 && (name[last] == '/' || name[last] == '\\') && strcmp(name, "/") !=0) { @@ -3130,7 +3146,7 @@ const char* SystemTools::SplitPathRootComponent(const char* p, // "~u" : root = "~u/", return "" // "~u/" : root = "~u/", return "" // "~u/x" : root = "~u/", return "x" - int n = 1; + size_t n = 1; while(c[n] && c[n] != '/') { ++n; @@ -3221,7 +3237,9 @@ void SystemTools::SplitPath(const char* p, if(*last == '/' || *last == '\\') { // End of a component. Save it. - components.push_back(kwsys_stl::string(first, last-first)); + components.push_back( + kwsys_stl::string(first,static_cast( + last-first))); first = last+1; } } @@ -3229,7 +3247,9 @@ void SystemTools::SplitPath(const char* p, // Save the last component unless there were no components. if(last != c) { - components.push_back(kwsys_stl::string(first, last-first)); + components.push_back( + kwsys_stl::string(first,static_cast( + last-first))); } } @@ -3970,29 +3990,15 @@ bool SystemTools::SetPermissions(const char* file, mode_t mode) kwsys_stl::string SystemTools::GetParentDirectory(const char* fileOrDir) { - if ( !fileOrDir || !*fileOrDir ) - { - return ""; - } - kwsys_stl::string res = fileOrDir; - SystemTools::ConvertToUnixSlashes(res); - kwsys_stl::string::size_type cc = res.size()-1; - if ( res[cc] == '/' ) - { - cc --; - } - for ( ; cc > 0; cc -- ) - { - if ( res[cc] == '/' ) - { - break; - } - } - return res.substr(0, cc); + return SystemTools::GetFilenamePath(fileOrDir); } bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir) { + if(!*cDir) + { + return false; + } kwsys_stl::string subdir = cSubdir; kwsys_stl::string dir = cDir; SystemTools::ConvertToUnixSlashes(dir); @@ -4009,29 +4015,6 @@ bool SystemTools::IsSubDirectory(const char* cSubdir, const char* cDir) return false; } -kwsys_stl::string SystemTools::FileExistsInParentDirectories(const char* fname, - const char* directory, const char* toplevel) -{ - kwsys_stl::string file = fname; - SystemTools::ConvertToUnixSlashes(file); - kwsys_stl::string dir = directory; - SystemTools::ConvertToUnixSlashes(dir); - while ( !dir.empty() ) - { - kwsys_stl::string path = dir + "/" + file; - if ( SystemTools::FileExists(path.c_str()) ) - { - return path; - } - if ( dir.size() < strlen(toplevel) ) - { - break; - } - dir = SystemTools::GetParentDirectory(dir.c_str()); - } - return ""; -} - void SystemTools::Delay(unsigned int msec) { #ifdef _WIN32 diff --git a/GCC_XML/KWSys/SystemTools.hxx.in b/GCC_XML/KWSys/SystemTools.hxx.in index 585e488..94586b0 100644 --- a/GCC_XML/KWSys/SystemTools.hxx.in +++ b/GCC_XML/KWSys/SystemTools.hxx.in @@ -659,14 +659,6 @@ public: const char *dir, kwsys_stl::string& filename_found, int try_filename_dirs = 0); - - /** - * Check if the given file exists in one of the parent directory of the - * given file or directory and if it does, return the name of the file. - * Toplevel specifies the top-most directory to where it will look. - */ - static kwsys_stl::string FileExistsInParentDirectories(const char* fname, - const char* directory, const char* toplevel); /** compute the relative path from local to remote. local must be a directory. remote can be a file or a directory. diff --git a/GCC_XML/KWSys/Terminal.c b/GCC_XML/KWSys/Terminal.c index b492c2f..6bae4ec 100644 --- a/GCC_XML/KWSys/Terminal.c +++ b/GCC_XML/KWSys/Terminal.c @@ -158,6 +158,7 @@ static const char* kwsysTerminalVT100Names[] = "mlterm", "putty", "rxvt", + "rxvt-256color", "rxvt-cygwin", "rxvt-cygwin-native", "rxvt-unicode", diff --git a/GCC_XML/KWSys/Terminal.h.in b/GCC_XML/KWSys/Terminal.h.in index 68c8aa8..0fef3be 100644 --- a/GCC_XML/KWSys/Terminal.h.in +++ b/GCC_XML/KWSys/Terminal.h.in @@ -26,32 +26,34 @@ # define kwsys_ns(x) @KWSYS_NAMESPACE@##x # define kwsysEXPORT @KWSYS_NAMESPACE@_EXPORT #endif -#define kwsysTerminal_cfprintf kwsys_ns(Terminal_cfprintf) -#define kwsysTerminal_Color_e kwsys_ns(Terminal_Color_e) -#define kwsysTerminal_Color_Normal kwsys_ns(Terminal_Color_Normal) -#define kwsysTerminal_Color_ForegroundBlack kwsys_ns(Terminal_Color_ForegroundBlack) -#define kwsysTerminal_Color_ForegroundRed kwsys_ns(Terminal_Color_ForegroundRed) -#define kwsysTerminal_Color_ForegroundGreen kwsys_ns(Terminal_Color_ForegroundGreen) -#define kwsysTerminal_Color_ForegroundYellow kwsys_ns(Terminal_Color_ForegroundYellow) -#define kwsysTerminal_Color_ForegroundBlue kwsys_ns(Terminal_Color_ForegroundBlue) -#define kwsysTerminal_Color_ForegroundMagenta kwsys_ns(Terminal_Color_ForegroundMagenta) -#define kwsysTerminal_Color_ForegroundCyan kwsys_ns(Terminal_Color_ForegroundCyan) -#define kwsysTerminal_Color_ForegroundWhite kwsys_ns(Terminal_Color_ForegroundWhite) -#define kwsysTerminal_Color_ForegroundMask kwsys_ns(Terminal_Color_ForegroundMask) -#define kwsysTerminal_Color_BackgroundBlack kwsys_ns(Terminal_Color_BackgroundBlack) -#define kwsysTerminal_Color_BackgroundRed kwsys_ns(Terminal_Color_BackgroundRed) -#define kwsysTerminal_Color_BackgroundGreen kwsys_ns(Terminal_Color_BackgroundGreen) -#define kwsysTerminal_Color_BackgroundYellow kwsys_ns(Terminal_Color_BackgroundYellow) -#define kwsysTerminal_Color_BackgroundBlue kwsys_ns(Terminal_Color_BackgroundBlue) -#define kwsysTerminal_Color_BackgroundMagenta kwsys_ns(Terminal_Color_BackgroundMagenta) -#define kwsysTerminal_Color_BackgroundCyan kwsys_ns(Terminal_Color_BackgroundCyan) -#define kwsysTerminal_Color_BackgroundWhite kwsys_ns(Terminal_Color_BackgroundWhite) -#define kwsysTerminal_Color_BackgroundMask kwsys_ns(Terminal_Color_BackgroundMask) -#define kwsysTerminal_Color_ForegroundBold kwsys_ns(Terminal_Color_ForegroundBold) -#define kwsysTerminal_Color_BackgroundBold kwsys_ns(Terminal_Color_BackgroundBold) -#define kwsysTerminal_Color_AssumeTTY kwsys_ns(Terminal_Color_AssumeTTY) -#define kwsysTerminal_Color_AssumeVT100 kwsys_ns(Terminal_Color_AssumeVT100) -#define kwsysTerminal_Color_AttributeMask kwsys_ns(Terminal_Color_AttributeMask) +#if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# define kwsysTerminal_cfprintf kwsys_ns(Terminal_cfprintf) +# define kwsysTerminal_Color_e kwsys_ns(Terminal_Color_e) +# define kwsysTerminal_Color_Normal kwsys_ns(Terminal_Color_Normal) +# define kwsysTerminal_Color_ForegroundBlack kwsys_ns(Terminal_Color_ForegroundBlack) +# define kwsysTerminal_Color_ForegroundRed kwsys_ns(Terminal_Color_ForegroundRed) +# define kwsysTerminal_Color_ForegroundGreen kwsys_ns(Terminal_Color_ForegroundGreen) +# define kwsysTerminal_Color_ForegroundYellow kwsys_ns(Terminal_Color_ForegroundYellow) +# define kwsysTerminal_Color_ForegroundBlue kwsys_ns(Terminal_Color_ForegroundBlue) +# define kwsysTerminal_Color_ForegroundMagenta kwsys_ns(Terminal_Color_ForegroundMagenta) +# define kwsysTerminal_Color_ForegroundCyan kwsys_ns(Terminal_Color_ForegroundCyan) +# define kwsysTerminal_Color_ForegroundWhite kwsys_ns(Terminal_Color_ForegroundWhite) +# define kwsysTerminal_Color_ForegroundMask kwsys_ns(Terminal_Color_ForegroundMask) +# define kwsysTerminal_Color_BackgroundBlack kwsys_ns(Terminal_Color_BackgroundBlack) +# define kwsysTerminal_Color_BackgroundRed kwsys_ns(Terminal_Color_BackgroundRed) +# define kwsysTerminal_Color_BackgroundGreen kwsys_ns(Terminal_Color_BackgroundGreen) +# define kwsysTerminal_Color_BackgroundYellow kwsys_ns(Terminal_Color_BackgroundYellow) +# define kwsysTerminal_Color_BackgroundBlue kwsys_ns(Terminal_Color_BackgroundBlue) +# define kwsysTerminal_Color_BackgroundMagenta kwsys_ns(Terminal_Color_BackgroundMagenta) +# define kwsysTerminal_Color_BackgroundCyan kwsys_ns(Terminal_Color_BackgroundCyan) +# define kwsysTerminal_Color_BackgroundWhite kwsys_ns(Terminal_Color_BackgroundWhite) +# define kwsysTerminal_Color_BackgroundMask kwsys_ns(Terminal_Color_BackgroundMask) +# define kwsysTerminal_Color_ForegroundBold kwsys_ns(Terminal_Color_ForegroundBold) +# define kwsysTerminal_Color_BackgroundBold kwsys_ns(Terminal_Color_BackgroundBold) +# define kwsysTerminal_Color_AssumeTTY kwsys_ns(Terminal_Color_AssumeTTY) +# define kwsysTerminal_Color_AssumeVT100 kwsys_ns(Terminal_Color_AssumeVT100) +# define kwsysTerminal_Color_AttributeMask kwsys_ns(Terminal_Color_AttributeMask) +#endif #if defined(__cplusplus) extern "C" @@ -126,32 +128,34 @@ enum kwsysTerminal_Color_e #if !defined(KWSYS_NAMESPACE) # undef kwsys_ns # undef kwsysEXPORT -# undef kwsysTerminal_cfprintf -# undef kwsysTerminal_Color_e -# undef kwsysTerminal_Color_Normal -# undef kwsysTerminal_Color_ForegroundBlack -# undef kwsysTerminal_Color_ForegroundRed -# undef kwsysTerminal_Color_ForegroundGreen -# undef kwsysTerminal_Color_ForegroundYellow -# undef kwsysTerminal_Color_ForegroundBlue -# undef kwsysTerminal_Color_ForegroundMagenta -# undef kwsysTerminal_Color_ForegroundCyan -# undef kwsysTerminal_Color_ForegroundWhite -# undef kwsysTerminal_Color_ForegroundMask -# undef kwsysTerminal_Color_BackgroundBlack -# undef kwsysTerminal_Color_BackgroundRed -# undef kwsysTerminal_Color_BackgroundGreen -# undef kwsysTerminal_Color_BackgroundYellow -# undef kwsysTerminal_Color_BackgroundBlue -# undef kwsysTerminal_Color_BackgroundMagenta -# undef kwsysTerminal_Color_BackgroundCyan -# undef kwsysTerminal_Color_BackgroundWhite -# undef kwsysTerminal_Color_BackgroundMask -# undef kwsysTerminal_Color_ForegroundBold -# undef kwsysTerminal_Color_BackgroundBold -# undef kwsysTerminal_Color_AssumeTTY -# undef kwsysTerminal_Color_AssumeVT100 -# undef kwsysTerminal_Color_AttributeMask +# if !@KWSYS_NAMESPACE@_NAME_IS_KWSYS +# undef kwsysTerminal_cfprintf +# undef kwsysTerminal_Color_e +# undef kwsysTerminal_Color_Normal +# undef kwsysTerminal_Color_ForegroundBlack +# undef kwsysTerminal_Color_ForegroundRed +# undef kwsysTerminal_Color_ForegroundGreen +# undef kwsysTerminal_Color_ForegroundYellow +# undef kwsysTerminal_Color_ForegroundBlue +# undef kwsysTerminal_Color_ForegroundMagenta +# undef kwsysTerminal_Color_ForegroundCyan +# undef kwsysTerminal_Color_ForegroundWhite +# undef kwsysTerminal_Color_ForegroundMask +# undef kwsysTerminal_Color_BackgroundBlack +# undef kwsysTerminal_Color_BackgroundRed +# undef kwsysTerminal_Color_BackgroundGreen +# undef kwsysTerminal_Color_BackgroundYellow +# undef kwsysTerminal_Color_BackgroundBlue +# undef kwsysTerminal_Color_BackgroundMagenta +# undef kwsysTerminal_Color_BackgroundCyan +# undef kwsysTerminal_Color_BackgroundWhite +# undef kwsysTerminal_Color_BackgroundMask +# undef kwsysTerminal_Color_ForegroundBold +# undef kwsysTerminal_Color_BackgroundBold +# undef kwsysTerminal_Color_AssumeTTY +# undef kwsysTerminal_Color_AssumeVT100 +# undef kwsysTerminal_Color_AttributeMask +# endif #endif #endif diff --git a/GCC_XML/KWSys/kwsysDateStamp.cmake b/GCC_XML/KWSys/kwsysDateStamp.cmake index 55e683c..94822aa 100644 --- a/GCC_XML/KWSys/kwsysDateStamp.cmake +++ b/GCC_XML/KWSys/kwsysDateStamp.cmake @@ -4,7 +4,7 @@ SET(KWSYS_DATE_STAMP_YEAR 2009) # KWSys version date month component. Format is MM. -SET(KWSYS_DATE_STAMP_MONTH 03) +SET(KWSYS_DATE_STAMP_MONTH 05) # KWSys version date day component. Format is DD. -SET(KWSYS_DATE_STAMP_DAY 02) +SET(KWSYS_DATE_STAMP_DAY 19) diff --git a/GCC_XML/KWSys/kwsysPrivate.h b/GCC_XML/KWSys/kwsysPrivate.h index eabee0e..e021170 100644 --- a/GCC_XML/KWSys/kwsysPrivate.h +++ b/GCC_XML/KWSys/kwsysPrivate.h @@ -22,7 +22,7 @@ Define KWSYS_HEADER macro to help the c and cxx files include kwsys headers from the configured namespace directory. The macro can be used like this: - + #include KWSYS_HEADER(Directory.hxx) #include KWSYS_HEADER(std/vector) */ @@ -39,5 +39,7 @@ #define KWSYS_NAMESPACE_STRING1(x) #x #else -# error "kwsysPrivate.h included multiple times." +# ifndef __VMS /* Avoid strange false positive on VMS compiler. */ +# error "kwsysPrivate.h included multiple times." +# endif #endif diff --git a/GCC_XML/KWSys/testIOS.cxx b/GCC_XML/KWSys/testIOS.cxx index e4e0a2d..5b65d20 100644 --- a/GCC_XML/KWSys/testIOS.cxx +++ b/GCC_XML/KWSys/testIOS.cxx @@ -12,15 +12,39 @@ # include "kwsys_ios_iostream.h.in" #endif +#include /* strlen */ + int testIOS(int, char*[]) { kwsys_ios::ostringstream ostr; - ostr << "hello"; - if(ostr.str() != "hello") + const char hello[] = "hello"; + ostr << hello; + if(ostr.str() != hello) { kwsys_ios::cerr << "failed to write hello to ostr" << kwsys_ios::endl; return 1; } + const char world[] = "world"; + kwsys_ios::ostringstream ostr2; + ostr2.write( hello, strlen(hello) ); /* I could do sizeof */ + ostr2.put( '\0' ); + ostr2.write( world, strlen(world) ); + if(ostr2.str().size() != strlen(hello) + 1 + strlen(world) ) + { + kwsys_ios::cerr << "failed to write hello to ostr2" << kwsys_ios::endl; + return 1; + } + static const unsigned char array[] = { 0xff,0x4f,0xff,0x51,0x00,0x29,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x30,0x00,0x00,0x00,0x3e,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x01,0x07,0x01,0x01,0xff,0x52,0x00,0x0c,0x00,0x00,0x00,0x01,0x00,0x05,0x04,0x04,0x00,0x01,0xff,0x5c,0x00,0x13,0x40,0x40,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0x48,0x48,0x50,0xff,0x64,0x00,0x2c,0x00,0x00,0x43,0x72,0x65,0x61,0x74,0x65,0x64,0x20,0x62,0x79,0x20,0x49,0x54,0x4b,0x2f,0x47,0x44,0x43,0x4d,0x2f,0x4f,0x70,0x65,0x6e,0x4a,0x50,0x45,0x47,0x20,0x76,0x65,0x72,0x73,0x69,0x6f,0x6e,0x20,0x31,0x2e,0x30,0xff,0x90,0x00,0x0a,0x00,0x00,0x00,0x00,0x06,0x2c,0x00,0x01,0xff,0x93,0xcf,0xb0,0x18,0x08,0x7f,0xc6,0x99,0xbf,0xff,0xc0,0xf8,0xc1,0xc1,0xf3,0x05,0x81,0xf2,0x83,0x0a,0xa5,0xff,0x10,0x90,0xbf,0x2f,0xff,0x04,0xa8,0x7f,0xc0,0xf8,0xc4,0xc1,0xf3,0x09,0x81,0xf3,0x0c,0x19,0x34 }; + const unsigned int narray = sizeof(array); // 180 + kwsys_ios::stringstream strstr; + strstr.write( (char*)array, narray ); + //strstr.seekp( narray / 2 ); // set position of put pointer in mid string + if(strstr.str().size() != narray ) + { + kwsys_ios::cerr << "failed to write array to strstr" << kwsys_ios::endl; + return 1; + } + kwsys_ios::istringstream istr(" 10 20 str "); kwsys_stl::string s; int x; diff --git a/GCC_XML/KWSys/testSystemInformation.cxx b/GCC_XML/KWSys/testSystemInformation.cxx index 179dc80..7264f56 100644 --- a/GCC_XML/KWSys/testSystemInformation.cxx +++ b/GCC_XML/KWSys/testSystemInformation.cxx @@ -26,13 +26,21 @@ #define printMethod(inof, m) kwsys_ios::cout << #m << ": " \ << info.m() << "\n" + +#define printMethod2(inof, m, unit) kwsys_ios::cout << #m << ": " \ +<< info.m() << " " << unit << "\n" + int testSystemInformation(int, char*[]) { kwsys::SystemInformation info; - printMethod(info, GetVendorString); info.RunCPUCheck(); info.RunOSCheck(); info.RunMemoryCheck(); + printMethod(info, GetOSName); + printMethod(info, GetHostname); + printMethod(info, GetOSRelease); + printMethod(info, GetOSVersion); + printMethod(info, GetOSPlatform); printMethod(info, GetVendorString); printMethod(info, GetVendorID); printMethod(info, GetTypeID); @@ -40,24 +48,19 @@ int testSystemInformation(int, char*[]) printMethod(info, GetModelID); printMethod(info, GetExtendedProcessorName); printMethod(info, GetProcessorSerialNumber); - printMethod(info, GetProcessorCacheSize); + printMethod2(info, GetProcessorCacheSize, "KB"); printMethod(info, GetLogicalProcessorsPerPhysical); - printMethod(info, GetProcessorClockFrequency); - printMethod(info, GetProcessorAPICID); - printMethod(info, GetOSName); - printMethod(info, GetHostname); - printMethod(info, GetOSRelease); - printMethod(info, GetOSVersion); - printMethod(info, GetOSPlatform); + printMethod2(info, GetProcessorClockFrequency, "MHz"); printMethod(info, Is64Bits); printMethod(info, GetNumberOfLogicalCPU); printMethod(info, GetNumberOfPhysicalCPU); printMethod(info, DoesCPUSupportCPUID); - printMethod(info, GetTotalVirtualMemory); - printMethod(info, GetAvailableVirtualMemory); - printMethod(info, GetTotalPhysicalMemory); - printMethod(info, GetAvailablePhysicalMemory); - + printMethod(info, GetProcessorAPICID); + printMethod2(info, GetTotalVirtualMemory, "MB"); + printMethod2(info, GetAvailableVirtualMemory, "MB"); + printMethod2(info, GetTotalPhysicalMemory, "MB"); + printMethod2(info, GetAvailablePhysicalMemory, "MB"); + //int GetProcessorCacheXSize(long int); // bool DoesCPUSupportFeature(long int); return 0; diff --git a/GCC_XML/VcInstall/vc9Include.patch b/GCC_XML/VcInstall/vc9Include.patch index 93316e5..5140cc5 100644 --- a/GCC_XML/VcInstall/vc9Include.patch +++ b/GCC_XML/VcInstall/vc9Include.patch @@ -1239,6 +1239,43 @@ diff -c -3 -p -r1.1 -r1.2 _Next != _Myvec.end(); ++_Next) *_Next = (_Vbase)~*_Next; _Trim(_Mysize); +Index: xdebug +=================================================================== +RCS file: /cvsroot/GxInclude/Vc9/Include/xdebug,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xdebug 29 Jan 2008 21:05:21 -0000 1.1 +--- xdebug 19 May 2009 12:59:33 -0000 1.2 +*************** template +*** 55,61 **** +--- 55,63 ---- + { // delete from the debug CRT heap even if operator delete exists + if (_Ptr != 0) + { // worth deleting ++ #if 0 + _Ptr->~_Ty(); ++ #endif + // delete as _NORMAL_BLOCK, not _CRT_BLOCK, since we might have + // facets allocated by normal new. + free(_Ptr); +*************** public: +*** 72,78 **** + template + struct rebind + { // convert _DebugHeapAllocator<_Ty> to _DebugHeapAllocator<_Other> +! typedef typename _DebugHeapAllocator<_Other> other; + }; + + typename allocator<_Ty>::pointer __CLRCALL_OR_CDECL allocate(typename allocator<_Ty>::size_type _Count, const void *) +--- 74,80 ---- + template + struct rebind + { // convert _DebugHeapAllocator<_Ty> to _DebugHeapAllocator<_Other> +! typedef _DebugHeapAllocator<_Other> other; + }; + + typename allocator<_Ty>::pointer __CLRCALL_OR_CDECL allocate(typename allocator<_Ty>::size_type _Count, const void *) Index: xhash =================================================================== RCS file: /cvsroot/GxInclude/Vc9/Include/xhash,v @@ -1806,10 +1843,10 @@ Index: yvals.h =================================================================== RCS file: /cvsroot/GxInclude/Vc9/Include/yvals.h,v retrieving revision 1.1 -retrieving revision 1.5 -diff -c -3 -p -r1.1 -r1.5 +retrieving revision 1.6 +diff -c -3 -p -r1.1 -r1.6 *** yvals.h 29 Jan 2008 21:05:21 -0000 1.1 ---- yvals.h 15 Dec 2008 20:36:52 -0000 1.5 +--- yvals.h 19 May 2009 13:00:05 -0000 1.6 *************** *** 116,122 **** #define _STR2WSTR(str) __STR2WSTR(str) @@ -1876,6 +1913,23 @@ diff -c -3 -p -r1.1 -r1.5 /* INTEGER PROPERTIES */ #define _C2 1 /* 0 if not 2's complement */ +*************** _C_STD_END +*** 822,828 **** + + #ifdef _MSC_VER + #define _EXTERN_TEMPLATE template +! #define _THROW_BAD_ALLOC _THROW1(...) + #pragma pack(pop) + #endif /* _MSC_VER */ + +--- 843,849 ---- + + #ifdef _MSC_VER + #define _EXTERN_TEMPLATE template +! #define _THROW_BAD_ALLOC + #pragma pack(pop) + #endif /* _MSC_VER */ + Index: CodeAnalysis/sourceannotations.h =================================================================== RCS file: /cvsroot/GxInclude/Vc9/Include/CodeAnalysis/sourceannotations.h,v diff --git a/GCC_XML/VcInstall/vc9sp1Include.patch b/GCC_XML/VcInstall/vc9sp1Include.patch index 641dfa6..82ca59c 100644 --- a/GCC_XML/VcInstall/vc9sp1Include.patch +++ b/GCC_XML/VcInstall/vc9sp1Include.patch @@ -72,9 +72,10 @@ Index: crtdefs.h =================================================================== RCS file: /cvsroot/GxInclude/Vc9sp1/Include/crtdefs.h,v retrieving revision 1.1 -diff -c -3 -p -r1.1 crtdefs.h +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 *** crtdefs.h 6 Jan 2009 21:18:02 -0000 1.1 ---- crtdefs.h 9 Jan 2009 13:53:55 -0000 +--- crtdefs.h 6 Jan 2009 21:21:23 -0000 1.2 *************** typedef __time64_t time_t; /* time *** 666,764 **** #define __DEFINE_CPP_OVERLOAD_SECURE_FUNC_0_0(_ReturnType, _FuncName, _DstType, _Dst) \ @@ -1238,6 +1239,43 @@ diff -c -3 -p -r1.1 -r1.2 _Next != _Myvec.end(); ++_Next) *_Next = (_Vbase)~*_Next; _Trim(_Mysize); +Index: xdebug +=================================================================== +RCS file: /cvsroot/GxInclude/Vc9sp1/Include/xdebug,v +retrieving revision 1.1 +retrieving revision 1.2 +diff -c -3 -p -r1.1 -r1.2 +*** xdebug 6 Jan 2009 21:19:25 -0000 1.1 +--- xdebug 19 May 2009 12:59:33 -0000 1.2 +*************** template +*** 55,61 **** +--- 55,63 ---- + { // delete from the debug CRT heap even if operator delete exists + if (_Ptr != 0) + { // worth deleting ++ #if 0 + _Ptr->~_Ty(); ++ #endif + // delete as _NORMAL_BLOCK, not _CRT_BLOCK, since we might have + // facets allocated by normal new. + free(_Ptr); +*************** public: +*** 72,78 **** + template + struct rebind + { // convert _DebugHeapAllocator<_Ty> to _DebugHeapAllocator<_Other> +! typedef typename _DebugHeapAllocator<_Other> other; + }; + + typename allocator<_Ty>::pointer __CLRCALL_OR_CDECL allocate(typename allocator<_Ty>::size_type _Count, const void *) +--- 74,80 ---- + template + struct rebind + { // convert _DebugHeapAllocator<_Ty> to _DebugHeapAllocator<_Other> +! typedef _DebugHeapAllocator<_Other> other; + }; + + typename allocator<_Ty>::pointer __CLRCALL_OR_CDECL allocate(typename allocator<_Ty>::size_type _Count, const void *) Index: xhash =================================================================== RCS file: /cvsroot/GxInclude/Vc9sp1/Include/xhash,v @@ -2295,10 +2333,10 @@ Index: yvals.h =================================================================== RCS file: /cvsroot/GxInclude/Vc9sp1/Include/yvals.h,v retrieving revision 1.1 -retrieving revision 1.3 -diff -c -3 -p -r1.1 -r1.3 +retrieving revision 1.4 +diff -c -3 -p -r1.1 -r1.4 *** yvals.h 6 Jan 2009 21:18:02 -0000 1.1 ---- yvals.h 6 Jan 2009 21:48:10 -0000 1.3 +--- yvals.h 19 May 2009 13:00:05 -0000 1.4 *************** *** 11,16 **** --- 11,35 ---- @@ -2393,6 +2431,23 @@ diff -c -3 -p -r1.1 -r1.3 /* INTEGER PROPERTIES */ #define _C2 1 /* 0 if not 2's complement */ +*************** _C_STD_END +*** 826,832 **** + + #ifdef _MSC_VER + #define _EXTERN_TEMPLATE template +! #define _THROW_BAD_ALLOC _THROW1(...) + #pragma pack(pop) + #endif /* _MSC_VER */ + +--- 866,872 ---- + + #ifdef _MSC_VER + #define _EXTERN_TEMPLATE template +! #define _THROW_BAD_ALLOC + #pragma pack(pop) + #endif /* _MSC_VER */ + Index: CodeAnalysis/sourceannotations.h =================================================================== RCS file: /cvsroot/GxInclude/Vc9sp1/Include/CodeAnalysis/sourceannotations.h,v