Skip to content

Commit 5ed7258

Browse files
committed
Map fprintf(stderr to printf if OPENACC (restores compilation of ESS_BEER)
1 parent e597470 commit 5ed7258

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

common/lib/share/interoff-lib.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,10 @@
3838
#ifndef INTEROFF_LIB_C
3939
#define INTEROFF_LIB_C "$Revision$"
4040

41+
#ifdef OPENACC // If on GPU map fprintf to printf
42+
#define fprintf(stderr,...) printf(__VA_ARGS__)
43+
#endif
44+
4145
#pragma acc routine
4246
double off_F(double x, double y,double z,double A,double B,double C,double D) {
4347
return ( A*x + B*y + C*z + D );
@@ -370,9 +374,7 @@ int off_clip_3D_mod(intersection* t, Coords a, Coords b,
370374
#ifdef OFF_LEGACY
371375
if (t_size>OFF_INTERSECT_MAX)
372376
{
373-
#ifndef OPENACC
374377
fprintf(stderr, "Warning: number of intersection exceeded (%d) (interoff-lib/off_clip_3D_mod)\n", OFF_INTERSECT_MAX);
375-
#endif
376378
return (t_size);
377379
}
378380
#endif
@@ -454,9 +456,7 @@ int off_clip_3D_mod_grav(intersection* t, Coords pos, Coords vel, Coords acc,
454456

455457
if (t_size>CHAR_BUF_LENGTH)
456458
{
457-
#ifndef OPENACC
458459
fprintf(stderr, "Warning: number of intersection exceeded (%d) (interoff-lib/off_clip_3D_mod)\n", CHAR_BUF_LENGTH);
459-
#endif
460460
return (t_size);
461461
}
462462
//both planes intersect the polygon, let's find the intersection point

0 commit comments

Comments
 (0)