Making the Scintilla namespace unconditional

24 views
Skip to first unread message

Neil Hodgson

unread,
Jun 16, 2017, 10:49:56 PM6/16/17
to Scintilla mailing list
When the Scintilla namespace was introduced, some downstream projects could not allow it to be used since they supported old compilers which did not understand namespaces. Such compilers and project requirements are long gone, so it would be possible to use the Scintilla namespace unconditionally. Since the Scintilla namespace is no longer exposed to clients, this will not affect them.

This will simplify code, remove a source of build failures, and produce simpler warnings. Mostly, this looks like simply replacing #ifdef SCI_NAMESPACE * #endif with *, so

#ifdef SCI_NAMESPACE
namespace Scintilla {
#endif

becomes

namespace Scintilla {

Neil

Mike Lischke

unread,
Jun 17, 2017, 5:35:17 AM6/17/17
to scintilla...@googlegroups.com
> When the Scintilla namespace was introduced, some downstream projects could not allow it to be used since they supported old compilers which did not understand namespaces. Such compilers and project requirements are long gone, so it would be possible to use the Scintilla namespace unconditionally. Since the Scintilla namespace is no longer exposed to clients, this will not affect them.



I'm a bit confused. Didn't we have a discussion not so long ago about removing the namespace altogether? Or do I remember that wrongly?

Mike
--
www.soft-gems.net

Neil Hodgson

unread,
Jun 17, 2017, 6:56:00 PM6/17/17
to scintilla...@googlegroups.com
Mike Lischke:

> I'm a bit confused. Didn't we have a discussion not so long ago about removing the namespace altogether? Or do I remember that wrongly?

The namespace was removed from the client interface to Scintilla, which is defined as a ‘C’ language interface. That change did not affect internal use of the Scintilla namespace.

While the Scintilla namespace is internal, Scintilla could be seen as having 3 interfaces: client, platform layer, and lexer. The original purpose of the namespace was to help with the platform layer interface but it is also used by the lexer interface and was available in the past for the client interface.

Future work could modularize Scintilla better, perhaps by splitting off lexers and platform layers into separate projects with better defined interfaces. The platform layer interface is currently very wide with many changes to core requiring changes to each platform layer. Separate namespaces (perhaps nested as Scintilla::Lexer, Scintilla::Platform, and Scintilla::Core or using a different naming scheme) could be used to clearly mark these module boundaries.

Neil

Reply all
Reply to author
Forward
0 new messages