Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 2014 21:45:17 +0000 (UTC)
From:      Raphael Kubo da Costa <rakuco@FreeBSD.org>
To:        ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org
Subject:   svn commit: r363945 - in head/net/krfb: . files
Message-ID:  <53dead6e.578b.1dbe8152@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rakuco
Date: Sun Aug  3 21:45:17 2014
New Revision: 363945
URL: http://svnweb.freebsd.org/changeset/ports/363945
QAT: https://qat.redports.org/buildarchive/r363945/

Log:
  Add patch for CVE-2014-4607.
  
  MFH:		2014Q3
  Security:	be5421ab-1b56-11e4-a767-5453ed2e2b49

Added:
  head/net/krfb/files/
  head/net/krfb/files/patch-CVE-2014-4607   (contents, props changed)
Modified:
  head/net/krfb/Makefile

Modified: head/net/krfb/Makefile
==============================================================================
--- head/net/krfb/Makefile	Sun Aug  3 21:44:44 2014	(r363944)
+++ head/net/krfb/Makefile	Sun Aug  3 21:45:17 2014	(r363945)
@@ -2,6 +2,7 @@
 
 PORTNAME=	krfb
 PORTVERSION=	${KDE4_VERSION}
+PORTREVISION=	1
 CATEGORIES=	net kde
 MASTER_SITES=	KDE/${KDE4_BRANCH}/${PORTVERSION}/src
 DIST_SUBDIR=	KDE/${PORTVERSION}

