Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYaakov Selkowitz <yselkowi@redhat.com>2016-05-21 00:55:50 +0300
committerYaakov Selkowitz <yselkowi@redhat.com>2016-05-23 19:20:29 +0300
commit95644157c14fa0b43debe9e9cdef03a10a2d802d (patch)
treeb114f8a78bfcd99f3a3842b070beec3a68566cc2 /newlib/libc/include/stdio.h
parent4e434bf223c301cd2690a3fe1cde2a84c0d5b624 (diff)
Feature test macros: ctermid, cuserid
The proper location for these functions has always been <stdio.h>, however XPG4 and SUSv2 did mandate a duplicate declaration in <unistd.h>. cuserid was dropped in SUSv3 (it was marked legacy since XPG4) and the ctermid declaration in <unistd.h> was made optional and obsolete in SUSv4. Fixes: https://cygwin.com/ml/cygwin/2016-05/msg00002.html Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
Diffstat (limited to 'newlib/libc/include/stdio.h')
-rw-r--r--newlib/libc/include/stdio.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/newlib/libc/include/stdio.h b/newlib/libc/include/stdio.h
index 9ab5d327b..866d8167d 100644
--- a/newlib/libc/include/stdio.h
+++ b/newlib/libc/include/stdio.h
@@ -164,6 +164,12 @@ typedef _fpos64_t fpos64_t;
#endif
#endif
+#if __POSIX_VISIBLE
+char * _EXFUN(ctermid, (char *));
+#endif
+#if __XSI_VISIBLE && __XSI_VISIBLE < 600
+char * _EXFUN(cuserid, (char *));
+#endif
FILE * _EXFUN(tmpfile, (void));
char * _EXFUN(tmpnam, (char *));
#if __BSD_VISIBLE || __XSI_VISIBLE || __POSIX_VISIBLE >= 200112
@@ -728,11 +734,11 @@ _ELIDABLE_INLINE int __sputc_r(struct _reent *_ptr, int _c, FILE *_p) {
__swbuf_r(_REENT, (int)(x), p) == EOF : (*(p)->_p = (x), (p)->_p++, 0))
#endif
-#if __XSI_VISIBLE
+#if __GNU_VISIBLE || (__XSI_VISIBLE && __XSI_VISIBLE < 600)
#define L_cuserid 9 /* posix says it goes in stdio.h :( */
-#ifdef __CYGWIN__
-#define L_ctermid 16
#endif
+#if __POSIX_VISIBLE
+#define L_ctermid 16
#endif
#endif /* !__CUSTOM_FILE_IO__ */