summaryrefslogtreecommitdiff
path: root/Cryptlib/Include
diff options
context:
space:
mode:
authorGary Lin <glin@suse.com>2017-04-07 11:27:26 +0800
committerPeter Jones <pjones@redhat.com>2017-08-31 15:14:20 -0400
commit1b5dbc4b4df297e4a351ed2b8434a9021c4041d1 (patch)
treee3ddcde1b821adb028e4a058edd67d1d81156d34 /Cryptlib/Include
parent1d39ada8cb336d9e7c156be7526b674851fbdd40 (diff)
downloadefi-boot-shim-1b5dbc4b4df297e4a351ed2b8434a9021c4041d1.tar.gz
efi-boot-shim-1b5dbc4b4df297e4a351ed2b8434a9021c4041d1.zip
Cryptlib: Include stddef.h in CrtLibSupport.h
The changes in the openssl headers cause the inclusion of CrtLibSupport.h eariler than the inclusion of stddef.h, so "offsetof" was defined twice and this caused the followling build error: In file included from Cryptlib/Include/openssl/buffer.h:23:0, from Cryptlib/Include/openssl/x509.h:22, from shim.c:56: /usr/lib64/gcc/x86_64-suse-linux/6/include/stddef.h:417:0: error: "offsetof" redefined [-Werror] #define offsetof(TYPE, MEMBER) __builtin_offsetof (TYPE, MEMBER) In file included from Cryptlib/Include/limits.h:15:0, from Cryptlib/Include/openssl/ossl_typ.h:13, from Cryptlib/Include/openssl/x509.h:20, from shim.c:56: Cryptlib/Include/CrtLibSupport.h:192:0: note: this is the location of the previous definition #define offsetof(type, member) ( (int) & ((type*)0) -> member ) We can lower the priority of the gcc include path or just remove the path, but this might cause problem since the path was introduced on purpose(*). Instead, including stddef.h first is more feasible. (*) https://github.com/rhinstaller/shim/commit/d51739a416400ad348d8a1c7e3886abce11fff1b Signed-off-by: Gary Lin <glin@suse.com>
Diffstat (limited to 'Cryptlib/Include')
-rw-r--r--Cryptlib/Include/OpenSslSupport.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/Cryptlib/Include/OpenSslSupport.h b/Cryptlib/Include/OpenSslSupport.h
index f73bbc9b..fff6a526 100644
--- a/Cryptlib/Include/OpenSslSupport.h
+++ b/Cryptlib/Include/OpenSslSupport.h
@@ -23,6 +23,11 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/MemoryAllocationLib.h>
#include <Library/DebugLib.h>
+/*
+ * Include stddef.h to avoid redefining "offsetof"
+ */
+#include <stddef.h>
+
#define CONST const
//