collation.h currently looks as follows:
The above headers cause conflicts with MCS and boost headers.
Note, the header m_ctype.h itself does not need most of <mariadb.h> and <my_sys.h>.
It only needs the following declarations:
Let's do the following:
- Remove the dependency on <myisampack.h> from collation.h. It's needed only in func_char.cpp.
- Remove the redundant dependencies on <mariadb.h> and <my_sys.h> from collation.h.
- Add the above mentioned typedefs into collation.h before including <m_ctype.h>
- Introduce a new class in collation.h
- Implement this constructor:
inside a *.cpp file, so only this cpp file needs to include <my_sys.h> for the prototype of get_charset().
As a result, collation.h will be an non-conflicting file, so we can freely include it from various other headers, e.g. from calpontsystemcatalog.h, without any conflicts.
Later we'll add more methods into the new class Charset, e.g. convenience wrappers to handle std::string etc.