Skip to content

Commit

Permalink
perlhacktips: document our usage of C99 bool
Browse files Browse the repository at this point in the history
Since commit b1c011d we unconditionally include <stdbool.h> and
assume C99 booleans are available, so document the feature in
perlhacktips.
  • Loading branch information
mauke committed Mar 4, 2025
1 parent 8c5e6c3 commit 4ec17af
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pod/perlhacktips.pod
Original file line number Diff line number Diff line change
Expand Up @@ -128,8 +128,7 @@ everywhere. It's fine to probe for additional C99 features and use
them where available, providing there is also a fallback for compilers
that don't support the feature. For example, we use C11 thread local
storage when available, but fall back to POSIX thread specific APIs
otherwise, and we use C<char> for booleans if C<< <stdbool.h> >> isn't
available.
otherwise.

Code can use (and rely on) the following C99 features being present

Expand Down Expand Up @@ -233,6 +232,13 @@ C<//> comments
All compilers we tested support their use. Not all humans we tested
support their use.

=item *

booleans

You can use C<bool>, C<true>, and C<false> as provided by C<< <stdbool.h >>
(or natively in C++).

=back

Code explicitly should not use any other C99 features. For example
Expand Down

0 comments on commit 4ec17af

Please sign in to comment.