I was actually responding to Ondra`s suggestion. Thanks Erik, it does
work.
Victor Bazarov wrote:
> Erik Wikström wrote:
> > On 2007-01-08 22:31, Karim wrote:
> >> Hi,
> >>
> >> I have alot of constants that I need in regular char and in wchar_t
> >> form
> >>
> >> so instead of writing
> >>
> >> #define const1 "value1"
> >> #define const1wide L"value1"
> >>
> >> I want to make some other macro that would save time from duplicate
> >> definitions.
> >>
> >> so I was thinking of
> >>
> >> #define const1 "value1"
> >>
> >> and another macro
> >> #define WIDE(str) (##L str)
> >
> > I have not tested this but I found it in an example in the MSDN-
> > documentation and it seems to be what you are looking for:
> >
> > #define WIDEN2(x) L ## x
> > #define WIDEN(x) WIDEN2(x)
> >
> > and the usage would be
> >
> > #define const1 "value"
> > WIDEN(value)
> >
> > Don't ask me how it works, I think I know but as I said, I have not
> > tested it.
>
> Too bad. I think the OP asked for something like this:
>
> #define const1 "value"
> #define const1wide WIDEN(const1)
>
> V
> --
> Please remove capital 'A's when replying by e-mail
> I do not respond to top-posted replies, please don't ask
|