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

autoconf: #define foo(b) b ## bar: space between foo&(b)



If I put in my configure.in:

AC_DEFINE_UNQUOTED(foo(a), bar a)

then in the created config.h (or on the gcc commandline) I get:

#define foo (a) bar a
           ^space

This doesn't work, I need to have:
#define foo(a) bar a

At the moment I `solve' this by doing:
  
  sed -e 's/ *(/(/' < config.h > sed-config.h

at the end of the configure.in file. But I'm sure there is a better
way to solve this?

------------

If there isn't, maybe another way out would be to get rid of
the macro arguments altogether. But then I got the following
problem:

I want to define

#define WRAP_STAT  __xstat
#define NEXT_STAT(a,b,c) next___xstat(a,b,c)

To get rid of the macro arguments, I just defining WRAP_STAT by
configure, and then in some .h file defining NEXT_STAT in terms of
WRAP_STAT:

#define NEXT_STAT(a,b,c) next_ ## WRAP_STAT(a,b,c)

(with the ## to remove the space between next_ and __xstat). But
apparently cpp takes everything after the ## litaraly, and doens't
expand the macros any more, so that NEXT_STAT(1,2,3) now expands
to `next_WRAP_STAT( 1 , 2 , 3 )'.
So, does anyone know of a way to get rid of the space in between
next_ / WRAP_STAT(a,b,c)?


ii  autoconf        2.13-7         automatic configure script builder
ii  automake        1.4-2          A tool for generating GNU Standards-complian
ii  gcc             2.91.66-2      The GNU (EGCS) C compiler.
ii  cpp             2.91.66-2      The GNU (EGCS) C preprocessor.


(BTW, please also reply to me personally, as I'm not subscribed to
this list).
-- 
joostje


Reply to: