public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get pointer size in bytes
@ 2023-11-06 22:25 James Le Cuirot
  2023-11-08  6:44 ` Sam James
  0 siblings, 1 reply; 2+ messages in thread
From: James Le Cuirot @ 2023-11-06 22:25 UTC (permalink / raw)
  To: gentoo-dev; +Cc: James Le Cuirot

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>
---
 eclass/toolchain-funcs.eclass | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

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
-- 
2.41.0



^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get pointer size in bytes
  2023-11-06 22:25 [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get pointer size in bytes James Le Cuirot
@ 2023-11-08  6:44 ` Sam James
  0 siblings, 0 replies; 2+ messages in thread
From: Sam James @ 2023-11-08  6:44 UTC (permalink / raw)
  To: gentoo-dev; +Cc: James Le Cuirot, toolchain


James Le Cuirot <chewi@gentoo.org> writes:

> 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>
> ---

lgtm

>  eclass/toolchain-funcs.eclass | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> 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



^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2023-11-08  6:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-06 22:25 [gentoo-dev] [PATCH] toolchain-funcs.eclass: Add functions to get pointer size in bytes James Le Cuirot
2023-11-08  6:44 ` Sam James

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox