$NetBSD: patch-ab,v 1.1 2005/03/02 16:18:47 minskim Exp $ --- UnAlz.cpp.orig 2004-11-27 10:28:17.000000000 -0600 +++ UnAlz.cpp @@ -18,6 +18,10 @@ # include // iconv.h ¶§¹®¿¡ ÇÊ¿ä #endif +#if defined(__NetBSD__) +# include // __NetBSD_Version__ +# include // 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 inline UINT16 unalz_le16toh(UINT16 a){return le16toh(a);} inline UINT32 unalz_le32toh(UINT32 a){return le32toh(a);} @@ -376,7 +380,8 @@ 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(__NetBSD__) && __NetBSD_Version__ >= 200000000) const char *inptr = inbuf; #else char *inptr = inbuf;