Branding structs in Scintilla.h

10 views
Skip to first unread message

Neil Hodgson

unread,
May 20, 2009, 11:36:47 PM5/20/09
to scintilla-interest
Scintilla.h is the main header included by code that needs to call
Scintilla. It is meant to be included by both C and C++ client code
and hopefully by other languages derived from C such as Objective-C.
Currently there are several struct definitions in this file, one of
which, TextRange, is also an identifier used by system headers on OS
X. These are protected by conditionally compiled namespace
declarations but this only works for C++ so client code written in C
for OS X can't include this header. The other struct names may also be
in use on other platforms.

To avoid clashes between Scintilla.h and platform headers, I'd like
to move towards names that are much less likely to clash by appending
"Scintilla_", or "Sci_" or similar to each of these struct names.
Initially there would be forwarding macros so that the current names
could be used but eventually that would be phased out along with the
namespace declarations.

Neil

Neil Hodgson

unread,
May 26, 2009, 11:21:55 PM5/26/09
to scintilla-interest
Change committed that adds "Sci_" prefix to structs defined in
Scintilla.h along with forwarding macros.

A future version will remove the forwarding macros and the
namespace from Scintilla.h.

The new definitions are:

struct Sci_CharacterRange { ...
struct Sci_TextRange { ...
struct Sci_TextToFind { ...
#define CharacterRange Sci_CharacterRange
#define TextRange Sci_TextRange
#define TextToFind Sci_TextToFind
#ifdef PLATFORM_H
struct Sci_RangeToFormat { ...
#define RangeToFormat Sci_RangeToFormat
#endif
struct Sci_NotifyHeader { ...
#define NotifyHeader Sci_NotifyHeader

Neil

Reply all
Reply to author
Forward
0 new messages