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