summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorCarl Hamilton <carlh@chromium.org>2016-10-14 15:53:01 -0700
committerchrome-bot <chrome-bot@chromium.org>2016-10-17 17:41:06 -0700
commit066d1b6a5f6b8e77c327615b60677a65d70c7379 (patch)
tree3f650e2108a0535c0a32d4a9913b26bcfe1e0f7e /builtin
parent38cf4fccfbd01235979641dfe4ee67da7b60fbdb (diff)
downloadchrome-ec-066d1b6a5f6b8e77c327615b60677a65d70c7379.tar.gz
Added "stdbool.h" and definition of uint_least8_t to "stdint.h".
The two types added, bool and uint_least8_t, are needed by the nanopb common header file "pb.h". The file added and the file modified are EC versions of files that are normally provided by the compiler. This change follows the approach already take to provide our own, mimimalist versions of these files. BUG=none BRANCH=none TEST=make buildall -j Change-Id: I892e25b14f7cbe3ecca6f60d6a2955d4d628e3a9 Reviewed-on: https://chromium-review.googlesource.com/398921 Commit-Ready: Carl Hamilton <carlh@chromium.org> Tested-by: Carl Hamilton <carlh@chromium.org> Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/stdbool.h13
-rw-r--r--builtin/stdint.h2
2 files changed, 15 insertions, 0 deletions
diff --git a/builtin/stdbool.h b/builtin/stdbool.h
new file mode 100644
index 0000000000..6e0f92dfc0
--- /dev/null
+++ b/builtin/stdbool.h
@@ -0,0 +1,13 @@
+/* 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_STDBOOL_H__
+#define __CROS_EC_STDBOOL_H__
+
+#define bool _Bool
+#define true 1
+#define false 0
+
+#endif /* __CROS_EC_STDBOOL_H__ */
diff --git a/builtin/stdint.h b/builtin/stdint.h
index 75cf8d8ebf..f80a46f1a5 100644
--- a/builtin/stdint.h
+++ b/builtin/stdint.h
@@ -21,6 +21,8 @@ typedef signed long long int64_t;
typedef int intptr_t;
typedef unsigned int uintptr_t;
+typedef uint8_t uint_least8_t;
+
#ifndef UINT16_MAX
#define UINT16_MAX (65535U)
#endif