summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2021-07-02 14:05:47 -0400
committerPeter Jones <pjones@redhat.com>2021-07-20 09:44:25 -0400
commitb092c85fc3e9caec83728b244a34ed8325a02c6d (patch)
tree6c0f4929d2627641136467ed0b20b6d0727c0397
parent5f08e671e4eb4ec43c1bf667e67f02b7454e13b0 (diff)
downloadefi-boot-shim-b092c85fc3e9caec83728b244a34ed8325a02c6d.tar.gz
efi-boot-shim-b092c85fc3e9caec83728b244a34ed8325a02c6d.zip
test.c: Conditionally do not declare stuff that's in other places
test.c duplicates a couple of objects (StrnCmp, StrCmp) that are in libefi.a, as well as SHIM_LOCK_GUID from lib/guid.o. While it's nice to have these at some places, we need to disable them if we're actually linking a test case against either of those. This patch adds HAVE_foo guards around those objects. Signed-off-by: Peter Jones <pjones@redhat.com>
-rw-r--r--test.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/test.c b/test.c
index dc71941f..9da5cf5b 100644
--- a/test.c
+++ b/test.c
@@ -22,6 +22,7 @@ LogError_(const char *file, int line, const char *func, const CHAR16 *fmt, ...)
return EFI_SUCCESS;
}
+#ifndef HAVE_STRCMP
INTN
StrCmp(CONST CHAR16 *s1, CONST CHAR16 *s2) {
assert(s1 != NULL);
@@ -34,7 +35,9 @@ StrCmp(CONST CHAR16 *s1, CONST CHAR16 *s2) {
}
return 0;
}
+#endif
+#ifndef HAVE_STRNCMP
INTN
StrnCmp(CONST CHAR16 *s1, CONST CHAR16 *s2, UINTN len) {
assert(s1 != NULL);
@@ -48,20 +51,27 @@ StrnCmp(CONST CHAR16 *s1, CONST CHAR16 *s2, UINTN len) {
}
return 0;
}
+#endif
+#ifndef HAVE_GET_VARIABLE_ATTR
EFI_STATUS
get_variable_attr(const CHAR16 * const var, UINT8 **data, UINTN *len,
EFI_GUID owner, UINT32 *attributes)
{
return EFI_UNSUPPORTED;
}
+#endif
+#ifndef HAVE_GET_VARIABLE
EFI_STATUS
get_variable(const CHAR16 * const var, UINT8 **data, UINTN *len, EFI_GUID owner)
{
return get_variable_attr(var, data, len, owner, NULL);
}
+#endif
+#ifndef HAVE_SHIM_LOCK_GUID
EFI_GUID SHIM_LOCK_GUID = {0x605dab50, 0xe046, 0x4300, {0xab, 0xb6, 0x3d, 0xd8, 0x10, 0xdd, 0x8b, 0x23 } };
+#endif
// vim:fenc=utf-8:tw=75:noet