Browse code

LZO: do not use lzoutils.h macros

Instead of lzo_{free,malloc} we can just use the
free and malloc as the lzoutils.h header itself
suggests.

Change-Id: I32ee28fde5d38d736f753c782d88a81de7fe2980
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Arne Schwabe <arne-openvpn@rfc2549.org>
Message-Id: <20240604211708.32315-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg28705.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit d601237976323b5d8f6ac65c27ccc510563ad75f)

Frank Lichtenheld authored on 2024/06/05 06:17:08
Showing 4 changed files
... ...
@@ -181,9 +181,6 @@ don't. */
181 181
 /* Define to 1 if you have the <lzo1x.h> header file. */
182 182
 #define HAVE_LZO1X_H 1
183 183
 
184
-/* Define to 1 if you have the <lzoutil.h> header file. */
185
-#define HAVE_LZOUTIL_H 1
186
-
187 184
 /* Define to 1 if you have the `mlockall' function. */
188 185
 #cmakedefine HAVE_MLOCKALL
189 186
 
... ...
@@ -1170,15 +1170,6 @@ if test "${have_lzo}" = "yes"; then
1170 1170
 	saved_CFLAGS="${CFLAGS}"
1171 1171
 	CFLAGS="${CFLAGS} ${LZO_CFLAGS}"
1172 1172
 	AC_CHECK_HEADERS(
1173
-		[lzo/lzoutil.h],
1174
-		,
1175
-		[AC_CHECK_HEADERS(
1176
-			[lzoutil.h],
1177
-			,
1178
-			[AC_MSG_ERROR([lzoutil.h is missing])]
1179
-		)]
1180
-	)
1181
-	AC_CHECK_HEADERS(
1182 1173
 		[lzo/lzo1x.h],
1183 1174
 		,
1184 1175
 		[AC_CHECK_HEADERS(
... ...
@@ -107,14 +107,14 @@ lzo_compress_init(struct compress_context *compctx)
107 107
     {
108 108
         msg(M_FATAL, "Cannot initialize LZO compression library (lzo_init() returns %d)", lzo_status);
109 109
     }
110
-    compctx->wu.lzo.wmem = (lzo_voidp) lzo_malloc(compctx->wu.lzo.wmem_size);
110
+    compctx->wu.lzo.wmem = (lzo_voidp) malloc(compctx->wu.lzo.wmem_size);
111 111
     check_malloc_return(compctx->wu.lzo.wmem);
112 112
 }
113 113
 
114 114
 static void
115 115
 lzo_compress_uninit(struct compress_context *compctx)
116 116
 {
117
-    lzo_free(compctx->wu.lzo.wmem);
117
+    free(compctx->wu.lzo.wmem);
118 118
     compctx->wu.lzo.wmem = NULL;
119 119
 }
120 120
 
... ...
@@ -40,16 +40,11 @@
40 40
 #if defined(HAVE_LZO_CONF_H)
41 41
 /* The lzo.h magic gets confused and still wants
42 42
  * to include lzo/lzoconf.h even if our include paths
43
- * are setup to include the paths without lzo/ include lzoconf.h to
44
- * avoid it being include by lzoutil.h */
43
+ * are setup to include the paths without lzo/
44
+ */
45 45
 #include <lzodefs.h>
46 46
 #include <lzoconf.h>
47 47
 #endif
48
-#if defined(HAVE_LZO_LZOUTIL_H)
49
-#include <lzo/lzoutil.h>
50
-#elif defined(HAVE_LZOUTIL_H)
51
-#include <lzoutil.h>
52
-#endif
53 48
 #if defined(HAVE_LZO_LZO1X_H)
54 49
 #include <lzo/lzo1x.h>
55 50
 #elif defined(HAVE_LZO1X_H)