Harlan Stenn <[EMAIL PROTECTED]> writes: |> I'm looking for a way to define unsigned-long constants. I have to support |> K&R and Ansi C compilers. |> |> I have been using: |> |> acconfig.h: |> #undef ULONG_CONST |> |> acinclude.m4: |> AC_DEFUN(hs_ULONG_CONST, |> [ AC_EGREP_CPP(Circus, |> [#define ACAT(a,b)a ## b |> ACAT(Cir,cus) |> ], AC_DEFINE([ULONG_CONST(a)], [a ## UL]), |> AC_EGREP_CPP(Reiser, |> [#define RCAT(a,b)a/**/b |> RCAT(Rei,ser) |> ], AC_DEFINE([ULONG_CONST(a)], [a/**/L]), |> AC_MSG_ERROR([How do we create an unsigned long constant?])))]) |> |> and I'm trying to lose the entry in acconfig.h and use the "template" form |> of AC_DEFINE. |> |> The bad news is that I apparently haven't gotten the quoting right. |> |> If I just add the template to AC_DEFINE(ULONG_CONST...) autosomething goes |> insane becuase it's under-quoted. |> |> If I add [] around the AC_DEFINE(ULONG_CONST...) bit then auto* is happy but |> the resulting entry in config.h.in is Wrong. |> |> Anybody have something I can swipe, or ideas on what I'm doing wrong?
Have you tried using the @%:@ quadrigraph? Also, you should put [] around every macro argument, especially if it contains nested macro invocations. AC_DEFUN(hs_ULONG_CONST, [ AC_EGREP_CPP(Circus, [#define ACAT(a,b)a ## b ACAT(Cir,cus) ], [AC_DEFINE([ULONG_CONST(a)], [a @%:@@%:@ UL], [...])], [AC_EGREP_CPP(Reiser, [#define RCAT(a,b)a/**/b RCAT(Rei,ser) ], [AC_DEFINE([ULONG_CONST(a)], [a/**/L], [...])], [AC_MSG_ERROR([How do we create an unsigned long constant?])])])]) Andreas. -- Andreas Schwab, SuSE Labs, [EMAIL PROTECTED] SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 N�rnberg Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."
