www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/24/10:22:02

Newsgroups: comp.os.msdos.djgpp
Date: Fri, 24 Oct 1997 16:19:04 +0200 (IST)
From: Genady Beryozkin <c0467082 AT techst02 DOT technion DOT ac DOT il>
To: Peter Palotas <blizzar AT hem1 DOT passagen DOT se>
cc: djgpp AT delorie DOT com
Subject: Re: CPP question.
In-Reply-To: <62mst2$rc0$v@195.26.68.19>
Message-ID: <Pine.GSO.3.95.971024161652.10051B-100000@techst02.technion.ac.il>
References: <62mst2$rc0$v AT 195 DOT 26 DOT 68 DOT 19>
MIME-Version: 1.0

On 23 Oct 1997, Peter Palotas wrote:

> Is there some way to make CPP (the macro preprocessor) not include files
> from included files? i.e. if there's a line #include "file1.h" in the file
> being preprocessed and file1.h contains a line #include "file2.h", I want
> the output file only to include file1.h and keeping the '#include
> "file2.h"' line.
> 
> I need this, because I want to automatically create a headerfile from
> several others, but I don't want to include the files that they include.
> Maybe there is a better way (I'm sure there is) to do this, than using CPP,
> but I couldn't think of any.
> 
> 
> -- Peter Palotas alias Blizzar -- blizzar AT hem1 DOT passagen DOT se --
> 
> *****************************************************
> * A brief description of DJGPP:                     *
> * NEVER BEFORE HAS SO FEW DONE SO MUCH FOR SO MANY! *
> *****************************************************
> 
> 
> 

I'd 
#define include_files 
(on the cpp command line) and inside the files
put something like 

#ifndef include_files
#include <file1.h>
#include "file2.h"
#endif

Genady

*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*
| Genady Beryozkin,  c0467082 AT t2 DOT technion DOT ac DOT il |
* -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=- *
| Homepage : http://t2.technion.ac.il/~c0467082 |
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

Fair is foul, and foul is fair.
Hover through the fog and filthy air.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019