public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Christopher Faylor <cgf-use-the-mailinglist-please@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Prototype initstate() etc. if _XOPEN_SOURCE is defined appropriately
Date: Wed, 13 Nov 2013 15:15:00 -0000	[thread overview]
Message-ID: <20131113151529.GA743@ednor.casa.cgf.cx> (raw)
In-Reply-To: <52838E8C.5060708@dronecode.org.uk>

On Wed, Nov 13, 2013 at 02:37:00PM +0000, Jon TURNEY wrote:
>
>Not sure if this is wanted, but mesa likes to compile with '-std=c99
>D_XOPEN_SOURCE=500', which leads to exciting crashes on x86_64 because
>initstate() is not prototyped.
>
>2013-11-13  Jon TURNEY  <jon.turney@dronecode.org.uk>
>
>	* include/cygwin/stdlib.h(initstate, random, setstate, srandom) :
>	Prototype if not __STRICT_ANSI__ or _XOPEN_SOURCE is defined appropriately.

Looks good to me.  Please commit.

cgf

>Index: cygwin/include/cygwin/stdlib.h
>===================================================================
>RCS file: /cvs/src/src/winsup/cygwin/include/cygwin/stdlib.h,v
>retrieving revision 1.13
>diff -u -u -p -r1.13 stdlib.h
>--- cygwin/include/cygwin/stdlib.h	21 May 2013 19:04:49 -0000	1.13
>+++ cygwin/include/cygwin/stdlib.h	13 Nov 2013 14:28:35 -0000
>@@ -31,10 +31,14 @@ void	setprogname (const char *);
> char *realpath (const char *, char *);
> char *canonicalize_file_name (const char *);
> int unsetenv (const char *);
>+#endif /*__STRICT_ANSI__*/
>+#if !defined(__STRICT_ANSI__) || (_XOPEN_SOURCE >= 500) || (defined(_XOPEN_SOURCE) && defined(_XOPEN_SOURCE_EXTENDED))
> char *initstate (unsigned seed, char *state, size_t size);
> long random (void);
> char *setstate (const char *state);
> void srandom (unsigned);
>+#endif
>+#ifndef __STRICT_ANSI__
> char *ptsname (int);
> int ptsname_r(int, char *, size_t);
> int getpt (void);

  reply	other threads:[~2013-11-13 15:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-13 14:36 Jon TURNEY
2013-11-13 15:15 ` Christopher Faylor [this message]
2013-11-13 15:18 ` Corinna Vinschen
2015-02-19 13:00 ` Jon TURNEY
2015-02-19 13:23   ` Corinna Vinschen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20131113151529.GA743@ednor.casa.cgf.cx \
    --to=cgf-use-the-mailinglist-please@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).