A
andreyvul
What I'm trying to do is have the preprocessor parse one file twice.
The file has three parts, and each is dependent on the previous.
Example (file name is foo.c):
#ifndef ONCE /* first part */
#define D #define
#define ONCE
#include "foo.c"
#endif
#ifdef ONCE /* second part */
D x int
#ifndef TWICE
#define TWICE
#include "foo.c"
#endif
#endif
#ifdef TWICE /* third part */
x y;
#endif
The problem is that the preprocessor just adds the third part to the
second part, but doesn't preprocess the third part in the process.
How do I make my #includes and #ifedefs so that the third part will be
preprocessed?
The file has three parts, and each is dependent on the previous.
Example (file name is foo.c):
#ifndef ONCE /* first part */
#define D #define
#define ONCE
#include "foo.c"
#endif
#ifdef ONCE /* second part */
D x int
#ifndef TWICE
#define TWICE
#include "foo.c"
#endif
#endif
#ifdef TWICE /* third part */
x y;
#endif
The problem is that the preprocessor just adds the third part to the
second part, but doesn't preprocess the third part in the process.
How do I make my #includes and #ifedefs so that the third part will be
preprocessed?