From d46b5a15f0437a1c0d1b66f856b4937df229acfd Mon Sep 17 00:00:00 2001 From: Bruce Allen Date: Thu, 2 Dec 2004 12:40:16 +0000 Subject: [PATCH] - Fixed boinc_zip.h so that it works correctly under both C++ and C under both Unix and Win32. svn path=/trunk/boinc/; revision=4699 --- checkin_notes | 7 +++++++ zip/boinc_zip.h | 23 +++++++++++++---------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/checkin_notes b/checkin_notes index 7724336ddf..1243a4c1d1 100755 --- a/checkin_notes +++ b/checkin_notes @@ -20486,3 +20486,10 @@ Rom 2 Dec 2004 ViewWork.cpp, .h clientgui/msw/ taskbarex.h + +Bruce 2 Dec 2004 + - Fixed boinc_zip.h so that it works correctly under both C++ and + C under both Unix and Win32. + + zip/ + boinc_zip.h diff --git a/zip/boinc_zip.h b/zip/boinc_zip.h index 7c46891a73..03f8188348 100644 --- a/zip/boinc_zip.h +++ b/zip/boinc_zip.h @@ -11,13 +11,13 @@ // also you will need to include filesys.C in your project // (decided not to add that in the lib due to version problems that may arise) +#ifdef __cplusplus #include #include +#endif #include #include -using std::string; - #define ZIP_IT 1 #define UNZIP_IT 0 @@ -29,6 +29,9 @@ using std::string; #define SORT_TIME 0x10 #define SORT_NAME 0x20 +#ifdef __cplusplus +using std::string; + class ZipFileEntry :public std::string { public: @@ -61,19 +64,19 @@ typedef std::vector ZipFileList; // the vector of string's, and probably better than using wildcards in zip // across platforms -#ifdef __cplusplus -extern "C" -#else -extern -#endif -int boinc_zip(int bZipType, const std::string szFileZip, const ZipFileList* pvectszFileIn); -int boinc_zip(int bZipType, const std::string szFileZip, const std::string szFileIn); -int boinc_zip(int bZipType, const char* szFileZip, const char* szFileIn); bool boinc_filelist(const std::string directory, const std::string pattern, ZipFileList* pList, const unsigned char ucSort = SORT_NAME | SORT_DESCENDING, const bool bClear = true); +int boinc_zip(int bZipType, const std::string szFileZip, const ZipFileList* pvectszFileIn); +int boinc_zip(int bZipType, const std::string szFileZip, const std::string szFileIn); +extern "C" +#else +extern +#endif +int boinc_zip(int bZipType, const char* szFileZip, const char* szFileIn); +