diff options
author | Evan Green <evgreen@chromium.org> | 2019-09-23 11:02:41 -0700 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2019-10-05 00:47:44 +0000 |
commit | e34fca3e01d75552ad8d712879c3ccd6a6168584 (patch) | |
tree | e2a71c2fa4dd52ffe459d10156276fbb0b5aa597 /builtin | |
parent | a1216326c5d58af300b7c6f24c8597a232ced131 (diff) | |
download | chrome-ec-e34fca3e01d75552ad8d712879c3ccd6a6168584.tar.gz |
builtin: Introduce and use inttypes.h
In order to pass the right printf format specifiers for certain types
that are compiled both in 32-bit EC and 64-bit host environments,
standard macros PRIx64 and PRId64 must be introduced. These specify
the correct printf format specifier in the given compilation environment
for printing a 64-bit value.
On the host, inttypes.h already exists. Add an inttypes.h for the EC
codebase so that these macros can be used where they're needed.
BUG=chromium:984041
TEST=make -j buildall
BRANCH=none
Change-Id: I76e3bdc88aef7da6e5234d5b86b595f7138ea9a1
Signed-off-by: Evan Green <evgreen@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/1819642
Reviewed-by: caveh jalali <caveh@chromium.org>
Reviewed-by: Jack Rosenthal <jrosenth@chromium.org>
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/inttypes.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/builtin/inttypes.h b/builtin/inttypes.h new file mode 100644 index 0000000000..c442fbe499 --- /dev/null +++ b/builtin/inttypes.h @@ -0,0 +1,12 @@ +/* Copyright 2019 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_INTTYPES_H__ +#define __CROS_EC_INTTYPES_H__ + +#define PRIx64 "llx" +#define PRId64 "lld" + +#endif /* __CROS_EC_INTTYPES_H__ */ |