summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllen Webb <allenwebb@google.com>2018-12-14 10:07:27 -0800
committerchrome-bot <chrome-bot@chromium.org>2019-01-03 15:04:38 -0800
commit7a071bca73ca0e04f22aacb3dc26f63d5f9e2171 (patch)
treed49e8dc9f1463cf44e92af16326c170b13eb200a
parentaff8a2801d37a8e4bfc65735e134404a4e460fb1 (diff)
downloadchrome-ec-7a071bca73ca0e04f22aacb3dc26f63d5f9e2171.tar.gz
stdlib cleanup.
This cleanups some header includes to avoid conflicts between the ec headers and the standard c headers. BRANCH=None BUG=None TEST=make -j buildall && ./build_packages --board=veyron_minnie \ chromeos-ec && FEATURES=test emerge-veyron_minnie chromeos-ec Change-Id: Icf9022d688fd9c749f7a5f8673755188741b40e1 Signed-off-by: Allen Webb <allenwebb@google.com> Reviewed-on: https://chromium-review.googlesource.com/1378906 Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
-rw-r--r--chip/host/system.c5
-rw-r--r--core/host/panic.c4
-rw-r--r--fuzz/usb_pd_fuzz.c2
-rw-r--r--test/vboot.c1
4 files changed, 5 insertions, 7 deletions
diff --git a/chip/host/system.c b/chip/host/system.c
index cc0c307d95..c691e6d181 100644
--- a/chip/host/system.c
+++ b/chip/host/system.c
@@ -5,8 +5,6 @@
/* System module for emulator */
-#include <stdlib.h>
-
#include "common.h"
#include "host_test.h"
#include "panic.h"
@@ -16,6 +14,9 @@
#include "timer.h"
#include "util.h"
+// Forward declaration from <stdlib.h> to avoid declaration conflicts.
+void exit(int);
+
#define SHARED_MEM_SIZE 0x2000 /* bytes */
#define RAM_DATA_SIZE (sizeof(struct panic_data) + 512) /* bytes */
uint8_t __shared_mem_buf[SHARED_MEM_SIZE + RAM_DATA_SIZE];
diff --git a/core/host/panic.c b/core/host/panic.c
index ee21577aec..21ab642338 100644
--- a/core/host/panic.c
+++ b/core/host/panic.c
@@ -6,11 +6,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include "common.h"
-#include "panic.h"
#include "stack_trace.h"
-#include "test_util.h"
-#include "util.h"
void panic_assert_fail(const char *msg, const char *func, const char *fname,
int linenum)
diff --git a/fuzz/usb_pd_fuzz.c b/fuzz/usb_pd_fuzz.c
index ea385de2dc..f7563bb405 100644
--- a/fuzz/usb_pd_fuzz.c
+++ b/fuzz/usb_pd_fuzz.c
@@ -4,6 +4,7 @@
*
* Test USB PD module.
*/
+#define HIDE_EC_STDLIB
#include "common.h"
#include "task.h"
#include "tcpm.h"
@@ -15,6 +16,7 @@
#include <pthread.h>
#include <stdlib.h>
+#include <string.h>
#define TASK_EVENT_FUZZ TASK_EVENT_CUSTOM(1)
diff --git a/test/vboot.c b/test/vboot.c
index 69521eff6e..77f9c0af9f 100644
--- a/test/vboot.c
+++ b/test/vboot.c
@@ -5,7 +5,6 @@
* Test vboot
*/
-#include <stdlib.h>
#include "common.h"
#include "rsa.h"
#include "test_util.h"