summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Hughes <tomhughes@chromium.org>2022-07-15 10:31:26 -0700
committerChromeos LUCI <chromeos-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-07-19 17:55:20 +0000
commit3eb29b6aa5a4e5e8c85046be789c6dd8d38afbaa (patch)
tree9490ccdaf8dcd9f377c13172da7da44072c69055
parentb6f385a4492b61ab171dcb97e352cf13e3a21b05 (diff)
downloadchrome-ec-3eb29b6aa5a4e5e8c85046be789c6dd8d38afbaa.tar.gz
builtin: Move ssize_t to sys/types.h
According to POSIX ssize_t should be defined in sys/types.h, not stddef.h: https://pubs.opengroup.org/onlinepubs/9699919799.2018edition/basedefs/sys_types.h.html BRANCH=none BUG=b:234181908 TEST=./util/compare_build.sh -b all => MATCH Signed-off-by: Tom Hughes <tomhughes@chromium.org> Change-Id: I027a2b26dc183c506d691d483c86644d04db9282 Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/3765450 Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
-rw-r--r--builtin/stddef.h6
-rw-r--r--builtin/sys/types.h7
-rw-r--r--driver/accelgyro_icm_common.h2
-rw-r--r--driver/fingerprint/fpc/libfp/fpc_private.c1
4 files changed, 10 insertions, 6 deletions
diff --git a/builtin/stddef.h b/builtin/stddef.h
index de8a67688e..d93a8c7f9f 100644
--- a/builtin/stddef.h
+++ b/builtin/stddef.h
@@ -11,12 +11,6 @@
#endif
typedef __SIZE_TYPE__ size_t;
-/* There is a GCC macro for a size_t type, but not for a ssize_t type.
- * The following construct convinces GCC to make __SIZE_TYPE__ signed.
- */
-#define unsigned signed
-typedef __SIZE_TYPE__ ssize_t;
-#undef unsigned
#ifndef NULL
#define NULL ((void *)0)
diff --git a/builtin/sys/types.h b/builtin/sys/types.h
index 3f8de955e0..57dd4ac479 100644
--- a/builtin/sys/types.h
+++ b/builtin/sys/types.h
@@ -9,4 +9,11 @@
/* Data type for POSIX style clock() implementation */
typedef long clock_t;
+/* There is a GCC macro for a size_t type, but not for a ssize_t type.
+ * The following construct convinces GCC to make __SIZE_TYPE__ signed.
+ */
+#define unsigned signed
+typedef __SIZE_TYPE__ ssize_t;
+#undef unsigned
+
#endif /* __CROS_EC_SYS_TYPES_H__ */
diff --git a/driver/accelgyro_icm_common.h b/driver/accelgyro_icm_common.h
index 89586a482f..7845f68177 100644
--- a/driver/accelgyro_icm_common.h
+++ b/driver/accelgyro_icm_common.h
@@ -8,6 +8,8 @@
#ifndef __CROS_EC_ACCELGYRO_ICM_COMMON_H
#define __CROS_EC_ACCELGYRO_ICM_COMMON_H
+#include <sys/types.h>
+
#include "accelgyro.h"
#include "hwtimer.h"
#include "timer.h"
diff --git a/driver/fingerprint/fpc/libfp/fpc_private.c b/driver/fingerprint/fpc/libfp/fpc_private.c
index e383bb14d9..0af7297119 100644
--- a/driver/fingerprint/fpc/libfp/fpc_private.c
+++ b/driver/fingerprint/fpc/libfp/fpc_private.c
@@ -4,6 +4,7 @@
*/
#include <stddef.h>
+#include <sys/types.h>
#include "common.h"
#include "console.h"
#include "fpc_bio_algorithm.h"