summaryrefslogtreecommitdiff
path: root/builtin/stdint.h
diff options
context:
space:
mode:
authorStefan Reinauer <stefan.reinauer@coreboot.org>2016-01-20 18:36:20 -0800
committerchrome-bot <chrome-bot@chromium.org>2016-02-03 15:00:50 -0800
commitbc404c94b4ab1e6a62e607fd7ef034aa31d6388e (patch)
tree559e85fa8eca3ee7156f9f5333707755c43905c6 /builtin/stdint.h
parentfc9ed52397f232bfc9f9d2b448e8bc253c87379f (diff)
downloadchrome-ec-bc404c94b4ab1e6a62e607fd7ef034aa31d6388e.tar.gz
Enforce compilation without system headers
This patch introduces HOST_CPPFLAGS to be used for all objects being compiled with HOSTCC rather then the target compiler. Since glibc is not linked into the EC, no glibc include files should be included in the EC code base. Hence, create local definitions for clock_t and wchar_t that match what the glibc include would have done, and remove some unneeded includes. Due to very eager optimization, we have to give gcc a little notch to not kick out memset. Signed-off-by: Stefan Reinauer <reinauer@chromium.org> BUG=chrome-os-partner:43025 BUG=chrome-os-partner:49517 BRANCH=none TEST=compile tested Change-Id: Idf3a2881fa8352756b0927b09c6a97473358f239 Reviewed-on: https://chromium-review.googlesource.com/322435 Commit-Ready: Patrick Georgi <pgeorgi@chromium.org> Tested-by: Patrick Georgi <pgeorgi@chromium.org> Reviewed-by: Patrick Georgi <pgeorgi@chromium.org>
Diffstat (limited to 'builtin/stdint.h')
-rw-r--r--builtin/stdint.h38
1 files changed, 38 insertions, 0 deletions
diff --git a/builtin/stdint.h b/builtin/stdint.h
new file mode 100644
index 0000000000..75cf8d8ebf
--- /dev/null
+++ b/builtin/stdint.h
@@ -0,0 +1,38 @@
+/* Copyright 2016 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_STDINT_H__
+#define __CROS_EC_STDINT_H__
+
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+
+typedef unsigned long long uint64_t;
+typedef signed long long int64_t;
+
+typedef int intptr_t;
+typedef unsigned int uintptr_t;
+
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767U)
+#endif
+
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647U)
+#endif
+
+#endif /* __CROS_EC_STDINT_H__ */