From c116b0359509e00b0e868bd40459d05ff3b78469 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Zbigniew=20J=C4=99drzejewski-Szmek?= Date: Wed, 29 Nov 2017 15:06:53 +0100 Subject: [PATCH] Define CRYPT_LUKS in crypt-util.h Also do not include libcryptsetup.h directly, but only through crypt-util.h. This way we do not have to repeat the define in every file where it is used. --- src/basic/crypt-util.h | 5 +++++ src/cryptsetup/cryptsetup.c | 6 ------ src/shared/dissect-image.c | 7 ------- 3 files changed, 5 insertions(+), 13 deletions(-) diff --git a/src/basic/crypt-util.h b/src/basic/crypt-util.h index e8e753275a3..537f7856079 100644 --- a/src/basic/crypt-util.h +++ b/src/basic/crypt-util.h @@ -23,6 +23,11 @@ #include "macro.h" +/* libcryptsetup define for any LUKS version, compatible with libcryptsetup 1.x */ +#ifndef CRYPT_LUKS +#define CRYPT_LUKS NULL +#endif + DEFINE_TRIVIAL_CLEANUP_FUNC(struct crypt_device *, crypt_free); void cryptsetup_log_glue(int level, const char *msg, void *usrptr); diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c index 84bcdb467da..ab4d24ca3bc 100644 --- a/src/cryptsetup/cryptsetup.c +++ b/src/cryptsetup/cryptsetup.c @@ -19,7 +19,6 @@ ***/ #include -#include #include #include #include @@ -40,11 +39,6 @@ #include "strv.h" #include "util.h" -/* libcryptsetup define for any LUKS version, compatible with libcryptsetup 1.x */ -#ifndef CRYPT_LUKS -#define CRYPT_LUKS NULL -#endif - /* internal helper */ #define ANY_LUKS "LUKS" diff --git a/src/shared/dissect-image.c b/src/shared/dissect-image.c index 2714b3921cb..6f294ed0bf2 100644 --- a/src/shared/dissect-image.c +++ b/src/shared/dissect-image.c @@ -18,13 +18,6 @@ along with systemd; If not, see . ***/ -#if HAVE_LIBCRYPTSETUP -#include -#ifndef CRYPT_LUKS -#define CRYPT_LUKS NULL -#endif -#endif - #include #include #include -- 2.47.3