Complete.Org: Mailing Lists: Archives: freeciv-dev: August 2001:
[Freeciv-Dev] Re: Map coordinate cleanups.
Home

[Freeciv-Dev] Re: Map coordinate cleanups.

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: rf13@xxxxxxxxxxxxxxxxxxxxxx
Cc: Marco Colombo <marco@xxxxxx>, Andreas Kemnade <akemnade@xxxxxxxxxxx>, Gaute B Strokkenes <gs234@xxxxxxxxx>, freeciv-dev@xxxxxxxxxxx
Subject: [Freeciv-Dev] Re: Map coordinate cleanups.
From: Kevin Brown <kevin@xxxxxxxxxxxxxx>
Date: Thu, 16 Aug 2001 10:30:57 -0700

Raimar Falke <hawk@xxxxxxxxxxxxxxxxxxxxxxx> wrote:
> > So, the rule is: in C source, call the same functions with the same names,
> > and use different names for different functions (and, slightly different
> > names for slightly different functions, like my_* variants). How the
> > `ffs' function name will lead to the actual implementation it's a
> > linker job, and the C compiler (and the C source human reader) should
> > not be concerned (well, not while compiling/reading the module that uses 
> > that
> > function).
> > I call that abstraction, too.
> 
> Also if names are prefixed with "my_" you get an extra layer where you
> can put code. Like the check for no memory in the malloc() case.

Yep.  Basically, if what you want has different semantics (an extra
check for out of memory conditions, for instance) than the base thing,
then call it my_whatever().

If it has the same semantics as some other function that exists on at
least some systems, then let configure check for its existence on the
system and put your own version somewhere in the source that will be
used if configure fails to find it on the system.  Configure can also
be used to check for the expected semantics, and fall back to using
the Freeciv-supplied version if the semantics of the system function
are different than expected.



-- 
Kevin Brown                                           kevin@xxxxxxxxxxxxxx

    It's really hard to define what "unexpected behavior" means when you're
                       talking about Windows.


[Prev in Thread] Current Thread [Next in Thread]