This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [gomp4 12/14] libgomp: fixup error.c on nvptx
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Alexander Monakov <amonakov at ispras dot ru>
- Cc: gcc-patches at gcc dot gnu dot org, Dmitry Melnik <dm at ispras dot ru>
- Date: Wed, 21 Oct 2015 12:00:05 +0200
- Subject: Re: [gomp4 12/14] libgomp: fixup error.c on nvptx
- Authentication-results: sourceware.org; auth=none
- References: <1445366076-16082-1-git-send-email-amonakov at ispras dot ru> <1445366076-16082-13-git-send-email-amonakov at ispras dot ru>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Tue, Oct 20, 2015 at 09:34:34PM +0300, Alexander Monakov wrote:
> NVPTX provides vprintf, but there's no stream separation: everything is
> printed as if into stdout. This is the minimal change to get error.c working.
>
> * error.c [__nvptx__]: Replace vfprintf, fputs, fputc with [v]printf.
I'd guess it would be cleaner to have this in config/nvptx/error.c.
Have there all the includes copies from error.c, then
#undef the 3, redefine them and finally #include the toplevel error.c.
> ---
> libgomp/error.c | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/libgomp/error.c b/libgomp/error.c
> index 094c24a..009efdc 100644
> --- a/libgomp/error.c
> +++ b/libgomp/error.c
> @@ -35,6 +35,11 @@
> #include <stdio.h>
> #include <stdlib.h>
>
> +#ifdef __nvptx__
> +#define vfprintf(stream, fmt, list) vprintf(fmt, list)
> +#define fputs(s, stream) printf("%s", s)
> +#define fputc(c, stream) printf("%c", c)
> +#endif
>
> #undef gomp_vdebug
> void
Jakub