This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Strange gcc-3.0.1 preprocessor


Nick Kurshev wrote:-

> It was only way to build such trick. Else how you will notice
> compiler to build preprocessor string without space characters?

Like I told you.

> Well, the same code with space characters around __MACHINE__:
> source:
>     #define _INLINES <biewlib/sysdep/ __MACHINE__ /_inlines.h>
>     #define __CONFIG <biewlib/sysdep/ __MACHINE__ /__config.h>
>     #include __CONFIG
>     #include _INLINES

Why have you added spaces?  Of course it will now break:

> output:
> biewlib/sysdep/_sys_dep.h:30:22: biewlib/sysdep/ ia32 /__config.h: No such file or directory
> biewlib/sysdep/_sys_dep.h:31:22: biewlib/sysdep/ ia32 /_inlines.h: No such file or directory

The following works for me:

#define STDIO stdio
#define STDIO_H </usr/include/STDIO.h>
#include STDIO_H

Note that the preprocessor does not do string literal concatenation in
header names.

Neil.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]