diff --git a/src/swtpm/Makefile.am b/src/swtpm/Makefile.am index 68cf216..040a1d9 100644 --- a/src/swtpm/Makefile.am +++ b/src/swtpm/Makefile.am @@ -68,6 +68,7 @@ libswtpm_libtpms_la_CFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/swtpm \ + -I$(top_srcdir)/src/utils \ $(MY_CFLAGS) \ $(CFLAGS) \ $(HARDENING_CFLAGS) \ @@ -105,6 +106,7 @@ swtpm_CFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/swtpm \ + -I$(top_srcdir)/src/utils \ $(MY_CFLAGS) \ $(HARDENING_CFLAGS) \ $(GLIB_CFLAGS) \ @@ -131,6 +133,7 @@ swtpm_cuse_CFLAGS = \ -I$(top_builddir)/include \ -I$(top_srcdir)/include \ -I$(top_srcdir)/include/swtpm \ + -I$(top_srcdir)/src/utils \ $(MY_CFLAGS) \ $(GLIB_CFLAGS) \ $(LIBFUSE_CFLAGS) \ diff --git a/src/swtpm/ctrlchannel.c b/src/swtpm/ctrlchannel.c index ae29268..d50c6f3 100644 --- a/src/swtpm/ctrlchannel.c +++ b/src/swtpm/ctrlchannel.c @@ -61,6 +61,7 @@ #include "mainloop.h" #include "utils.h" #include "swtpm_debug.h" +#include "swtpm_utils.h" /* local variables */ diff --git a/src/swtpm/cuse_tpm.c b/src/swtpm/cuse_tpm.c index 11898b5..d577d88 100644 --- a/src/swtpm/cuse_tpm.c +++ b/src/swtpm/cuse_tpm.c @@ -78,6 +78,7 @@ #include "seccomp_profile.h" #include "options.h" #include "capabilities.h" +#include "swtpm_utils.h" /* maximum size of request buffer */ #define TPM_REQ_MAX 4096 diff --git a/src/swtpm/mainloop.c b/src/swtpm/mainloop.c index aa27e03..44d67b7 100644 --- a/src/swtpm/mainloop.c +++ b/src/swtpm/mainloop.c @@ -65,6 +65,7 @@ #include "utils.h" #include "sys_dependencies.h" #include "compiler_dependencies.h" +#include "swtpm_utils.h" /* local variables */ static TPM_MODIFIER_INDICATOR locality; diff --git a/src/swtpm/seccomp_profile.c b/src/swtpm/seccomp_profile.c index a0485c5..e2684f3 100644 --- a/src/swtpm/seccomp_profile.c +++ b/src/swtpm/seccomp_profile.c @@ -47,6 +47,7 @@ #include "logging.h" #include "utils.h" #include "seccomp_profile.h" +#include "swtpm_utils.h" #ifdef WITH_SECCOMP static int create_seccomp_profile_add_rules(scmp_filter_ctx ctx, diff --git a/src/swtpm/swtpm_nvstore.c b/src/swtpm/swtpm_nvstore.c index d7ebf6e..9480150 100644 --- a/src/swtpm/swtpm_nvstore.c +++ b/src/swtpm/swtpm_nvstore.c @@ -87,6 +87,7 @@ #include "swtpm_aes.h" #include "swtpm_debug.h" #include "swtpm_nvstore.h" +#include "swtpm_utils.h" #include "key.h" #include "logging.h" #include "tpmstate.h" diff --git a/src/swtpm/tpmlib.c b/src/swtpm/tpmlib.c index b9eb83f..657f7f5 100644 --- a/src/swtpm/tpmlib.c +++ b/src/swtpm/tpmlib.c @@ -58,6 +58,7 @@ #endif #include "utils.h" #include "compiler_dependencies.h" +#include "swtpm_utils.h" /* * convert the blobtype integer into a string that libtpms diff --git a/src/swtpm/utils.h b/src/swtpm/utils.h index ea4c942..7502442 100644 --- a/src/swtpm/utils.h +++ b/src/swtpm/utils.h @@ -45,9 +45,6 @@ #include -#define min(a,b) ((a) < (b) ? (a) : (b)) -#define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0])) - #define ROUND_TO_NEXT_POWER_OF_2_32(a) \ do { \ a--; \ diff --git a/src/utils/swtpm_utils.h b/src/utils/swtpm_utils.h index b537932..70a0e4e 100644 --- a/src/utils/swtpm_utils.h +++ b/src/utils/swtpm_utils.h @@ -14,7 +14,8 @@ #include -#define min(X,Y) (X) < (Y) ? (X) : (Y) +#define min(X,Y) ((X) < (Y) ? (X) : (Y)) +#define ARRAY_LEN(a) (sizeof(a) / sizeof((a)[0])) extern gchar *gl_LOGFILE;