diff options
author | James Le Cuirot <chewi@gentoo.org> | 2023-11-04 23:31:57 +0000 |
---|---|---|
committer | James Le Cuirot <chewi@gentoo.org> | 2023-11-13 22:12:47 +0000 |
commit | f70ca0aa2b8c06f679e05a1b0a9509af6b5ae87a (patch) | |
tree | e6236388314e41f80e395b674903d293eab4ee2f /eclass | |
parent | media-libs/mlt: drop 7.20.0 (diff) | |
download | gentoo-f70ca0aa2b8c06f679e05a1b0a9509af6b5ae87a.tar.gz gentoo-f70ca0aa2b8c06f679e05a1b0a9509af6b5ae87a.tar.bz2 gentoo-f70ca0aa2b8c06f679e05a1b0a9509af6b5ae87a.zip |
toolchain-funcs.eclass: Add functions to get pointer size in bytes
tc-get-ptr-size for CHOST and tc-get-build-ptr-size for CBUILD.
Closes: https://bugs.gentoo.org/328401
Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'eclass')
-rw-r--r-- | eclass/toolchain-funcs.eclass | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/eclass/toolchain-funcs.eclass b/eclass/toolchain-funcs.eclass index 8fef764ad597..5da93063866b 100644 --- a/eclass/toolchain-funcs.eclass +++ b/eclass/toolchain-funcs.eclass @@ -1216,4 +1216,18 @@ tc-get-c-rtlib() { return 0 } +# @FUNCTION: tc-get-ptr-size +# @RETURN: Size of a pointer in bytes for CHOST (e.g. 4 or 8). +tc-get-ptr-size() { + $(tc-getCPP) -P - <<< __SIZEOF_POINTER__ || + die "Could not determine CHOST pointer size" +} + +# @FUNCTION: tc-get-build-ptr-size +# @RETURN: Size of a pointer in bytes for CBUILD (e.g. 4 or 8). +tc-get-build-ptr-size() { + $(tc-getBUILD_CPP) -P - <<< __SIZEOF_POINTER__ || + die "Could not determine CBUILD pointer size" +} + fi |