~ubuntu-branches/ubuntu/wily/unrar-nonfree/wily-proposed

« back to all changes in this revision

Viewing changes to os.hpp

  • Committer: Package Import Robot
  • Author(s): Nick Andrik
  • Date: 2013-01-21 23:07:40 UTC
  • mto: This revision was merged to the branch mainline in revision 19.
  • Revision ID: package-import@ubuntu.com-20130121230740-72rp8g92rch565c6
Tags: upstream-4.2.4
ImportĀ upstreamĀ versionĀ 4.2.4

Show diffs side-by-side

added added

removed removed

Lines of Context:
12
12
#define SILENT
13
13
#endif
14
14
 
15
 
#if defined(_WIN_ALL) || defined(_EMX)
16
 
#define ENABLE_BAD_ALLOC
 
15
#define ENABLE_BAD_ALLOC // Undefine if std::bad_alloc is not supported.
 
16
 
 
17
#ifdef ENABLE_BAD_ALLOC
 
18
  #include <new>
17
19
#endif
18
20
 
19
21
 
24
26
 
25
27
#ifdef _WIN_ALL
26
28
 
27
 
  #define STRICT
28
 
  #define UNICODE
29
 
  #undef WINVER
30
 
  #undef _WIN32_WINNT
31
 
  #define WINVER 0x0500
32
 
  #define _WIN32_WINNT 0x0500
 
29
#define STRICT
 
30
#define UNICODE
 
31
#undef WINVER
 
32
#undef _WIN32_WINNT
 
33
#define WINVER 0x0501
 
34
#define _WIN32_WINNT 0x0501
33
35
 
34
36
 
35
37
#define WIN32_LEAN_AND_MEAN
37
39
#include <windows.h>
38
40
#include <prsht.h>
39
41
#include <shlwapi.h>
40
 
 
41
 
#ifndef _WIN_CE
42
 
  #include <shellapi.h>
43
 
  #include <shlobj.h>
44
 
  #include <winioctl.h>
45
 
 
46
 
 
47
 
#endif // _WIN_CE
 
42
#include <shellapi.h>
 
43
#include <shlobj.h>
 
44
#include <winioctl.h>
 
45
 
48
46
 
49
47
 
50
48
#endif // _WIN_ALL
51
49
 
52
 
#ifndef _WIN_CE
53
 
  #include <sys/types.h>
54
 
  #include <sys/stat.h>
55
 
  #include <dos.h>
56
 
#endif // _WIN_CE
 
50
#include <sys/types.h>
 
51
#include <sys/stat.h>
 
52
#include <dos.h>
57
53
 
58
 
#if !defined(_EMX) && !defined(_MSC_VER) && !defined(_WIN_CE)
 
54
#if !defined(_EMX) && !defined(_MSC_VER)
59
55
  #include <dir.h>
60
56
#endif
61
57
#ifdef _MSC_VER
62
58
  #if _MSC_VER<1500
63
59
    #define for if (0) ; else for
64
60
  #endif
65
 
  #ifndef _WIN_CE
66
 
    #include <direct.h>
67
 
  #endif
 
61
  #include <direct.h>
68
62
#else
69
63
  #include <dirent.h>
70
64
#endif // _MSC_VER
71
65
 
72
 
#ifndef _WIN_CE
73
 
  #include <share.h>
74
 
#endif // _WIN_CE
75
 
 
76
 
#if defined(ENABLE_BAD_ALLOC) && !defined(_WIN_CE)
77
 
  #include <new.h>
78
 
#endif
79
 
 
80
66
#ifdef _EMX
81
67
  #include <unistd.h>
82
68
  #include <pwd.h>
89
75
    #include <sys/utime.h>
90
76
    #include <emx/syscalls.h>
91
77
  #endif
92
 
#else
93
 
  #if defined(_MSC_VER) || defined(__MINGW32__)
94
 
      #include <exception>
95
 
  #else
96
 
    #include <except.h>
97
 
  #endif
98
78
#endif
99
79
 
100
80
#include <stdio.h>
102
82
#include <stdarg.h>
103
83
#include <string.h>
104
84
#include <ctype.h>
105
 
#ifndef _WIN_CE
106
 
  #include <fcntl.h>
107
 
  #include <dos.h>
108
 
  #include <io.h>
109
 
  #include <time.h>
110
 
  #include <signal.h>
111
 
#endif
112
 
 
113
 
/*
114
 
#ifdef _WIN_ALL
115
 
#pragma hdrstop
116
 
#endif // _WIN_ALL
117
 
*/
 
85
#include <fcntl.h>
 
86
#include <dos.h>
 
87
#include <io.h>
 
88
#include <time.h>
 
89
#include <signal.h>
118
90
 
119
91
#define ENABLE_ACCESS
120
92
 
132
104
#define READTEXT     "rt"
133
105
#define UPDATEBINARY "r+b"
134
106
#define CREATEBINARY "w+b"
 
107
#define WRITEBINARY  "wb"
135
108
#define APPENDTEXT   "at"
136
109
 
137
110
#if defined(_WIN_ALL)
172
145
#if defined(__QNXNTO__)
173
146
  #include <sys/param.h>
174
147
#endif
 
148
#if defined(RAR_SMP) && defined(__APPLE__)
 
149
  #include <sys/sysctl.h>
 
150
#endif
175
151
#if defined(__FreeBSD__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined(__APPLE__)
176
152
  #include <sys/param.h>
177
153
  #include <sys/mount.h>
213
189
#define READTEXT     "r"
214
190
#define UPDATEBINARY "r+"
215
191
#define CREATEBINARY "w+"
 
192
#define WRITEBINARY  "w"
216
193
#define APPENDTEXT   "a"
217
194
 
218
195
#define _stdfunction 
264
241
#endif
265
242
 
266
243
#if !defined(BIG_ENDIAN) && !defined(_WIN_CE) && defined(_WIN_ALL)
267
 
/* allow not aligned integer access, increases speed in some operations */
 
244
// Allow not aligned integer access, increases speed in some operations.
268
245
#define ALLOW_NOT_ALIGNED_INT
269
246
#endif
270
247
 
271
248
#if defined(__sparc) || defined(sparc) || defined(__sparcv9)
272
 
/* prohibit not aligned access to data structures in text comression
273
 
   algorithm, increases memory requirements */
 
249
// Prohibit not aligned access to data structures in text compression
 
250
// algorithm, increases memory requirements
274
251
#define STRICT_ALIGNMENT_REQUIRED
275
252
#endif
276
253