[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [IMP-dev] macro names



Daniel Russel wrote:
> We aren't very consistent about macro names throughout IMP. I would  
> suggest
> IMP_CORE_BEGIN_NAMESPACE
> IMP_CORE_EXPORT
> IMP_EXPORT

On the contrary, I think the names are pretty consistent. Namespaces and
header names are mapped to uppercase, :: is mapped to '', and CamelCase
case changes are mapped to '_'. Seems that your proposal would either
add an inconsistency (namespace macro IMP_CORE_BEGIN_NAMESPACE
inconsistent with header guard IMPCORE_FOO_H) or a header guard
ambiguity (no way to distinguish Bar.h in the foo module from FooBar.h
in the kernel, since both would map to IMP_FOO_BAR_H). This is why there
is no space between 'IMP' and 'CORE' in any of the macros.

> in addition, the __ in the header guard names doesn't add anything and  
> is technically illegal in C++/C.

If you have a source for that assertion I'd be happy to remove it. It
actually appears to be quite common usage though (e.g. freetype and
glib2 both do that).

	Ben
-- 
                      http://salilab.org/~ben/
"It is a capital mistake to theorize before one has data."
	- Sir Arthur Conan Doyle