blob: 67b84827de2956d4fb88a2990e3d3d44fcc92295 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
|
////////////////////////////////////////////////////////////////////////////////
// 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
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// For the licensing details refer to the License.txt file.
//
// Web Site: https://www.artpol-software.com
////////////////////////////////////////////////////////////////////////////////
#ifndef ZIPARCHIVE_STDAFX_DOT_H
#error Do not include this file directly. Include stdafx.h instead
#endif
#include "_features.h"
#if defined DEBUG && !defined _DEBUG
#define _DEBUG
#endif
#if _MSC_VER > 1000
// STL warnings
#pragma warning (disable : 4710) // 'function' : function not inlined
#pragma warning (disable : 4514) // unreferenced inline/local function has been removed
#pragma warning (disable : 4786) // 'identifier' : identifier was truncated to 'number' characters in the debug information
#pragma warning (disable : 4702) // unreachable code
#endif
#if defined (_UNICODE) && !defined (UNICODE)
#define UNICODE
#endif
#if defined (UNICODE) && !defined (_UNICODE)
#define _UNICODE
#endif
#if !defined WIN32 && !defined _WIN32
#ifndef NULL
#define NULL 0
#endif
#include <cctype>
#include <climits>
typedef int HFILE;
typedef void* HANDLE;
typedef unsigned int DWORD;
typedef long LONG;
typedef int ZBOOL; /* to avoid conflicts when using Objective-C */
typedef unsigned char BYTE;
typedef unsigned short WORD;
typedef unsigned int UINT;
#ifndef FALSE
#define FALSE (int)0
#endif
#ifndef TRUE
#define TRUE (int)1
#endif
#ifdef _UNICODE
typedef wchar_t WCHAR; // wc, 16-bit UNICODE character
#include <wchar.h>
#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;
typedef char *LPSTR;
#ifdef _UNICODE
typedef wchar_t TCHAR;
typedef LPCWSTR LPCTSTR;
typedef LPWSTR LPTSTR;
#define _T(x) L ## x
#else /* _UNICODE */ // r_winnt
typedef char TCHAR;
typedef LPCSTR LPCTSTR;
typedef LPSTR LPTSTR;
#ifdef _T
#undef _T
#endif
#define _T(x) x
#endif /* _UNICODE */ // r_winnt
typedef unsigned long long ULONGLONG;
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
#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
#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 <TCHAR.H>
#include <windows.h>
#include <stddef.h>
#ifndef _I64_MAX
#include <limits.h>
#endif
#ifndef STRICT
#define STRICT
#endif
typedef BOOL ZBOOL;
typedef FILETIME ZFILETIME;
#endif // #if !defined WIN32 && !defined _WIN32
#ifndef ASSERT
#ifdef _DEBUG
#include <assert.h>
#define ASSERT(f) assert((f))
#else
#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
|