49 lines
2 KiB
Text
49 lines
2 KiB
Text
$NetBSD: patch-ab,v 1.7 2005/10/31 15:04:17 tv Exp $
|
|
|
|
--- UnAlz.cpp.orig 2005-07-23 11:27:49.000000000 -0400
|
|
+++ 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)))
|
|
@@ -39,13 +43,13 @@
|
|
//// byte-order : little to host ////
|
|
////////////////////////////////////////////////////////////////////////////
|
|
|
|
-#if defined(_WIN32) || defined(__CYGWIN__) // little to little
|
|
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(__INTERIX) // little to little
|
|
inline UINT16 unalz_le16toh(UINT16 a){return a;}
|
|
inline UINT32 unalz_le32toh(UINT32 a){return a;}
|
|
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);}
|
|
@@ -416,7 +420,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;
|