delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2000/05/24/13:00:19

From: buers AT gmx DOT de (Dieter Buerssner)
Newsgroups: comp.os.msdos.djgpp
Subject: Re: WANTED: strrev() where is it???
Date: 24 May 2000 16:53:30 GMT
Lines: 35
Message-ID: <8gh8p6.3vs4d07.0@buerssner-17104.user.cis.dfn.de>
References: <8gfcsp$due$1 AT nnrp1 DOT deja DOT com> <392BC891 DOT B8A0D8 AT ma DOT tum DOT de> <8ggt3h DOT 3vs4d07 DOT 0 AT buerssner-17104 DOT user DOT cis DOT dfn DOT de> <392BE262 DOT ADE5C3DD AT ma DOT tum DOT de> <8ggpoa$q5s$1 AT nets3 DOT rz DOT RWTH-Aachen DOT DE>
NNTP-Posting-Host: pec-117-38.tnt8.s2.uunet.de (149.225.117.38)
Mime-Version: 1.0
X-Trace: fu-berlin.de 959187210 1410905 149.225.117.38 (16 [17104])
X-Posting-Agent: Hamster/1.3.13.0
User-Agent: Xnews/03.02.04
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

Hans-Bernhard Broeker wrote:

>Waldemar Schultz <schultz AT ma DOT tum DOT de> wrote:
>> Dieter Buerssner schrieb:
>>> >RadSurfer schrieb:
>>> >> Do I have to resort to a routine to emulate  strrev()  ?
>>> 
>>> To be portable, yes. You should then also give it a different
>>> name, because all names starting with str and followed by a
>>> lower case letter, are reserved.
>
>> is there also anything against
>
>> char *StrRev(char *);
>> #define strrev(s) StrRev(s)
>
>Close, but no doughnut, yet. DJGPP's usual method for this case would be
>
>  char * __dj_strrev(char *);
>
>and in the right section of <string.h> (outside the 'strict ANSI'
>section, for sure), put
>
>  #define strrev(s) __dj_strrev(char *);
>
>The difference is that a program is allowed to defined its own
>StrRev() function, which would break your setup. 

While I agree, that your proposed method is better, because it
clutters the namespace less, I cannot see, how Waldemar's method would 
break a conforming program. The prototype and the #define would be outside 
of strict ansi sections of the header. 

-- 
Regards, Dieter Buerssner

- Raw text -


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