diff --git a/checkin_notes b/checkin_notes index 46463995be..41175335dd 100755 --- a/checkin_notes +++ b/checkin_notes @@ -13460,3 +13460,14 @@ Rom 13 June 2004 client/ gui_rpc_server.C + +Rom 13 June 2004 + - Do some more header file work and fix util.c so it'll compile on unix + platforms again. + + client/ + miofile.C, .h + stdafx.h + lib/ + base64.C, .h + util.C \ No newline at end of file diff --git a/client/http.C b/client/http.C index 7afa0fd09a..945b6bd00d 100644 --- a/client/http.C +++ b/client/http.C @@ -50,10 +50,10 @@ using std::string; #include "client_msgs.h" #include "http.h" +#include "base64.h" #define HTTP_BLOCKSIZE 16384 -#include "..\lib\base64.h" // Breaks a HTTP url down into its server and file path components // diff --git a/client/miofile.C b/client/miofile.C index a043df1b73..013ffead8a 100644 --- a/client/miofile.C +++ b/client/miofile.C @@ -1,5 +1,32 @@ +// The contents of this file are subject to the BOINC Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://boinc.berkeley.edu/license_1.0.txt +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// +// The Initial Developer of the Original Code is the SETI@home project. +// Portions created by the SETI@home project are Copyright (C) 2002 +// University of California at Berkeley. All Rights Reserved. +// +// Contributor(s): +// + +#ifdef _WIN32 +#include "stdafx.h" +#endif + +#ifndef _WIN32 +#include #include #include +using namespace std; +#endif #include "error_numbers.h" #include "miofile.h" diff --git a/client/miofile.h b/client/miofile.h index a6cbbf59e4..cd6c6187ed 100644 --- a/client/miofile.h +++ b/client/miofile.h @@ -1,10 +1,25 @@ +// The contents of this file are subject to the BOINC Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://boinc.berkeley.edu/license_1.0.txt +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// +// The Initial Developer of the Original Code is the SETI@home project. +// Portions created by the SETI@home project are Copyright (C) 2002 +// University of California at Berkeley. All Rights Reserved. +// +// Contributor(s): +// + #ifndef _MIOFILE_ #define _MIOFILE_ -#ifdef _WIN32 -#include "stdafx.h" -#endif - #ifndef _WIN32 #include using namespace std; diff --git a/client/stdafx.h b/client/stdafx.h index 57db2d235a..ec834f17ed 100644 --- a/client/stdafx.h +++ b/client/stdafx.h @@ -101,6 +101,7 @@ #include #include #include +#include // Standard C Runtime libraries diff --git a/lib/base64.C b/lib/base64.C index c0d0a1c5dc..d4cdf17726 100644 --- a/lib/base64.C +++ b/lib/base64.C @@ -1,4 +1,25 @@ -// Copyright 2003 Regents of the University of California +// The contents of this file are subject to the BOINC Public License +// Version 1.0 (the "License"); you may not use this file except in +// compliance with the License. You may obtain a copy of the License at +// http://boinc.berkeley.edu/license_1.0.txt +// +// Software distributed under the License is distributed on an "AS IS" +// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the +// License for the specific language governing rights and limitations +// under the License. +// +// The Original Code is the Berkeley Open Infrastructure for Network Computing. +// +// The Initial Developer of the Original Code is the SETI@home project. +// Portions created by the SETI@home project are Copyright (C) 2002 +// University of California at Berkeley. All Rights Reserved. +// +// Contributor(s): +// + +#ifdef _WIN32 +#include "stdafx.h" +#endif #include "base64.h" @@ -50,7 +71,7 @@ static short base64_char_to_value[128] = The octets are divided into 6 bit chunks, which are then encoded into base64 characters. */ -string r_base64_encode (const char* from, size_t length) throw(InvalidBase64Exception) +string r_base64_encode (const char* from, size_t length) { string result; result.reserve(length + length/3 + 1); @@ -112,7 +133,7 @@ string r_base64_encode (const char* from, size_t length) throw(InvalidBase64Exce } \ while (IS_BASE64_IGNORABLE (c)) -string r_base64_decode (const char* from, size_t length) throw(InvalidBase64Exception) +string r_base64_decode (const char* from, size_t length) { size_t i = 0; string result; diff --git a/lib/base64.h b/lib/base64.h index fece9ea3a1..29b65d205b 100644 --- a/lib/base64.h +++ b/lib/base64.h @@ -20,19 +20,20 @@ #ifndef h_BASE64 #define h_BASE64 +#ifndef _WIN32 #include #include #include - -using std::string; +using namespace std; +#endif class InvalidBase64Exception { }; -string r_base64_encode (const char* from, size_t length) throw(InvalidBase64Exception); -string r_base64_decode (const char* from, size_t length) throw(InvalidBase64Exception); -inline string r_base64_decode (string const& from) throw(InvalidBase64Exception) +string r_base64_encode (const char* from, size_t length); +string r_base64_decode (const char* from, size_t length); +inline string r_base64_decode (string const& from) { return r_base64_decode(from.c_str(), from.length()); } diff --git a/lib/util.C b/lib/util.C index eb7ad38bd2..a0dc32ebb6 100755 --- a/lib/util.C +++ b/lib/util.C @@ -403,7 +403,9 @@ inline void replace_string( } } - +// In order for toupper and tolower to work under certain conditions +// it needs to know about local. +// See: http://linux-rep.fnal.gov/software/gcc/onlinedocs/libstdc++/22_locale/howto.html#7 struct Tolower { Tolower (std::locale const& l) : loc(l) {;} diff --git a/win_build/boinc_cli.vcproj b/win_build/boinc_cli.vcproj index e55254e6ac..8b1e85f345 100644 --- a/win_build/boinc_cli.vcproj +++ b/win_build/boinc_cli.vcproj @@ -23,7 +23,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../lib/,../api/,../RSAEuro/source/,../client/win/,../client" - PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE" + PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;_CONSOLE;HAVE_STD_TRANSFORM;HAVE_STD_MIN;HAVE_STD_MAX" MinimalRebuild="TRUE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -1086,6 +1086,9 @@ + + @@ -1102,7 +1105,7 @@ RelativePath="..\client\file_xfer.h"> + RelativePath="..\lib\filesys.h"> @@ -1122,9 +1125,6 @@ - - diff --git a/win_build/boinc_gui.vcproj b/win_build/boinc_gui.vcproj index 418015fc12..ff2eb84743 100644 --- a/win_build/boinc_gui.vcproj +++ b/win_build/boinc_gui.vcproj @@ -96,7 +96,7 @@ Name="VCCLCompilerTool" Optimization="0" AdditionalIncludeDirectories="../lib/,../api/,../RSAEuro/source/,../client/win/,../client" - PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS" + PreprocessorDefinitions="WIN32;_DEBUG;_MT;_WINDOWS;HAVE_STD_TRANSFORM;HAVE_STD_MIN;HAVE_STD_MAX" BasicRuntimeChecks="3" RuntimeLibrary="1" UsePrecompiledHeader="2" @@ -1337,6 +1337,9 @@ + + @@ -1384,10 +1387,10 @@ Name="Resource Files" Filter="ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"> + RelativePath="..\client\win\res\boinc.bmp"> + RelativePath="..\client\win\boinc.bmp"> @@ -1407,10 +1410,10 @@ + RelativePath="..\client\win\boincsm.bmp"> + RelativePath="..\client\win\res\boincsm.bmp">