Skip to content

Commit

Permalink
doc: Use 'literalinclude' instead of 'include' in "Think twice before…
Browse files Browse the repository at this point in the history
… using enums".
  • Loading branch information
randruc committed Oct 29, 2020
1 parent 440d672 commit 11faf99
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,16 @@ It is generally considered a good practice to define named integer constants
as enumerations (``enum``) if they are related to each other. i.e.: they can be
grouped under a common name, bringing more meaning, more "semantic intention":

.. include:: enum_declaration.c
:code: C
:start-line: 9
.. literalinclude:: enum_declaration.c
:language: c
:lines: 10-

as opposed to preprocessor's ``#define`` that cannot group a set of macro
constants under a common name:

.. include:: define_declaration.c
:code: C
:start-line: 9
.. literalinclude:: define_declaration.c
:language: c
:lines: 10-

Most of the time and for the vast majority of usual C code, this practice should
be applied.
Expand Down

0 comments on commit 11faf99

Please sign in to comment.