TIP: Click on subject to list as thread! ANSI
echo: fidosoft.husky
to: smapi hackers
from: Gerrit Kuehn
date: 2003-01-19 20:50:30
subject: strupr in compiler.h

Hello folks!

Can someone strike me a light how to make use and sense of this definition
in compiler.h?

   ----- compiler.h begins -----

#if !defined(HAS_strupr)
char *strupr(char *str);
#endif

   ----- compiler.h ends -----

I have problems with source coming with its own implementation of strupr
and including smapi/compiler.h. Compiling under UNIX HAS_strupr is not set,
but this define defines strupr anyway. So the compiler complains when t
comes to the strupr function of the actual source, because it has been
defined before.

Adding a #define HAS_strupr into the above statement in compiler.h (was
this actually intendet but forgotten?) doesn't solve the problem, either: I
can prevent the source's own strupr function to compile then by testing
HAS_strupr, but then I have to supply an external strupr function. I can do
so by adding includes for smapi/strextra.h and installing this header
additionally. However, I get several functions more then, that also collide
with functions in the source I want to compile.
Would it be ok to add the (rather short) code for strupr into the statement
above in compiler.h?

I know I can rename the function strupr in the source to something
different, so that it won't collide with strupr in smapi anymore. But I
think it's not a very good style to implement the same function at
different places. So actually I would like to use strupr from smapi, but I
don't see a clean way to do so.

Any hints?


Regards,
Gerrit

--- Msged/BSD 6.0.0
* Origin: Shock to the System (2:246/4020)
SEEN-BY: 633/267 270
@PATH: 246/4020 2411/413 2432/200 2476/418 140/1 106/2000 1 379/1 633/267

SOURCE: echomail via fidonet.ozzmosis.com

Email questions or comments to sysop@ipingthereforeiam.com
All parts of this website painstakingly hand-crafted in the U.S.A.!
IPTIA BBS/MUD/Terminal/Game Server List, © 2025 IPTIA Consulting™.