Please change name of print macros

[Old posts from the commercial version of ArrayFire] Discussion of ArrayFire using CUDA or OpenCL.

Moderator: pavanky

Please change name of print macros

Postby rm9 » Thu May 29, 2014 4:28 am

Hi,

In the utils.h file, you define a print macro.
The problem is that this macro collides with other print methods.
for example if I have a class with a print method like this "obj.print" then the compiler tries to replace it with your macro.
Please change the name of the macros to af_print or something like that.
Thanks.
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am

Re: Please change name of print macros

Postby shehzan » Thu May 29, 2014 9:54 am

Hi

This was a conscious decision we took. We also took into account such a scenario and that's why utils.h does not get included with the other header files.
We may consider changing this in the future, but as of now, there is no such plan.

Here is the best solution. Make the following change
Code: Select all
// Existing code
#define print(exp)  _print(#exp, exp)

// Change to
#define af_print(exp)  _print(#exp, exp)

This should be good enough to resolve the conflict locally. You will not need to rebuild the library or make any other changes.
----
Shehzan
Developer
AccelerEyes
User avatar
shehzan
 
Posts: 121
Joined: Tue Feb 12, 2013 7:20 pm

Re: Please change name of print macros

Postby rm9 » Thu May 29, 2014 10:26 am

shehzan wrote:Hi

This was a conscious decision we took. We also took into account such a scenario and that's why utils.h does not get included with the other header files.
We may consider changing this in the future, but as of now, there is no such plan.

Here is the best solution. Make the following change
Code: Select all
// Existing code
#define print(exp)  _print(#exp, exp)

// Change to
#define af_print(exp)  _print(#exp, exp)

This should be good enough to resolve the conflict locally. You will not need to rebuild the library or make any other changes.


Yes, that's what I did eventually.. but it might be frustrating to other users, because print and printdims are very useful, so I always include them.
rm9
 
Posts: 54
Joined: Thu Jan 30, 2014 5:44 am


Return to [archive-commercial] Programming & Development with ArrayFire

cron