C++ style guide: Difference between revisions

222 bytes added ,  17 August 2016
Line 68: Line 68:
=== Order of Includes ===
=== Order of Includes ===


Use the following order with an empty line between each section:
In source files (not headers files), use the following order with an empty line between each section:


# config.h
# config.h
Line 91: Line 91:
* liboctave '''must not''' use any headers or symbols from libinterp or libgui.  It must be fully functional without the interpreter or GUI.
* liboctave '''must not''' use any headers or symbols from libinterp or libgui.  It must be fully functional without the interpreter or GUI.
* libinterp '''must not''' use any headers or symbols from libgui.  It must be fully functional without the GUI.
* libinterp '''must not''' use any headers or symbols from libgui.  It must be fully functional without the GUI.
As much as possible, header files should be independent of other header files.
Header files '''must not''' include config.h.  Instead, they should begin by including octave-config.h.


Header files should not use any "#if defined (HAVE_FEATURE)" conditionals.  This is not quite true yet, but we are almost there.  '''No new conditionals may be added.'''
Header files should not use any "#if defined (HAVE_FEATURE)" conditionals.  This is not quite true yet, but we are almost there.  '''No new conditionals may be added.'''