Date: Thu, 25 Mar 1999 10:02:05 +0100 (MET) From: Wojciech Piechowski To: djgpp AT delorie DOT com Subject: Re: Preprocessor hates sizeof In-Reply-To: <003a01be7635$9d68fc00$b15d44ce@computer> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Reply-To: djgpp AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk On Wed, 24 Mar 1999, Sean Middleditch wrote: > What exactly is the purpose of this? It looks to me like you're trying to > check if the compile is 32-bit (and thus a 32-bit long int would be the same > as the standard 32-bit int). Instead, you should check for the definition > of __DJGPP__, if that's what you're aiming to do. > > > >I wonder why the following line does not compile and how to make it work: > > > >#if sizeof(long int)==sizeof(int) I need something like that in a portable program to check if the structure is not larger than a single allocation unit. The exact code is this: #if (sizeof(Box) > BOXGRAIN) #error Size of Box header cannot exceed size of grain. #endif Now I know that GCC does and will not support this, so how can I replace it? --------------------\ Wojciech Piechowski /---------------------------- Student informatyki \ voyt AT ds2 DOT pg DOT gda DOT pl / Student of computer science Politechnika Gdanska \____________________/ Gdansk Technical University