delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp-workers/2003/02/01/21:11:54

Message-ID: <3E3C4558.1C066B65@yahoo.com>
Date: Sat, 01 Feb 2003 17:08:24 -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: <200302012145 DOT h11LjuX20298 AT speedy DOT ludd DOT luth DOT se>
Reply-To: djgpp-workers AT delorie DOT com

ams AT ludd DOT luth DOT se wrote:
> According to CBFalconer:
> > 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.
> 
> I don't understand what you mean. (Perhaps you don't understand
> what I mean?)
> 
> Tell us the macro (or something) to use to detect that "-std=c99"
> was given.

How about:

  #if defined(__STDC__) && (__STDC_VERSION__ >= 199901L)

-- 
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