delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/01/16:00:35

Message-ID: <3E3C107F.19937AB1@yahoo.com>
Date: Sat, 01 Feb 2003 13:22:55 -0500
From: CBFalconer <cbfalconer AT yahoo DOT com>
Organization: Ched Research
X-Mailer: Mozilla 4.75 [en] (Win98; U)
X-Accept-Language: en
MIME-Version: 1.0
To: djgpp-workers AT delorie DOT com
Subject: Re: restrict
References: <200302011404 DOT h11E4rb15460 AT speedy DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com

ams AT ludd DOT luth DOT se wrote:
> 
> We have a problem. gcc only recognise "restrict" if "-std=c99"
> is given on the command line.
> 
> So we'll need some macro or some way knowing when c99 is in
> effect. Alas I can't find one. I've been looking at the verbose
> output from gcc.

Can't the system headers do something like (reworked into #ifs
etc)

  if not c99 then begin
     if defined restrict then set oldrestrict=restrict
     else set oldrestrict undefined
     undefine restrict
     define restrict
  endif

  ....

  if not c99 then begin
     undefine restrict
     if oldrestrict != undefined then set restrict oldrestrict
     undefine oldrestrict
  endif

where oldrestrict and undefined are in the implementation name
space.

-- 
Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net)
   Available for consulting/temporary embedded and systems.
   <http://cbfalconer.home.att.net>  USE worldnet address!


- Raw text -


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