Mail Archives: djgpp/2000/05/24/13:00:19
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 -