Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

Suggested Code::Blocks rules on using Headers.

(1/1)

stahta01:
FYI:

I have been thinking that it would be a good idea to have a list of rules on using headers in Code::Blocks.
I have figured out some possible rules from killerbot and thinking about it myself.

Please comment about these rules and suggest others.

Tim S

killerbot inspired ones.
1. If possible, headers should use forward declarations instead of includes.

2. Headers should never include pre-compiled headers like [sdk.h] or [wxprec.h].
    Do not include sdk.h in headers
    Do not include wxprec.h in headers
    Do not use WX_PRECOMP in headers
    Do not use CB_PRECOMP in headers

Ones I decided on by myself.
3. Used system includes in plugins for C::B SDK and wxWidgets includes.
   In plugins, use [#include <sdk.h>] instead of [#include "sdk.h"]

4. Do not use [#include <wx/wx.h>] in either production headers or source code.

Navigation

[0] Message Index

Go to full version