summaryrefslogtreecommitdiff
path: root/builtin/sys
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-06-06 12:26:06 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-06-09 19:18:26 +0000
commit02afda7df5b23708ba3d8a7f0b5d2f66ae099ffe (patch)
tree1dbb735d9a1e7215914fe669ecd2a3081bff894d /builtin/sys
parentf2eaf664aff60009e43bd575a2cebbe10524b17e (diff)
downloadchrome-ec-02afda7df5b23708ba3d8a7f0b5d2f66ae099ffe.tar.gz
timer.h: Avoid redefining clock_t when compiling with libc
Move the clock_t typedef to the "builtin" directory, which the directory containing headers that mirror those in the C standard library. The "builtin" directory can then be excluded when building with the standard library. include/timer.h:31:14: error: typedef redefinition with different types ('long' vs 'unsigned long') typedef long clock_t; ^ /usr/armv7m-cros-eabi/include/sys/types.h:107:19: note: previous definition is here typedef _CLOCK_T_ clock_t; ^ BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all -j 120 => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: Ib2381664535781035b367b414c5f00639ce9b9af Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3691958 Reviewed-by: Edward Hill <ecgh@chromium.org>
Diffstat (limited to 'builtin/sys')
-rw-r--r--builtin/sys/types.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/sys/types.h b/builtin/sys/types.h
new file mode 100644
index 0000000000..3f8de955e0
--- /dev/null
+++ b/builtin/sys/types.h
@@ -0,0 +1,12 @@
+/* Copyright 2022 The ChromiumOS Authors.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+#ifndef __CROS_EC_SYS_TYPES_H__
+#define __CROS_EC_SYS_TYPES_H__
+
+/* Data type for POSIX style clock() implementation */
+typedef long clock_t;
+
+#endif /* __CROS_EC_SYS_TYPES_H__ */