This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: RES: It's possible to use folder/file path for #define (like is possible to use folder/file path into #indude statement) ? If yes, why ?
- From: John Love-Jensen <eljay at adobe dot com>
- To: Luiz Eduardo Gualti <luiz dot gualti at am dot unisal dot br>
- Cc: MSX to GCC <gcc-help at gcc dot gnu dot org>
- Date: Mon, 13 Mar 2006 12:48:09 -0600
- Subject: Re: RES: It's possible to use folder/file path for #define (like is possible to use folder/file path into #indude statement) ? If yes, why ?
Hi Luiz,
> #define FOO "my/dir/bar.txt" , means "replace FOO" for text
> "my/dir/bar.txt" or for bar.txt content ?
It means replace the identifier token FOO with the text (including the
quotes) "my/dir/bar.txt".
To insert the contents of "my/dir/bar.txt" into your source code, use:
#include "my/dir/bar.txt"
If FOO is defined as "my/dir/bar.txt", this will also work:
#include FOO
...but doing so is unusual, and not generally recommended.
Note: these are not GCC particular questions, they are C/C++ questions
(well, really, the C preprocessor itself) that should be asked on a more
appropriate forum.
Sincerely,
--Eljay