[GRASS-dev] __BEGIN_DECLS
Glynn Clements
glynn at gclements.plus.com
Thu Apr 19 11:50:55 EDT 2007
John Gillette wrote:
> In lib/vector/dglib/graph.h there is __BEGIN_DECLS (near top) and
> __END_DECLS (at bottom).
>
> Are these needed?
No.
> What do they do?
They are defined like so in type.h:
#ifdef __cplusplus
# define __BEGIN_DECLS extern "C" {
# define __END_DECLS }
#else
# define __BEGIN_DECLS /* empty */
# define __END_DECLS /* empty */
#endif
Essentially, they allow the header to be used in C++ code. As the
rest of GRASS doesn't do this, there doesn't seem much point doing it
in a few specific headers.
--
Glynn Clements <glynn at gclements.plus.com>
More information about the grass-dev
mailing list