Skip to content

Commit

Permalink
Define _POSIX_VERSION correctly when older POSIX versions are selected.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ulrich Drepper committed Aug 23, 2009
1 parent 003c989 commit c6b6723
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2009-08-23 Ulrich Drepper <drepper@redhat.com>

* posix/unistd.h: Define _POSIX_VERSION correctly if older POSIX
versions are selected.

* stdio-common/printf_fp.c: ISO C expects to print the sign of NaN
as well.
* stdio-common/printf_fphex.c: Likewise.
Expand Down
16 changes: 15 additions & 1 deletion posix/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,22 @@ __BEGIN_DECLS
/* These may be used to determine what facilities are present at compile time.
Their values can be obtained at run time from `sysconf'. */

#ifdef __USE_XOPEN2K8
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 2008. */
#define _POSIX_VERSION 200809L
# define _POSIX_VERSION 200809L
#elif defined __USE_XOPEN2K
/* POSIX Standard approved as ISO/IEC 9945-1 as of December 2001. */
# define _POSIX_VERSION 200112L
#elif defined __USE_POSIX199506
/* POSIX Standard approved as ISO/IEC 9945-1 as of June 1995. */
# define _POSIX_VERSION 199506L
#elif defined __USE_POSIX199309
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1993. */
# define _POSIX_VERSION 199309L
#else
/* POSIX Standard approved as ISO/IEC 9945-1 as of September 1990. */
# define _POSIX_VERSION 199009L
#endif

/* These are not #ifdef __USE_POSIX2 because they are
in the theoretically application-owned namespace. */
Expand Down

0 comments on commit c6b6723

Please sign in to comment.