blob: 016b4365efc1f46ebc8a3c6fc257bb023db993cc (
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
|
$NetBSD: patch-ab,v 1.4 2005/07/12 13:55:26 minskim Exp $
This patch assumes that on NetBSD, every <iconv.h> has the non-const
prototype argument for the second parameter of iconv(). This is true for
all but some release candidates of NetBSD-2.0, because either the
package converters/libiconv is used or there's a current <iconv.h>.
--- UnAlz.cpp.orig 2005-06-17 22:31:33.000000000 -0500
+++ UnAlz.cpp
@@ -18,6 +18,10 @@
# include <errno.h> // iconv.h ¶§¹®¿¡ ÇÊ¿ä
#endif
+#if defined(__NetBSD__)
+# include <sys/param.h> // __NetBSD_Version__
+# include <errno.h> // iconv.h ¶§¹®¿¡ ÇÊ¿ä
+#endif
#define swapint64(Data) (INT64) ( (((Data)&0x00000000000000FFLL) << 56) | (((Data)&0x000000000000FF00LL) << 40) | (((Data)&0x0000000000FF0000LL) << 24) | (((Data)&0x00000000FF000000LL) << 8) | (((Data)&0x000000FF00000000LL) >> 8) | (((Data)&0x0000FF0000000000LL) >> 24) | (((Data)&0x00FF000000000000LL) >> 40) | (((Data)&0xFF00000000000000LL) >> 56) )
#define swapint32(a) ((((a)&0xff)<<24)+(((a>>8)&0xff)<<16)+(((a>>16)&0xff)<<8)+(((a>>24)&0xff)))
@@ -33,7 +37,7 @@
inline UINT64 unalz_le64toh(UINT64 a){return a;}
#endif
-#ifdef __FreeBSD__
+#if defined(__FreeBSD__) || defined(__NetBSD__)
# include <sys/endian.h>
inline UINT16 unalz_le16toh(UINT16 a){return le16toh(a);}
inline UINT32 unalz_le32toh(UINT32 a){return le32toh(a);}
@@ -389,7 +393,7 @@ BOOL CUnAlz::ReadLocalFileheader()
size_t size;
char inbuf[ICONV_BUF_SIZE];
char outbuf[ICONV_BUF_SIZE];
-#if defined(__FreeBSD__) || defined(__CYGWIN__)
+#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__NetBSD__)
const char *inptr = inbuf;
#else
char *inptr = inbuf;
|