diff options
| author | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-02-08 13:03:17 +0100 |
|---|---|---|
| committer | Michael Kerrisk <mtk.manpages@gmail.com> | 2016-03-01 20:01:03 +0100 |
| commit | f125c76932e00adcde009741fa2e1770775832cc (patch) | |
| tree | 0077faa7c87eb04698a101dab27b8684bf28f81d | |
| parent | b0da7b8b76a0ba459967f1e8d29eb7051efdc937 (diff) | |
| download | man-pages-f125c76932e00adcde009741fa2e1770775832cc.tar.gz | |
feature_test_macros.7: Add a summary of some FTM key points
Signed-off-by: Michael Kerrisk <mtk.manpages@gmail.com>
| -rw-r--r-- | man7/feature_test_macros.7 | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/man7/feature_test_macros.7 b/man7/feature_test_macros.7 index 09902f821e..7c0000a4fc 100644 --- a/man7/feature_test_macros.7 +++ b/man7/feature_test_macros.7 @@ -122,10 +122,70 @@ This format is employed in cases where only a single feature test macro can be used to expose the function declaration, and that macro is not defined by default. .SS Feature test macros understood by glibc -The following paragraphs explain how feature test macros are handled +The paragraphs below explain how feature test macros are handled in Linux glibc 2.\fIx\fP, .I x > 0. + +First, though a summary of a few details for the impatient: +.IP * 3 +The macros that you most likely need to use in modern source code are +.BR _POSIX_C_SOURCE +(for definitions from various versions of POSIX.1), +.BR _XOPEN_SOURCE +(fof definitions from various versions of SUS), +.BR _GNU_SOURCE +(for GNU and/or Linux specific stuff), and +.BR _DEFAULT_SOURCE +(to get definitions that would normally be provided by default). +.IP * +Defining +.BR _XOPEN_SOURCE +with a value of 600 or greater produces the same effects as defining +.BR _POSIX_C_SOURCE +with a value of 200112L or greater. +Where one sees +.RS +.nf + + _POSIX_C_SOURCE >= 200112L + +.fi +.RE +.IP +in the feature test macro requirements in the SYNOPSIS of a man page, +it is implicit that the following has the same effect: +.RS +.nf + + _XOPEN_SOURCE >= 600 + +.fi +.RE +.IP * +Defining +.BR _XOPEN_SOURCE +with a value of 700 or greater produces the same effects as defining +.BR _POSIX_C_SOURCE +with a value of 200809L or greater. +Where one sees +.RS +.nf + + _POSIX_C_SOURCE >= 200809L + +.fi +.RE +.IP +in the feature test macro requirements in the SYNOPSIS of a man page, +it is implicit that the following has the same effect: +.RS +.nf + + _XOPEN_SOURCE >= 700 + +.fi +.RE .\" The details in glibc 2.0 are simpler, but combining a .\" a description of them with the details in later glibc versions .\" would make for a complicated description. |