Added: head/net/krfb/files/patch-CVE-2014-4607
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/net/krfb/files/patch-CVE-2014-4607	Sun Aug  3 21:45:17 2014	(r363945)
@@ -0,0 +1,8738 @@
+commit 0bff5df104906c7e45545817c26c7e4907adc569
+Author: Martin T. H. Sandsmark <martin.sandsmark@kde.org>
+Date:   Thu Jul 31 20:20:32 2014 +0200
+
+    Update LZO to version 2.07 in libvncserver.
+    
+    Temporary fix for CVE-2014-4607 for 4.14. For next release we rely on
+    the external libvncserver.
+
+diff --git a/libvncserver/lzoconf.h b/libvncserver/lzoconf.h
+index d6125e8..02fb202 100644
+--- libvncserver/lzoconf.h
++++ libvncserver/lzoconf.h
+@@ -1,22 +1,8 @@
+-/* lzoconf.h -- configuration for the LZO real-time data compression library
++/* lzoconf.h -- configuration of the LZO data compression library
+ 
+    This file is part of the LZO real-time data compression library.
+ 
+-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
++   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+    All Rights Reserved.
+ 
+    The LZO library is free software; you can redistribute it and/or
+@@ -43,9 +29,9 @@
+ #ifndef __LZOCONF_H_INCLUDED
+ #define __LZOCONF_H_INCLUDED 1
+ 
+-#define LZO_VERSION             0x2040
+-#define LZO_VERSION_STRING      "2.04"
+-#define LZO_VERSION_DATE        "Oct 31 2010"
++#define LZO_VERSION             0x2070
++#define LZO_VERSION_STRING      "2.07"
++#define LZO_VERSION_DATE        "Jun 25 2014"
+ 
+ /* internal Autoconf configuration file - only used when building LZO */
+ #if defined(LZO_HAVE_CONFIG_H)
+@@ -62,7 +48,7 @@
+ #if !defined(CHAR_BIT) || (CHAR_BIT != 8)
+ #  error "invalid CHAR_BIT"
+ #endif
+-#if !defined(UCHAR_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
++#if !defined(UCHAR_MAX) || !defined(USHRT_MAX) || !defined(UINT_MAX) || !defined(ULONG_MAX)
+ #  error "check your compiler installation"
+ #endif
+ #if (USHRT_MAX < 1) || (UINT_MAX < 1) || (ULONG_MAX < 1)
+@@ -84,14 +70,6 @@ extern "C" {
+ // some core defines
+ ************************************************************************/
+ 
+-#if !defined(LZO_UINT32_C)
+-#  if (UINT_MAX < LZO_0xffffffffL)
+-#    define LZO_UINT32_C(c)     c ## UL
+-#  else
+-#    define LZO_UINT32_C(c)     ((c) + 0U)
+-#  endif
+-#endif
+-
+ /* memory checkers */
+ #if !defined(__LZO_CHECKER)
+ #  if defined(__BOUNDS_CHECKING_ON)
+@@ -110,28 +88,31 @@ extern "C" {
+ // integral and pointer types
+ ************************************************************************/
+ 
+-/* lzo_uint should match size_t */
++/* lzo_uint must match size_t */
+ #if !defined(LZO_UINT_MAX)
+-#  if defined(LZO_ABI_LLP64) /* WIN64 */
+-#    if defined(LZO_OS_WIN64)
++#  if (LZO_ABI_LLP64)
++#    if (LZO_OS_WIN64)
+      typedef unsigned __int64   lzo_uint;
+      typedef __int64            lzo_int;
+ #    else
+-     typedef unsigned long long lzo_uint;
+-     typedef long long          lzo_int;
++     typedef lzo_ullong_t       lzo_uint;
++     typedef lzo_llong_t        lzo_int;
+ #    endif
++#    define LZO_SIZEOF_LZO_UINT 8
+ #    define LZO_UINT_MAX        0xffffffffffffffffull
+ #    define LZO_INT_MAX         9223372036854775807LL
+ #    define LZO_INT_MIN         (-1LL - LZO_INT_MAX)
+-#  elif defined(LZO_ABI_IP32L64) /* MIPS R5900 */
++#  elif (LZO_ABI_IP32L64) /* MIPS R5900 */
+      typedef unsigned int       lzo_uint;
+      typedef int                lzo_int;
++#    define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_INT
+ #    define LZO_UINT_MAX        UINT_MAX
+ #    define LZO_INT_MAX         INT_MAX
+ #    define LZO_INT_MIN         INT_MIN
+ #  elif (ULONG_MAX >= LZO_0xffffffffL)
+      typedef unsigned long      lzo_uint;
+      typedef long               lzo_int;
++#    define LZO_SIZEOF_LZO_UINT LZO_SIZEOF_LONG
+ #    define LZO_UINT_MAX        ULONG_MAX
+ #    define LZO_INT_MAX         LONG_MAX
+ #    define LZO_INT_MIN         LONG_MIN
+@@ -140,42 +121,22 @@ extern "C" {
+ #  endif
+ #endif
+ 
+-/* Integral types with 32 bits or more. */
+-#if !defined(LZO_UINT32_MAX)
+-#  if (UINT_MAX >= LZO_0xffffffffL)
+-     typedef unsigned int       lzo_uint32;
+-     typedef int                lzo_int32;
+-#    define LZO_UINT32_MAX      UINT_MAX
+-#    define LZO_INT32_MAX       INT_MAX
+-#    define LZO_INT32_MIN       INT_MIN
+-#  elif (ULONG_MAX >= LZO_0xffffffffL)
+-     typedef unsigned long      lzo_uint32;
+-     typedef long               lzo_int32;
+-#    define LZO_UINT32_MAX      ULONG_MAX
+-#    define LZO_INT32_MAX       LONG_MAX
+-#    define LZO_INT32_MIN       LONG_MIN
+-#  else
+-#    error "lzo_uint32"
+-#  endif
+-#endif
+-
+-/* The larger type of lzo_uint and lzo_uint32. */
+-#if (LZO_UINT_MAX >= LZO_UINT32_MAX)
++/* The larger type of lzo_uint and lzo_uint32_t. */
++#if (LZO_SIZEOF_LZO_UINT >= 4)
+ #  define lzo_xint              lzo_uint
+ #else
+-#  define lzo_xint              lzo_uint32
++#  define lzo_xint              lzo_uint32_t
+ #endif
+ 
+-/* Memory model that allows to access memory at offsets of lzo_uint. */
+-#if !defined(__LZO_MMODEL)
+-#  if (LZO_UINT_MAX <= UINT_MAX)
+-#    define __LZO_MMODEL        /*empty*/
+-#  elif defined(LZO_HAVE_MM_HUGE_PTR)
+-#    define __LZO_MMODEL_HUGE   1
+-#    define __LZO_MMODEL        __huge
+-#  else
+-#    define __LZO_MMODEL        /*empty*/
+-#  endif
++typedef int lzo_bool;
++
++/* sanity checks */
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == LZO_SIZEOF_LZO_UINT)
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_xint) >= sizeof(lzo_uint32_t))
++
++#ifndef __LZO_MMODEL
++#define __LZO_MMODEL            /*empty*/
+ #endif
+ 
+ /* no typedef here because of const-pointer issues */
+@@ -184,17 +145,52 @@ extern "C" {
+ #define lzo_voidp               void __LZO_MMODEL *
+ #define lzo_shortp              short __LZO_MMODEL *
+ #define lzo_ushortp             unsigned short __LZO_MMODEL *
+-#define lzo_uint32p             lzo_uint32 __LZO_MMODEL *
+-#define lzo_int32p              lzo_int32 __LZO_MMODEL *
+-#define lzo_uintp               lzo_uint __LZO_MMODEL *
+ #define lzo_intp                lzo_int __LZO_MMODEL *
++#define lzo_uintp               lzo_uint __LZO_MMODEL *
+ #define lzo_xintp               lzo_xint __LZO_MMODEL *
+ #define lzo_voidpp              lzo_voidp __LZO_MMODEL *
+ #define lzo_bytepp              lzo_bytep __LZO_MMODEL *
+-/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
+-#define lzo_byte                unsigned char __LZO_MMODEL
+ 
+-typedef int lzo_bool;
++#define lzo_int8_tp             lzo_int8_t __LZO_MMODEL *
++#define lzo_uint8_tp            lzo_uint8_t __LZO_MMODEL *
++#define lzo_int16_tp            lzo_int16_t __LZO_MMODEL *
++#define lzo_uint16_tp           lzo_uint16_t __LZO_MMODEL *
++#define lzo_int32_tp            lzo_int32_t __LZO_MMODEL *
++#define lzo_uint32_tp           lzo_uint32_t __LZO_MMODEL *
++#if defined(lzo_int64_t)
++#define lzo_int64_tp            lzo_int64_t __LZO_MMODEL *
++#define lzo_uint64_tp           lzo_uint64_t __LZO_MMODEL *
++#endif
++
++/* Older LZO versions used to support ancient systems and memory models
++ * like 16-bit MSDOS with __huge pointers and Cray PVP, but these
++ * obsolete configurations are not supported any longer.
++ */
++#if defined(__LZO_MMODEL_HUGE)
++#error "__LZO_MMODEL_HUGE is unsupported"
++#endif
++#if (LZO_MM_PVP)
++#error "LZO_MM_PVP is unsupported"
++#endif
++#if (LZO_SIZEOF_INT < 4)
++#error "LZO_SIZEOF_INT < 4 is unsupported"
++#endif
++#if (__LZO_UINTPTR_T_IS_POINTER)
++#error "__LZO_UINTPTR_T_IS_POINTER is unsupported"
++#endif
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(int) >= 4)
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) >= 4)
++/* Strange configurations where sizeof(lzo_uint) != sizeof(size_t) should
++ * work but have not received much testing lately, so be strict here.
++ */
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(size_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(ptrdiff_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(lzo_uint) == sizeof(lzo_uintptr_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *)   == sizeof(lzo_uintptr_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *)   == sizeof(lzo_uintptr_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(long *)   == sizeof(lzo_uintptr_t))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(void *)   == sizeof(lzo_voidp))
++LZO_COMPILE_TIME_ASSERT_HEADER(sizeof(char *)   == sizeof(lzo_bytep))
+ 
+ 
+ /***********************************************************************
+@@ -289,7 +285,7 @@ struct lzo_callback_t
+     /* a progress indicator callback function (set to 0 to disable) */
+     lzo_progress_func_t nprogress;
+ 
+-    /* NOTE: the first parameter "self" of the nalloc/nfree/nprogress
++    /* INFO: the first parameter "self" of the nalloc/nfree/nprogress
+      * callbacks points back to this struct, so you are free to store
+      * some extra info in the following variables. */
+     lzo_voidp user1;
+@@ -308,7 +304,7 @@ struct lzo_callback_t
+  */
+ #define LZO_E_OK                    0
+ #define LZO_E_ERROR                 (-1)
+-#define LZO_E_OUT_OF_MEMORY         (-2)    /* [not used right now] */
++#define LZO_E_OUT_OF_MEMORY         (-2)    /* [lzo_alloc_func_t failure] */
+ #define LZO_E_NOT_COMPRESSIBLE      (-3)    /* [not used right now] */
+ #define LZO_E_INPUT_OVERRUN         (-4)
+ #define LZO_E_OUTPUT_OVERRUN        (-5)
+@@ -316,6 +312,10 @@ struct lzo_callback_t
+ #define LZO_E_EOF_NOT_FOUND         (-7)
+ #define LZO_E_INPUT_NOT_CONSUMED    (-8)
+ #define LZO_E_NOT_YET_IMPLEMENTED   (-9)    /* [not used right now] */
++#define LZO_E_INVALID_ARGUMENT      (-10)
++#define LZO_E_INVALID_ALIGNMENT     (-11)   /* pointer argument is not properly aligned */
++#define LZO_E_OUTPUT_NOT_CONSUMED   (-12)
++#define LZO_E_INTERNAL_ERROR        (-99)
+ 
+ 
+ #ifndef lzo_sizeof_dict_t
+@@ -329,7 +329,7 @@ struct lzo_callback_t
+  * compiler's view of various types are consistent.
+  */
+ #define lzo_init() __lzo_init_v2(LZO_VERSION,(int)sizeof(short),(int)sizeof(int),\
+-    (int)sizeof(long),(int)sizeof(lzo_uint32),(int)sizeof(lzo_uint),\
++    (int)sizeof(long),(int)sizeof(lzo_uint32_t),(int)sizeof(lzo_uint),\
+     (int)lzo_sizeof_dict_t,(int)sizeof(char *),(int)sizeof(lzo_voidp),\
+     (int)sizeof(lzo_callback_t))
+ LZO_EXTERN(int) __lzo_init_v2(unsigned,int,int,int,int,int,int,int,int,int);
+@@ -352,18 +352,22 @@ LZO_EXTERN(lzo_voidp)
+     lzo_memset(lzo_voidp buf, int c, lzo_uint len);
+ 
+ /* checksum functions */
+-LZO_EXTERN(lzo_uint32)
+-    lzo_adler32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
+-LZO_EXTERN(lzo_uint32)
+-    lzo_crc32(lzo_uint32 c, const lzo_bytep buf, lzo_uint len);
+-LZO_EXTERN(const lzo_uint32p)
++LZO_EXTERN(lzo_uint32_t)
++    lzo_adler32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
++LZO_EXTERN(lzo_uint32_t)
++    lzo_crc32(lzo_uint32_t c, const lzo_bytep buf, lzo_uint len);
++LZO_EXTERN(const lzo_uint32_tp)
+     lzo_get_crc32_table(void);
+ 
+ /* misc. */
+ LZO_EXTERN(int) _lzo_config_check(void);
+-typedef union { lzo_bytep p; lzo_uint u; } __lzo_pu_u;
+-typedef union { lzo_bytep p; lzo_uint32 u32; } __lzo_pu32_u;
+-typedef union { void *vp; lzo_bytep bp; lzo_uint u; lzo_uint32 u32; unsigned long l; } lzo_align_t;
++typedef union {
++    lzo_voidp a00; lzo_bytep a01; lzo_uint a02; lzo_xint a03; lzo_uintptr_t a04;
++    void *a05; unsigned char *a06; unsigned long a07; size_t a08; ptrdiff_t a09;
++#if defined(lzo_int64_t)
++    lzo_uint64_t a10;
++#endif
++} lzo_align_t;
+ 
+ /* align a char pointer on a boundary that is a multiple of 'size' */
+ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
+@@ -372,9 +376,30 @@ LZO_EXTERN(unsigned) __lzo_align_gap(const lzo_voidp p, lzo_uint size);
+ 
+ 
+ /***********************************************************************
+-// deprecated macros - only for backward compatibility with LZO v1.xx
++// deprecated macros - only for backward compatibility
+ ************************************************************************/
+ 
++/* deprecated - use 'lzo_bytep' instead of 'lzo_byte *' */
++#define lzo_byte                unsigned char
++/* deprecated type names */
++#define lzo_int32               lzo_int32_t
++#define lzo_uint32              lzo_uint32_t
++#define lzo_int32p              lzo_int32_t __LZO_MMODEL *
++#define lzo_uint32p             lzo_uint32_t __LZO_MMODEL *
++#define LZO_INT32_MAX           LZO_INT32_C(2147483647)
++#define LZO_UINT32_MAX          LZO_UINT32_C(4294967295)
++#if defined(lzo_int64_t)
++#define lzo_int64               lzo_int64_t
++#define lzo_uint64              lzo_uint64_t
++#define lzo_int64p              lzo_int64_t __LZO_MMODEL *
++#define lzo_uint64p             lzo_uint64_t __LZO_MMODEL *
++#define LZO_INT64_MAX           LZO_INT64_C(9223372036854775807)
++#define LZO_UINT64_MAX          LZO_UINT64_C(18446744073709551615)
++#endif
++/* deprecated types */
++typedef union { lzo_bytep a; lzo_uint b; } __lzo_pu_u;
++typedef union { lzo_bytep a; lzo_uint32_t b; } __lzo_pu32_u;
++
+ #if defined(LZO_CFG_COMPAT)
+ 
+ #define __LZOCONF_H 1
+diff --git a/libvncserver/lzodefs.h b/libvncserver/lzodefs.h
+index 190013f..f4ae948 100644
+--- libvncserver/lzodefs.h
++++ libvncserver/lzodefs.h
+@@ -2,21 +2,7 @@
+ 
+    This file is part of the LZO real-time data compression library.
+ 
+-   Copyright (C) 2010 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2009 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2008 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2007 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2006 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2005 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2004 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2003 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2002 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2001 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 2000 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1999 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1998 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1997 Markus Franz Xaver Johannes Oberhumer
+-   Copyright (C) 1996 Markus Franz Xaver Johannes Oberhumer
++   Copyright (C) 1996-2014 Markus Franz Xaver Johannes Oberhumer
+    All Rights Reserved.
+ 
+    The LZO library is free software; you can redistribute it and/or
+@@ -46,12 +32,6 @@
+ #if defined(__CYGWIN32__) && !defined(__CYGWIN__)
+ #  define __CYGWIN__ __CYGWIN32__
+ #endif
+-#if defined(__IBMCPP__) && !defined(__IBMC__)
+-#  define __IBMC__ __IBMCPP__
+-#endif
+-#if defined(__ICL) && defined(_WIN32) && !defined(__INTEL_COMPILER)
+-#  define __INTEL_COMPILER __ICL
+-#endif
+ #if 1 && defined(__INTERIX) && defined(__GNUC__) && !defined(_ALL_SOURCE)
+ #  define _ALL_SOURCE 1
+ #endif
+@@ -60,19 +40,30 @@
+ #    define __LONG_MAX__ 9223372036854775807L
+ #  endif
+ #endif
+-#if defined(__INTEL_COMPILER) && defined(__linux__)
++#if !defined(LZO_CFG_NO_DISABLE_WUNDEF)
++#if defined(__ARMCC_VERSION)
++#  pragma diag_suppress 193
++#elif defined(__clang__) && defined(__clang_minor__)
++#  pragma clang diagnostic ignored "-Wundef"
++#elif defined(__INTEL_COMPILER)
+ #  pragma warning(disable: 193)
+-#endif
+-#if defined(__KEIL__) && defined(__C166__)
+-#  pragma warning disable = 322
+-#elif 0 && defined(__C251__)
++#elif defined(__KEIL__) && defined(__C166__)
+ #  pragma warning disable = 322
+-#endif
+-#if defined(_MSC_VER) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
+-#  if (_MSC_VER >= 1300)
++#elif defined(__GNUC__) && defined(__GNUC_MINOR__) && !defined(__PATHSCALE__)
++#  if ((__GNUC__-0) >= 5 || ((__GNUC__-0) == 4 && (__GNUC_MINOR__-0) >= 2))
++#    pragma GCC diagnostic ignored "-Wundef"
++#  endif
++#elif defined(_MSC_VER) && !defined(__clang__) && !defined(__INTEL_COMPILER) && !defined(__MWERKS__)
++#  if ((_MSC_VER-0) >= 1300)
+ #    pragma warning(disable: 4668)
+ #  endif
+ #endif
++#endif
++#if 0 && defined(__POCC__) && defined(_WIN32)
++#  if (__POCC__ >= 400)
++#    pragma warn(disable: 2216)
++#  endif
++#endif
+ #if 0 && defined(__WATCOMC__)
+ #  if (__WATCOMC__ >= 1050) && (__WATCOMC__ < 1060)
+ #    pragma warning 203 9
+@@ -81,13 +72,29 @@
+ #if defined(__BORLANDC__) && defined(__MSDOS__) && !defined(__FLAT__)
+ #  pragma option -h
+ #endif
++#if !(LZO_CFG_NO_DISABLE_WCRTNONSTDC)
++#ifndef _CRT_NONSTDC_NO_DEPRECATE
++#define _CRT_NONSTDC_NO_DEPRECATE 1
++#endif
++#ifndef _CRT_NONSTDC_NO_WARNINGS
++#define _CRT_NONSTDC_NO_WARNINGS 1
++#endif
++#ifndef _CRT_SECURE_NO_DEPRECATE
++#define _CRT_SECURE_NO_DEPRECATE 1
++#endif
++#ifndef _CRT_SECURE_NO_WARNINGS
++#define _CRT_SECURE_NO_WARNINGS 1
++#endif
++#endif
+ #if 0
+-#define LZO_0xffffL             0xfffful
+-#define LZO_0xffffffffL         0xfffffffful
++#define LZO_0xffffUL            0xfffful
++#define LZO_0xffffffffUL        0xfffffffful
+ #else
+-#define LZO_0xffffL             65535ul
+-#define LZO_0xffffffffL         4294967295ul
++#define LZO_0xffffUL            65535ul
++#define LZO_0xffffffffUL        4294967295ul
+ #endif
++#define LZO_0xffffL             LZO_0xffffUL
++#define LZO_0xffffffffL         LZO_0xffffffffUL
+ #if (LZO_0xffffL == LZO_0xffffffffL)
+ #  error "your preprocessor is broken 1"
+ #endif
+@@ -102,6 +109,13 @@
+ #  error "your preprocessor is broken 4"
+ #endif
+ #endif
++#if defined(__COUNTER__)
++#  ifndef LZO_CFG_USE_COUNTER
++#  define LZO_CFG_USE_COUNTER 1
++#  endif
++#else
++#  undef LZO_CFG_USE_COUNTER
++#endif
+ #if (UINT_MAX == LZO_0xffffL)
+ #if defined(__ZTC__) && defined(__I86__) && !defined(__OS2__)
+ #  if !defined(MSDOS)
+@@ -232,14 +246,31 @@
+ #endif
+ #define LZO_PP_STRINGIZE(x)             #x
+ #define LZO_PP_MACRO_EXPAND(x)          LZO_PP_STRINGIZE(x)
++#define LZO_PP_CONCAT0()                /*empty*/
++#define LZO_PP_CONCAT1(a)               a
+ #define LZO_PP_CONCAT2(a,b)             a ## b
+ #define LZO_PP_CONCAT3(a,b,c)           a ## b ## c
+ #define LZO_PP_CONCAT4(a,b,c,d)         a ## b ## c ## d
+ #define LZO_PP_CONCAT5(a,b,c,d,e)       a ## b ## c ## d ## e
++#define LZO_PP_CONCAT6(a,b,c,d,e,f)     a ## b ## c ## d ## e ## f
++#define LZO_PP_CONCAT7(a,b,c,d,e,f,g)   a ## b ## c ## d ## e ## f ## g
++#define LZO_PP_ECONCAT0()               LZO_PP_CONCAT0()
++#define LZO_PP_ECONCAT1(a)              LZO_PP_CONCAT1(a)
+ #define LZO_PP_ECONCAT2(a,b)            LZO_PP_CONCAT2(a,b)
+ #define LZO_PP_ECONCAT3(a,b,c)          LZO_PP_CONCAT3(a,b,c)
+ #define LZO_PP_ECONCAT4(a,b,c,d)        LZO_PP_CONCAT4(a,b,c,d)
+ #define LZO_PP_ECONCAT5(a,b,c,d,e)      LZO_PP_CONCAT5(a,b,c,d,e)
++#define LZO_PP_ECONCAT6(a,b,c,d,e,f)    LZO_PP_CONCAT6(a,b,c,d,e,f)
++#define LZO_PP_ECONCAT7(a,b,c,d,e,f,g)  LZO_PP_CONCAT7(a,b,c,d,e,f,g)
++#define LZO_PP_EMPTY                    /*empty*/
++#define LZO_PP_EMPTY0()                 /*empty*/
++#define LZO_PP_EMPTY1(a)                /*empty*/
++#define LZO_PP_EMPTY2(a,b)              /*empty*/
++#define LZO_PP_EMPTY3(a,b,c)            /*empty*/
++#define LZO_PP_EMPTY4(a,b,c,d)          /*empty*/
++#define LZO_PP_EMPTY5(a,b,c,d,e)        /*empty*/
++#define LZO_PP_EMPTY6(a,b,c,d,e,f)      /*empty*/
++#define LZO_PP_EMPTY7(a,b,c,d,e,f,g)    /*empty*/
+ #if 1
+ #define LZO_CPP_STRINGIZE(x)            #x
+ #define LZO_CPP_MACRO_EXPAND(x)         LZO_CPP_STRINGIZE(x)
+@@ -247,12 +278,16 @@
+ #define LZO_CPP_CONCAT3(a,b,c)          a ## b ## c
+ #define LZO_CPP_CONCAT4(a,b,c,d)        a ## b ## c ## d
+ #define LZO_CPP_CONCAT5(a,b,c,d,e)      a ## b ## c ## d ## e
++#define LZO_CPP_CONCAT6(a,b,c,d,e,f)    a ## b ## c ## d ## e ## f
++#define LZO_CPP_CONCAT7(a,b,c,d,e,f,g)  a ## b ## c ## d ## e ## f ## g
+ #define LZO_CPP_ECONCAT2(a,b)           LZO_CPP_CONCAT2(a,b)
+ #define LZO_CPP_ECONCAT3(a,b,c)         LZO_CPP_CONCAT3(a,b,c)
+ #define LZO_CPP_ECONCAT4(a,b,c,d)       LZO_CPP_CONCAT4(a,b,c,d)
+ #define LZO_CPP_ECONCAT5(a,b,c,d,e)     LZO_CPP_CONCAT5(a,b,c,d,e)
++#define LZO_CPP_ECONCAT6(a,b,c,d,e,f)   LZO_CPP_CONCAT6(a,b,c,d,e,f)
++#define LZO_CPP_ECONCAT7(a,b,c,d,e,f,g) LZO_CPP_CONCAT7(a,b,c,d,e,f,g)
+ #endif
+-#define __LZO_MASK_GEN(o,b)     (((((o) << ((b)-1)) - (o)) << 1) + (o))
++#define __LZO_MASK_GEN(o,b)     (((((o) << ((b)-!!(b))) - (o)) << 1) + (o)*!!(b))
+ #if 1 && defined(__cplusplus)
+ #  if !defined(__STDC_CONSTANT_MACROS)
+ #    define __STDC_CONSTANT_MACROS 1
+@@ -262,9 +297,13 @@
+ #  endif
+ #endif
+ #if defined(__cplusplus)
+-#  define LZO_EXTERN_C extern "C"
++#  define LZO_EXTERN_C          extern "C"
++#  define LZO_EXTERN_C_BEGIN    extern "C" {
++#  define LZO_EXTERN_C_END      }
+ #else
+-#  define LZO_EXTERN_C extern
++#  define LZO_EXTERN_C          extern
++#  define LZO_EXTERN_C_BEGIN    /*empty*/
++#  define LZO_EXTERN_C_END      /*empty*/
+ #endif
+ #if !defined(__LZO_OS_OVERRIDE)
+ #if (LZO_OS_FREESTANDING)
+@@ -365,12 +404,12 @@
+ #elif defined(__VMS)
+ #  define LZO_OS_VMS            1
+ #  define LZO_INFO_OS           "vms"
+-#elif ((defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__))
++#elif (defined(__mips__) && defined(__R5900__)) || defined(__MIPS_PSX2__)
+ #  define LZO_OS_CONSOLE        1
+ #  define LZO_OS_CONSOLE_PS2    1
+ #  define LZO_INFO_OS           "console"
+ #  define LZO_INFO_OS_CONSOLE   "ps2"
+-#elif (defined(__mips__) && defined(__psp__))
++#elif defined(__mips__) && defined(__psp__)
+ #  define LZO_OS_CONSOLE        1
+ #  define LZO_OS_CONSOLE_PSP    1
+ #  define LZO_INFO_OS           "console"
+@@ -398,9 +437,18 @@
+ #  elif defined(__linux__) || defined(__linux) || defined(__LINUX__)
+ #    define LZO_OS_POSIX_LINUX      1
+ #    define LZO_INFO_OS_POSIX       "linux"
+-#  elif defined(__APPLE__) || defined(__MACOS__)
+-#    define LZO_OS_POSIX_MACOSX     1
+-#    define LZO_INFO_OS_POSIX       "macosx"
++#  elif defined(__APPLE__) && defined(__MACH__)
++#    if ((__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__-0) >= 20000)
++#      define LZO_OS_POSIX_DARWIN     1040
++#      define LZO_INFO_OS_POSIX       "darwin_iphone"
++#    elif ((__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__-0) >= 1040)
++#      define LZO_OS_POSIX_DARWIN     __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__
++#      define LZO_INFO_OS_POSIX       "darwin"
++#    else
++#      define LZO_OS_POSIX_DARWIN     1
++#      define LZO_INFO_OS_POSIX       "darwin"
++#    endif
++#    define LZO_OS_POSIX_MACOSX     LZO_OS_POSIX_DARWIN
+ #  elif defined(__minix__) || defined(__minix)
+ #    define LZO_OS_POSIX_MINIX      1
+ #    define LZO_INFO_OS_POSIX       "minix"
+@@ -435,18 +483,18 @@
+ #endif
+ #if (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+ #  if (UINT_MAX != LZO_0xffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #  if (ULONG_MAX != LZO_0xffffffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #endif
+ #if (LZO_OS_DOS32 || LZO_OS_OS2 || LZO_OS_WIN32 || LZO_OS_WIN64)
+ #  if (UINT_MAX != LZO_0xffffffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #  if (ULONG_MAX != LZO_0xffffffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #endif
+ #if defined(CIL) && defined(_GNUCC) && defined(__GNUC__)
+@@ -462,59 +510,65 @@
+ #  define LZO_INFO_CC           "sdcc"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(SDCC)
+ #elif defined(__PATHSCALE__) && defined(__PATHCC_PATCHLEVEL__)
+-#  define LZO_CC_PATHSCALE      (__PATHCC__ * 0x10000L + __PATHCC_MINOR__ * 0x100 + __PATHCC_PATCHLEVEL__)
++#  define LZO_CC_PATHSCALE      (__PATHCC__ * 0x10000L + (__PATHCC_MINOR__-0) * 0x100 + (__PATHCC_PATCHLEVEL__-0))
+ #  define LZO_INFO_CC           "Pathscale C"
+ #  define LZO_INFO_CCVER        __PATHSCALE__
+-#elif defined(__INTEL_COMPILER)
+-#  define LZO_CC_INTELC         1
++#  if defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
++#    define LZO_CC_PATHSCALE_GNUC (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
++#  endif
++#elif defined(__INTEL_COMPILER) && ((__INTEL_COMPILER-0) > 0)
++#  define LZO_CC_INTELC         __INTEL_COMPILER
+ #  define LZO_INFO_CC           "Intel C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__INTEL_COMPILER)
+-#  if defined(_WIN32) || defined(_WIN64)
+-#    define LZO_CC_SYNTAX_MSC 1
+-#  else
+-#    define LZO_CC_SYNTAX_GNUC 1
++#  if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
++#    define LZO_CC_INTELC_MSC   _MSC_VER
++#  elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
++#    define LZO_CC_INTELC_GNUC   (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+ #  endif
+ #elif defined(__POCC__) && defined(_WIN32)
+ #  define LZO_CC_PELLESC        1
+ #  define LZO_INFO_CC           "Pelles C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__POCC__)
+-#elif defined(__clang__) && defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
++#elif defined(__ARMCC_VERSION) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+ #  if defined(__GNUC_PATCHLEVEL__)
+-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
++#    define LZO_CC_ARMCC_GNUC   (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+ #  else
+-#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
++#    define LZO_CC_ARMCC_GNUC   (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+ #  endif
++#  define LZO_CC_ARMCC          __ARMCC_VERSION
++#  define LZO_INFO_CC           "ARM C Compiler"
++#  define LZO_INFO_CCVER        __VERSION__
++#elif defined(__clang__) && defined(__llvm__) && defined(__VERSION__)
+ #  if defined(__clang_major__) && defined(__clang_minor__) && defined(__clang_patchlevel__)
+-#    define LZO_CC_CLANG_CLANG  (__clang_major__ * 0x10000L + __clang_minor__ * 0x100 + __clang_patchlevel__)
++#    define LZO_CC_CLANG        (__clang_major__ * 0x10000L + (__clang_minor__-0) * 0x100 + (__clang_patchlevel__-0))
+ #  else
+-#    define LZO_CC_CLANG_CLANG  0x020700L
++#    define LZO_CC_CLANG        0x010000L
++#  endif
++#  if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
++#    define LZO_CC_CLANG_MSC    _MSC_VER
++#  elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
++#    define LZO_CC_CLANG_GNUC   (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+ #  endif
+-#  define LZO_CC_CLANG          LZO_CC_CLANG_GNUC
+ #  define LZO_INFO_CC           "clang"
+ #  define LZO_INFO_CCVER        __VERSION__
+ #elif defined(__llvm__) && defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
+ #  if defined(__GNUC_PATCHLEVEL__)
+-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
++#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
+ #  else
+-#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
++#    define LZO_CC_LLVM_GNUC    (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
+ #  endif
+ #  define LZO_CC_LLVM           LZO_CC_LLVM_GNUC
+ #  define LZO_INFO_CC           "llvm-gcc"
+ #  define LZO_INFO_CCVER        __VERSION__
+-#elif defined(__GNUC__) && defined(__VERSION__)
+-#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
+-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100 + __GNUC_PATCHLEVEL__)
+-#  elif defined(__GNUC_MINOR__)
+-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + __GNUC_MINOR__ * 0x100)
+-#  else
+-#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L)
+-#  endif
+-#  define LZO_INFO_CC           "gcc"
+-#  define LZO_INFO_CCVER        __VERSION__
+ #elif defined(__ACK__) && defined(_ACK)
+ #  define LZO_CC_ACK            1
+ #  define LZO_INFO_CC           "Amsterdam Compiler Kit C"
+ #  define LZO_INFO_CCVER        "unknown"
++#elif defined(__ARMCC_VERSION) && !defined(__GNUC__)
++#  define LZO_CC_ARMCC          __ARMCC_VERSION
++#  define LZO_CC_ARMCC_ARMCC    __ARMCC_VERSION
++#  define LZO_INFO_CC           "ARM C Compiler"
++#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__ARMCC_VERSION)
+ #elif defined(__AZTEC_C__)
+ #  define LZO_CC_AZTECC         1
+ #  define LZO_INFO_CC           "Aztec C"
+@@ -539,10 +593,23 @@
+ #  define LZO_CC_DECC           1
+ #  define LZO_INFO_CC           "DEC C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__DECC)
++#elif (defined(__ghs) || defined(__ghs__)) && defined(__GHS_VERSION_NUMBER) && ((__GHS_VERSION_NUMBER-0) > 0)
++#  define LZO_CC_GHS            1
++#  define LZO_INFO_CC           "Green Hills C"
++#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__GHS_VERSION_NUMBER)
++#  if defined(_MSC_VER) && ((_MSC_VER-0) > 0)
++#    define LZO_CC_GHS_MSC      _MSC_VER
++#  elif defined(__GNUC__) && defined(__GNUC_MINOR__) && defined(__VERSION__)
++#    define LZO_CC_GHS_GNUC     (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
++#  endif
+ #elif defined(__HIGHC__)
+ #  define LZO_CC_HIGHC          1
+ #  define LZO_INFO_CC           "MetaWare High C"
+ #  define LZO_INFO_CCVER        "unknown"
++#elif defined(__HP_aCC) && ((__HP_aCC-0) > 0)
++#  define LZO_CC_HPACC          __HP_aCC
++#  define LZO_INFO_CC           "HP aCC"
++#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__HP_aCC)
+ #elif defined(__IAR_SYSTEMS_ICC__)
+ #  define LZO_CC_IARC           1
+ #  define LZO_INFO_CC           "IAR C"
+@@ -551,10 +618,14 @@
+ #  else
+ #    define LZO_INFO_CCVER      "unknown"
+ #  endif
+-#elif defined(__IBMC__)
+-#  define LZO_CC_IBMC           1
++#elif defined(__IBMC__) && ((__IBMC__-0) > 0)
++#  define LZO_CC_IBMC           __IBMC__
+ #  define LZO_INFO_CC           "IBM C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__IBMC__)
++#elif defined(__IBMCPP__) && ((__IBMCPP__-0) > 0)
++#  define LZO_CC_IBMC           __IBMCPP__
++#  define LZO_INFO_CC           "IBM C"
++#  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__IBMCPP__)
+ #elif defined(__KEIL__) && defined(__C166__)
+ #  define LZO_CC_KEILC          1
+ #  define LZO_INFO_CC           "Keil C"
+@@ -571,16 +642,8 @@
+ #  else
+ #    define LZO_INFO_CCVER      "unknown"
+ #  endif
+-#elif defined(_MSC_VER)
+-#  define LZO_CC_MSC            1
+-#  define LZO_INFO_CC           "Microsoft C"
+-#  if defined(_MSC_FULL_VER)
+-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
+-#  else
+-#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER)
+-#  endif
+-#elif defined(__MWERKS__)
+-#  define LZO_CC_MWERKS         1
++#elif defined(__MWERKS__) && ((__MWERKS__-0) > 0)
++#  define LZO_CC_MWERKS         __MWERKS__
+ #  define LZO_INFO_CC           "Metrowerks C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__MWERKS__)
+ #elif (defined(__NDPC__) || defined(__NDPX__)) && defined(__i386)
+@@ -591,6 +654,15 @@
+ #  define LZO_CC_PACIFICC       1
+ #  define LZO_INFO_CC           "Pacific C"
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__PACIFIC__)
++#elif defined(__PGI) && defined(__PGIC__) && defined(__PGIC_MINOR__)
++#  if defined(__PGIC_PATCHLEVEL__)
++#    define LZO_CC_PGI          (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100 + (__PGIC_PATCHLEVEL__-0))
++#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) "." LZO_PP_MACRO_EXPAND(__PGIC_PATCHLEVEL__)
++#  else
++#    define LZO_CC_PGI          (__PGIC__ * 0x10000L + (__PGIC_MINOR__-0) * 0x100)
++#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__PGIC__) "." LZO_PP_MACRO_EXPAND(__PGIC_MINOR__) ".0"
++#  endif
++#  define LZO_INFO_CC           "Portland Group PGI C"
+ #elif defined(__PGI) && (defined(__linux__) || defined(__WIN32__))
+ #  define LZO_CC_PGI            1
+ #  define LZO_INFO_CC           "Portland Group PGI C"
+@@ -605,7 +677,7 @@
+ #  define LZO_INFO_CCVER        LZO_PP_MACRO_EXPAND(__SC__)
+ #elif defined(__SUNPRO_C)
+ #  define LZO_INFO_CC           "SunPro C"
+-#  if ((__SUNPRO_C)+0 > 0)
++#  if ((__SUNPRO_C-0) > 0)
+ #    define LZO_CC_SUNPROC      __SUNPRO_C
+ #    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_C)
+ #  else
+@@ -614,7 +686,7 @@
+ #  endif
+ #elif defined(__SUNPRO_CC)
+ #  define LZO_INFO_CC           "SunPro C"
+-#  if ((__SUNPRO_CC)+0 > 0)
++#  if ((__SUNPRO_CC-0) > 0)
+ #    define LZO_CC_SUNPROC      __SUNPRO_CC
+ #    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__SUNPRO_CC)
+ #  else
+@@ -640,16 +712,46 @@
+ #elif defined(__ZTC__)
+ #  define LZO_CC_ZORTECHC       1
+ #  define LZO_INFO_CC           "Zortech C"
+-#  if (__ZTC__ == 0x310)
++#  if ((__ZTC__-0) == 0x310)
+ #    define LZO_INFO_CCVER      "0x310"
+ #  else
+ #    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(__ZTC__)
+ #  endif
++#elif defined(__GNUC__) && defined(__VERSION__)
++#  if defined(__GNUC_MINOR__) && defined(__GNUC_PATCHLEVEL__)
++#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100 + (__GNUC_PATCHLEVEL__-0))
++#  elif defined(__GNUC_MINOR__)
++#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L + (__GNUC_MINOR__-0) * 0x100)
++#  else
++#    define LZO_CC_GNUC         (__GNUC__ * 0x10000L)
++#  endif
++#  define LZO_INFO_CC           "gcc"
++#  define LZO_INFO_CCVER        __VERSION__
++#elif defined(_MSC_VER) && ((_MSC_VER-0) > 0)
++#  define LZO_CC_MSC            _MSC_VER
++#  define LZO_INFO_CC           "Microsoft C"
++#  if defined(_MSC_FULL_VER)
++#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER) "." LZO_PP_MACRO_EXPAND(_MSC_FULL_VER)
++#  else
++#    define LZO_INFO_CCVER      LZO_PP_MACRO_EXPAND(_MSC_VER)
++#  endif
+ #else
+ #  define LZO_CC_UNKNOWN        1
+ #  define LZO_INFO_CC           "unknown"
+ #  define LZO_INFO_CCVER        "unknown"
+ #endif
++#if (LZO_CC_GNUC) && defined(__OPEN64__)
++#  if defined(__OPENCC__) && defined(__OPENCC_MINOR__) && defined(__OPENCC_PATCHLEVEL__)
++#    define LZO_CC_OPEN64       (__OPENCC__ * 0x10000L + (__OPENCC_MINOR__-0) * 0x100 + (__OPENCC_PATCHLEVEL__-0))
++#    define LZO_CC_OPEN64_GNUC  LZO_CC_GNUC
++#  endif
++#endif
++#if (LZO_CC_GNUC) && defined(__PCC__)
++#  if defined(__PCC__) && defined(__PCC_MINOR__) && defined(__PCC_MINORMINOR__)
++#    define LZO_CC_PCC          (__PCC__ * 0x10000L + (__PCC_MINOR__-0) * 0x100 + (__PCC_MINORMINOR__-0))
++#    define LZO_CC_PCC_GNUC     LZO_CC_GNUC
++#  endif
++#endif
+ #if 0 && (LZO_CC_MSC && (_MSC_VER >= 1200)) && !defined(_MSC_FULL_VER)
+ #  error "LZO_CC_MSC: _MSC_FULL_VER is not defined"
+ #endif
+@@ -667,8 +769,10 @@
+ #  define LZO_INFO_ARCH             "generic"
+ #elif (LZO_OS_DOS16 || LZO_OS_OS216 || LZO_OS_WIN16)
+ #  define LZO_ARCH_I086             1
+-#  define LZO_ARCH_IA16             1
+ #  define LZO_INFO_ARCH             "i086"
++#elif defined(__aarch64__)
++#  define LZO_ARCH_ARM64            1
++#  define LZO_INFO_ARCH             "arm64"
+ #elif defined(__alpha__) || defined(__alpha) || defined(_M_ALPHA)
+ #  define LZO_ARCH_ALPHA            1
+ #  define LZO_INFO_ARCH             "alpha"
+@@ -684,10 +788,10 @@
+ #  define LZO_INFO_ARCH             "arm_thumb"
+ #elif defined(__IAR_SYSTEMS_ICC__) && defined(__ICCARM__)
+ #  define LZO_ARCH_ARM              1
+-#  if defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 1)
++#  if defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 1)
+ #    define LZO_ARCH_ARM_THUMB      1
+ #    define LZO_INFO_ARCH           "arm_thumb"
+-#  elif defined(__CPU_MODE__) && ((__CPU_MODE__)+0 == 2)
++#  elif defined(__CPU_MODE__) && ((__CPU_MODE__-0) == 2)
+ #    define LZO_INFO_ARCH           "arm"
+ #  else
+ #    define LZO_INFO_ARCH           "arm"
+@@ -805,53 +909,147 @@
+ #  error "FIXME - missing define for CPU architecture"
+ #endif
+ #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN32)
+-#  error "FIXME - missing WIN32 define for CPU architecture"
++#  error "FIXME - missing LZO_OS_WIN32 define for CPU architecture"
+ #endif
+ #if 1 && (LZO_ARCH_UNKNOWN) && (LZO_OS_WIN64)
+-#  error "FIXME - missing WIN64 define for CPU architecture"
++#  error "FIXME - missing LZO_OS_WIN64 define for CPU architecture"
+ #endif
+ #if (LZO_OS_OS216 || LZO_OS_WIN16)
+ #  define LZO_ARCH_I086PM           1
+-#  define LZO_ARCH_IA16PM           1
+ #elif 1 && (LZO_OS_DOS16 && defined(BLX286))
+ #  define LZO_ARCH_I086PM           1
+-#  define LZO_ARCH_IA16PM           1
+ #elif 1 && (LZO_OS_DOS16 && defined(DOSX286))
+ #  define LZO_ARCH_I086PM           1
+-#  define LZO_ARCH_IA16PM           1
+ #elif 1 && (LZO_OS_DOS16 && LZO_CC_BORLANDC && defined(__DPMI16__))
+ #  define LZO_ARCH_I086PM           1
+-#  define LZO_ARCH_IA16PM           1
+ #endif
+-#if (LZO_ARCH_ARM_THUMB) && !(LZO_ARCH_ARM)
+-#  error "this should not happen"
++#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64)
++#  define LZO_ARCH_X64              1
++#elif (!LZO_ARCH_AMD64 && LZO_ARCH_X64) && defined(__LZO_ARCH_OVERRIDE)
++#  define LZO_ARCH_AMD64            1
++#endif
++#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64)
++#  define LZO_ARCH_AARCH64          1
++#elif (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64) && defined(__LZO_ARCH_OVERRIDE)
++#  define LZO_ARCH_ARM64            1
++#endif
++#if (LZO_ARCH_I386 && !LZO_ARCH_X86)
++#  define LZO_ARCH_X86              1
++#elif (!LZO_ARCH_I386 && LZO_ARCH_X86) && defined(__LZO_ARCH_OVERRIDE)
++#  define LZO_ARCH_I386            1
++#endif
++#if (LZO_ARCH_AMD64 && !LZO_ARCH_X64) || (!LZO_ARCH_AMD64 && LZO_ARCH_X64)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_ARM64 && !LZO_ARCH_AARCH64) || (!LZO_ARCH_ARM64 && LZO_ARCH_AARCH64)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_I386 && !LZO_ARCH_X86) || (!LZO_ARCH_I386 && LZO_ARCH_X86)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_ARM_THUMB && !LZO_ARCH_ARM)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_ARM_THUMB1 && !LZO_ARCH_ARM_THUMB)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_ARM_THUMB2 && !LZO_ARCH_ARM_THUMB)
++#  error "unexpected configuration - check your compiler defines"
+ #endif
+-#if (LZO_ARCH_I086PM) && !(LZO_ARCH_I086)
+-#  error "this should not happen"
++#if (LZO_ARCH_ARM_THUMB1 && LZO_ARCH_ARM_THUMB2)
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_I086PM && !LZO_ARCH_I086)
++#  error "unexpected configuration - check your compiler defines"
+ #endif
+ #if (LZO_ARCH_I086)
+ #  if (UINT_MAX != LZO_0xffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #  if (ULONG_MAX != LZO_0xffffffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #endif
+ #if (LZO_ARCH_I386)
+ #  if (UINT_MAX != LZO_0xffffL) && defined(__i386_int16__)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #  if (UINT_MAX != LZO_0xffffffffL) && !defined(__i386_int16__)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
+ #  endif
+ #  if (ULONG_MAX != LZO_0xffffffffL)
+-#    error "this should not happen"
++#    error "unexpected configuration - check your compiler defines"
++#  endif
++#endif
++#if (LZO_ARCH_AMD64 || LZO_ARCH_I386)
++#  if !defined(LZO_TARGET_FEATURE_SSE2)
++#    if defined(__SSE2__)
++#      define LZO_TARGET_FEATURE_SSE2       1
++#    elif defined(_MSC_VER) && ((defined(_M_IX86_FP) && ((_M_IX86_FP)+0 >= 2)) || defined(_M_AMD64))
++#      define LZO_TARGET_FEATURE_SSE2       1
++#    endif
++#  endif
++#  if !defined(LZO_TARGET_FEATURE_SSSE3)
++#  if (LZO_TARGET_FEATURE_SSE2)
++#    if defined(__SSSE3__)
++#      define LZO_TARGET_FEATURE_SSSE3      1
++#    elif defined(_MSC_VER) && defined(__AVX__)
++#      define LZO_TARGET_FEATURE_SSSE3      1
++#    endif
++#  endif
++#  endif
++#  if !defined(LZO_TARGET_FEATURE_SSE4_2)
++#  if (LZO_TARGET_FEATURE_SSSE3)
++#    if defined(__SSE4_2__)
++#      define LZO_TARGET_FEATURE_SSE4_2     1
++#    endif
++#  endif
++#  endif
++#  if !defined(LZO_TARGET_FEATURE_AVX)
++#  if (LZO_TARGET_FEATURE_SSSE3)
++#    if defined(__AVX__)
++#      define LZO_TARGET_FEATURE_AVX        1
++#    endif
++#  endif
++#  endif
++#  if !defined(LZO_TARGET_FEATURE_AVX2)
++#  if (LZO_TARGET_FEATURE_AVX)
++#    if defined(__AVX2__)
++#      define LZO_TARGET_FEATURE_AVX2       1
++#    endif
++#  endif
++#  endif
++#endif
++#if (LZO_TARGET_FEATURE_SSSE3 && !(LZO_TARGET_FEATURE_SSE2))
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_TARGET_FEATURE_SSE4_2 && !(LZO_TARGET_FEATURE_SSSE3))
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_TARGET_FEATURE_AVX && !(LZO_TARGET_FEATURE_SSSE3))
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_TARGET_FEATURE_AVX2 && !(LZO_TARGET_FEATURE_AVX))
++#  error "unexpected configuration - check your compiler defines"
++#endif
++#if (LZO_ARCH_ARM)
++#  if !defined(LZO_TARGET_FEATURE_NEON)
++#    if defined(__ARM_NEON__)
++#      define LZO_TARGET_FEATURE_NEON       1
++#    endif
++#  endif

*** DIFF OUTPUT TRUNCATED AT 1000 LINES ***



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?53dead6e.578b.1dbe8152>