[GRASS-dev] gmath and gpde update

Glynn Clements glynn at gclements.plus.com
Mon Jan 12 10:14:20 EST 2009


Soeren Gebbert wrote:

> > > * adding the prefix G_math_ to all extern library functions (with
> > > preprocessor directives)
> >
> > Why?
> 
> To mark the meschach code as part of the gmath library. Many functions in
> meschach are quite short
> and in this manner not self explaining. I think the grass code using
> meschach will
> be more readable if a prefix is used. A developer who is not familiar with
> meschach will identify the
> functions as part of the gmath library and will not search for local
> function definitions.
> But i wont touch any function name in the code of meschach. Instead i would
> like to include the meschach
> includes into gmath.h and redefine the meschach names with macros:

That's preferable, although it might be better to create wrapper
functions than macros, e.g.:

	int G_math_somefunc(void) { return somefunc(); }

Excessive use of macros can be a nuisance; macros don't show up in
"nm" output, or in gdb backtraces, can't have breakpoints set on them,
can't be called from gdb, etc.

-- 
Glynn Clements <glynn at gclements.plus.com>


More information about the grass-dev mailing list