Preprocessing the arguments of a MACRO function ?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hello,

I would like to make a macro MY_ALLOCATE(myarray) where myarray will
be something like arr(dim1,dim2,...,dimN). The MY_ALLOCATE should be
replaced by 2 lines :
1) allocate(myarray) /* with my array being for example
arr(dim1,dim2,...,dimN) */
2) call to another function like : foo(arr) /* where arr is myarray
but without the dim1 .... */

Example :
ndim = 3;
MY_ALLOCATE(array(ndim,3,12))
would be changed to :
allocate(array(ndim,3,12))
call foo(array)


I have tried this :

#define MY_ALLOCATE(myarray(myshape)) allocate(myarray(myshape)) \
  call foo(myarray)

But it does not work :/

I do not want to have something like MY_ALLOCATE(myarray,myshape), the
argument list needs to be exactly like in the allocate call.

Any ideas ?

Thanks a lot !

David


[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux