This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Re: Macro does not compile
- To: clive at emultek dot co dot il
- Subject: Re: Macro does not compile
- From: Mumit Khan <khan at xraylith dot wisc dot EDU>
- Date: Tue, 15 Jun 1999 00:05:55 -0500
- cc: egcs-bugs at egcs dot cygnus dot com
clive@emultek.co.il writes:
>
>
>
> The compilation results for this Macro are shown after it.
> #define DECLARE_CLASS(n) \
> class MyClass##n \
> { \
> public: \
> MyClass##n (int i); \
> ~MyClass##n (void); \
> private: \
> char *_dum; \
> };
> DECLARE_CLASS(10)
>
[ ... ]
> In file included from test.cpp:1:
> test.h:3: parse error before `#'
> test.h:3: stray '\' in program
I'd bet that the source file is in DOS format (ie., it has '\r\n' line
endings instead of '\n'), and that's what's causing the problem. To
check, do the following:
$ od -c test.cpp | less
if you see '\r' there, that's your problem. If so, use recode or some
such program (or, in vim, do a ``:set ff=unix'' and then write it out)
to get rid of the '\r' and you should be set.
Regards,
Mumit