summaryrefslogtreecommitdiff
path: root/payloads/libpayload
diff options
context:
space:
mode:
authorThomas Heijligen <src@posteo.de>2022-11-28 11:46:48 +0100
committerFelix Held <felix-coreboot@felixheld.de>2023-02-16 17:55:37 +0000
commit3f9613bf6dbf84313b46c3ca364457e28bc00008 (patch)
treef5b96abea0b968f636b2c921b705dc14f181f494 /payloads/libpayload
parent3d91563c98296ea9947cfab4077f8d8cd1a78835 (diff)
commonlib/bsd, libpayload: Do not include helpers.h in stddef.h
`stddef.h` should only provide the definitions defined by ISO or Posix. The included `commonlib/bsd/helpers.h` provide a lot of non standard definitions that may interfere with definitions from the application. Change-Id: Ia71edbc3ffe6694ff4b971decf3a41f915264bc8 Signed-off-by: Thomas Heijligen <src@posteo.de> Reviewed-on: https://review.coreboot.org/c/coreboot/+/70116 Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Diffstat (limited to 'payloads/libpayload')
-rw-r--r--payloads/libpayload/arch/x86/boot_media.c6
-rw-r--r--payloads/libpayload/include/stddef.h5
2 files changed, 5 insertions, 6 deletions
diff --git a/payloads/libpayload/arch/x86/boot_media.c b/payloads/libpayload/arch/x86/boot_media.c
index 99fb4e3c2a..07e08b6134 100644
--- a/payloads/libpayload/arch/x86/boot_media.c
+++ b/payloads/libpayload/arch/x86/boot_media.c
@@ -1,11 +1,7 @@
/* SPDX-License-Identifier: BSD-3-Clause */
-#include <arch/virtual.h>
+#include <libpayload.h>
#include <boot_device.h>
-#include <commonlib/bsd/cb_err.h>
-#include <stddef.h>
-#include <string.h>
-#include <sysinfo.h>
__attribute__((weak)) ssize_t boot_device_read(void *buf, size_t offset, size_t size)
{
diff --git a/payloads/libpayload/include/stddef.h b/payloads/libpayload/include/stddef.h
index fb6ec9bf20..9003ac9550 100644
--- a/payloads/libpayload/include/stddef.h
+++ b/payloads/libpayload/include/stddef.h
@@ -2,7 +2,10 @@
#define _STDDEF_H
#include <arch/types.h>
-#include <commonlib/bsd/helpers.h>
+
+#if !defined(offsetof)
+#define offsetof(type, member) __builtin_offsetof(type, member)
+#endif
#ifndef __WCHAR_TYPE__
#define __WCHAR_TYPE__ int