From 02d6107c97b48888362e7c6a70dcac323c89d741 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Sun, 17 Dec 2023 21:23:58 +0100 Subject: ZipArchive: Update to the 4.6.9 release --- zip/ZipArchive/std_stl.h | 74 ++++++++++++++++++++++++++++++++++++------------ 1 file changed, 56 insertions(+), 18 deletions(-) (limited to 'zip/ZipArchive/std_stl.h') diff --git a/zip/ZipArchive/std_stl.h b/zip/ZipArchive/std_stl.h index c54d0bf..67b8482 100644 --- a/zip/ZipArchive/std_stl.h +++ b/zip/ZipArchive/std_stl.h @@ -1,6 +1,6 @@ //////////////////////////////////////////////////////////////////////////////// -// This source file is part of the ZipArchive library source distribution and -// is Copyrighted 2000 - 2007 by Artpol Software - Tadeusz Dracz +// This source file is part of the ZipArchive Library Open Source distribution +// and is Copyrighted 2000 - 2022 by Artpol Software - Tadeusz Dracz // // This program is free software; you can redistribute it and/or // modify it under the terms of the GNU General Public License @@ -9,7 +9,7 @@ // // For the licensing details refer to the License.txt file. // -// Web Site: http://www.artpol-software.com +// Web Site: https://www.artpol-software.com //////////////////////////////////////////////////////////////////////////////// #ifndef ZIPARCHIVE_STDAFX_DOT_H @@ -17,7 +17,10 @@ #endif #include "_features.h" -#include + +#if defined DEBUG && !defined _DEBUG + #define _DEBUG +#endif #if _MSC_VER > 1000 // STL warnings @@ -34,17 +37,19 @@ #define _UNICODE #endif -#ifndef _WIN32 +#if !defined WIN32 && !defined _WIN32 + #ifndef NULL #define NULL 0 #endif - #include + #include + #include typedef int HFILE; typedef void* HANDLE; - typedef unsigned long DWORD; + typedef unsigned int DWORD; typedef long LONG; - typedef int ZBOOL; /* to avoid conflicts when using Objective-C under Mac */ + typedef int ZBOOL; /* to avoid conflicts when using Objective-C */ typedef unsigned char BYTE; typedef unsigned short WORD; typedef unsigned int UINT; @@ -57,8 +62,19 @@ #define TRUE (int)1 #endif +#ifdef _UNICODE + typedef wchar_t WCHAR; // wc, 16-bit UNICODE character + #include + #define _ZIP_WIDE_TO_MULTIBYTE(input, variable) LPCSTR variable;\ + CZipAutoBuffer variable##Buffer;\ + ZipPlatform::WideToMultiByte(input, variable##Buffer, true, 0);\ + variable = variable##Buffer; +#else typedef unsigned short WCHAR; // wc, 16-bit UNICODE character + #define _ZIP_WIDE_TO_MULTIBYTE(input, variable) LPCSTR variable = input; +#endif + typedef const WCHAR *LPCWSTR; typedef const char *LPCSTR; typedef WCHAR *LPWSTR; @@ -83,45 +99,67 @@ typedef long long LONGLONG; #define CP_ACP 0 #define CP_OEMCP 1 + + #ifndef CP_UTF8 + #define CP_UTF8 65001 + #endif + #ifndef _I64_MAX #ifdef LLONG_MAX #define _I64_MAX LLONG_MAX - #else + #elif defined LONG_LONG_MAX #define _I64_MAX LONG_LONG_MAX + #else + #define _I64_MAX LONGLONG_MAX #endif #endif #ifndef _UI64_MAX #ifdef ULLONG_MAX #define _UI64_MAX ULLONG_MAX - #else + #elif defined ULONG_LONG_MAX #define _UI64_MAX ULONG_LONG_MAX + #else + #define _UI64_MAX ULONGLONG_MAX #endif #endif #define _lseeki64 lseek64 + + typedef struct + { + DWORD dwLowDateTime; + DWORD dwHighDateTime; + } ZFILETIME; + #else #include - #include + #include #include +#ifndef _I64_MAX + #include +#endif #ifndef STRICT #define STRICT #endif typedef BOOL ZBOOL; + typedef FILETIME ZFILETIME; -#endif // #ifndef _WIN32 +#endif // #if !defined WIN32 && !defined _WIN32 #ifndef ASSERT - #include - #define ASSERT(f) assert((f)) -#endif -#ifndef VERIFY #ifdef _DEBUG - #define VERIFY(x) ASSERT((x)) + #include + #define ASSERT(f) assert((f)) #else - #define VERIFY(x) x + #define ASSERT(f) #endif #endif #define ZIP_FILE_USIZE ULONGLONG #define ZIP_FILE_SIZE LONGLONG #define ZIP_FILE_SIZEMAX _I64_MAX +#ifndef _NOEXCEPT // for OS X + #define _NOEXCEPT +#endif + + -- cgit v1.2.3