summaryrefslogtreecommitdiff
path: root/archivers/unalz/patches/patch-ab
blob: 2feb5468a0ed9e090a70b1e9c2c37ea8ac9b6f50 (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
$NetBSD: patch-ab,v 1.6 2005/10/01 10:55:35 minskim Exp $

--- UnAlz.cpp.orig	2005-07-02 07:40:29.000000000 -0700
+++ UnAlz.cpp
@@ -1,6 +1,6 @@
 //#include "stdafx.h"
-#include "zlib/zlib.h"
-#include "bzip2/bzlib.h"
+#include <zlib.h>
+#include <bzlib.h>
 #include "UnAlz.h"
 
 // utime ÇÔ¼ö ó¸®
@@ -30,6 +30,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)))
@@ -45,7 +49,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);}
@@ -413,7 +417,7 @@ BOOL CUnAlz::ReadLocalFileheader()
 	size_t size;
 	char inbuf[ICONV_BUF_SIZE];
 	char outbuf[ICONV_BUF_SIZE];
-#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__)
+#if defined(__FreeBSD__) || defined(__CYGWIN__) || defined(__APPLE__) || defined(__NetBSD__)
 	const char *inptr = inbuf;
 #else
 	char *inptr = inbuf;