[Libclc-dev] [PATCH 1/1] Add intptr types
Tom Stellard
tom at stellard.net
Thu Jun 12 14:23:45 PDT 2014
On Thu, Jun 12, 2014 at 11:26:56AM -0400, Jan Vesely wrote:
> Based on clang's stdint.h
>
> Signed-off-by: Jan Vesely <jan.vesely at rutgers.edu>
LGTM.
Do you have commit access?
-Tom
> ---
>
> Fixes scalar-data-types piglit.
> The __intn_t macros should be reusable if intXY_t types are added later[0]
>
> regards,
> Jan
>
> [0] https://blog.ajguillon.com/2013/09/16/opencl-1-3-my-proposal-for-a-final-1-x-release/
>
> generic/include/clc/clctypes.h | 12 ++++++++++++
> 1 file changed, 12 insertions(+)
>
> diff --git a/generic/include/clc/clctypes.h b/generic/include/clc/clctypes.h
> index ca729f7..ca1372d 100644
> --- a/generic/include/clc/clctypes.h
> +++ b/generic/include/clc/clctypes.h
> @@ -7,6 +7,18 @@ typedef unsigned short ushort;
> typedef unsigned int uint;
> typedef unsigned long ulong;
>
> +#define __stdint_join3(a,b,c) a ## b ## c
> +
> +#define __intn_t(n) __stdint_join3(__INT, n, _TYPE__)
> +#define __uintn_t(n) __stdint_join3(unsigned __INT, n, _TYPE__)
> +
> +typedef __intn_t(__INTPTR_WIDTH__) intptr_t;
> +typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t;
> +
> +#undef __uintn_t
> +#undef __intn_t
> +#undef __stdint_join3
> +
> /* 6.1.2 Built-in Vector Data Types */
>
> typedef __attribute__((ext_vector_type(2))) char char2;
> --
> 1.9.3
>
>
> _______________________________________________
> Libclc-dev mailing list
> Libclc-dev at pcc.me.uk
> http://www.pcc.me.uk/cgi-bin/mailman/listinfo/libclc-dev
More information about the Libclc-dev
mailing list