Skip to content

Commit

Permalink
LZO: do not use lzoutils.h macros
Browse files Browse the repository at this point in the history
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 <[email protected]>
Acked-by: Arne Schwabe <[email protected]>
Message-Id: <[email protected]>
URL: https://www.mail-archive.com/[email protected]/msg28705.html
Signed-off-by: Gert Doering <[email protected]>
(cherry picked from commit d601237)
  • Loading branch information
flichtenheld authored and cron2 committed Jun 5, 2024
1 parent 2f2ff18 commit 1ae753e
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 21 deletions.
3 changes: 0 additions & 3 deletions config.h.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,6 @@ don't. */
/* Define to 1 if you have the <lzo1x.h> header file. */
#define HAVE_LZO1X_H 1

/* Define to 1 if you have the <lzoutil.h> header file. */
#define HAVE_LZOUTIL_H 1

/* Define to 1 if you have the `mlockall' function. */
#cmakedefine HAVE_MLOCKALL

Expand Down
9 changes: 0 additions & 9 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1169,15 +1169,6 @@ fi
if test "${have_lzo}" = "yes"; then
saved_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} ${LZO_CFLAGS}"
AC_CHECK_HEADERS(
[lzo/lzoutil.h],
,
[AC_CHECK_HEADERS(
[lzoutil.h],
,
[AC_MSG_ERROR([lzoutil.h is missing])]
)]
)
AC_CHECK_HEADERS(
[lzo/lzo1x.h],
,
Expand Down
4 changes: 2 additions & 2 deletions src/openvpn/lzo.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,14 @@ lzo_compress_init(struct compress_context *compctx)
{
msg(M_FATAL, "Cannot initialize LZO compression library (lzo_init() returns %d)", lzo_status);
}
compctx->wu.lzo.wmem = (lzo_voidp) lzo_malloc(compctx->wu.lzo.wmem_size);
compctx->wu.lzo.wmem = (lzo_voidp) malloc(compctx->wu.lzo.wmem_size);
check_malloc_return(compctx->wu.lzo.wmem);
}

static void
lzo_compress_uninit(struct compress_context *compctx)
{
lzo_free(compctx->wu.lzo.wmem);
free(compctx->wu.lzo.wmem);
compctx->wu.lzo.wmem = NULL;
}

Expand Down
9 changes: 2 additions & 7 deletions src/openvpn/lzo.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,11 @@
#if defined(HAVE_LZO_CONF_H)
/* The lzo.h magic gets confused and still wants
* to include lzo/lzoconf.h even if our include paths
* are setup to include the paths without lzo/ include lzoconf.h to
* avoid it being include by lzoutil.h */
* are setup to include the paths without lzo/
*/
#include <lzodefs.h>
#include <lzoconf.h>
#endif
#if defined(HAVE_LZO_LZOUTIL_H)
#include <lzo/lzoutil.h>
#elif defined(HAVE_LZOUTIL_H)
#include <lzoutil.h>
#endif
#if defined(HAVE_LZO_LZO1X_H)
#include <lzo/lzo1x.h>
#elif defined(HAVE_LZO1X_H)
Expand Down

0 comments on commit 1ae753e

Please sign in to comment.