unofficial mirror of bug-guile@gnu.org 
 help / color / mirror / Atom feed
From: ilove zfs <ilovezfs@icloud.com>
To: 25790@debbugs.gnu.org
Subject: bug#25790: SOCK_CLOEXEC and SOCK_NONBLOCK undeclared identifier errors with 2.1.7
Date: Sun, 19 Feb 2017 08:18:53 +0000 (GMT)	[thread overview]
Message-ID: <750c3b96-c1fb-40cb-b208-0dc2a205d283@me.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 2032 bytes --]

Despite the "accept4 flags.  No ifdef as accept4 has a gnulib implementation" building 2.1.7 fails with undeclared identifier errors for SOCK_CLOEXEC and SOCK_NONBLOCK on macOS. Wrapping the relevant sections in ifdef SOCK_CLOEXEC and ifdef SOCK_NONBLOCK seems to work around the build failure, but I'm not sure if there are any problems with doing this, or why the build isn't correctly taking advantage of the gnulib accept4 implementation.



Build logs here:

https://gist.github.com/ilovezfs/248677aac5bededf97ce429245295cd0
https://gist.github.com/21924118f0954831f2d62e7a79bef81d


Build failure is

```

  CC       libguile_2.2_la-net_db.lo
  CC       libguile_2.2_la-socket.lo
socket.c:1658:47: error: use of undeclared identifier 'SOCK_CLOEXEC'
  scm_c_define ("SOCK_CLOEXEC", scm_from_int (SOCK_CLOEXEC));
                                              ^
socket.c:1659:48: error: use of undeclared identifier 'SOCK_NONBLOCK'
  scm_c_define ("SOCK_NONBLOCK", scm_from_int (SOCK_NONBLOCK));
                                               ^
2 errors generated.
make[3]: *** [libguile_2.2_la-socket.lo] Error 1
make[2]: *** [install] Error 2
make[1]: *** [install-recursive] Error 1
make: *** [install] Error 2

```



The workaround I'm using is here https://gist.githubusercontent.com/ilovezfs/90060a1be3b0478c1c89e78d23377ff8/raw/eed5c6beb984e13ab52bf7942360383488cd43d3/gistfile1.txt

```

diff --git a/libguile/socket.c b/libguile/socket.c
index 64df64f..446243c 100644
--- a/libguile/socket.c
+++ b/libguile/socket.c
@@ -1655,8 +1655,12 @@ scm_init_socket ()
 
   /* accept4 flags.  No ifdef as accept4 has a gnulib
      implementation.  */
+#ifdef SOCK_CLOEXEC
   scm_c_define ("SOCK_CLOEXEC", scm_from_int (SOCK_CLOEXEC));
+#endif
+#ifdef SOCK_NONBLOCK
   scm_c_define ("SOCK_NONBLOCK", scm_from_int (SOCK_NONBLOCK));
+#endif
 
   /* setsockopt level.
```

[-- Attachment #2.1: Type: text/html, Size: 3405 bytes --]

             reply	other threads:[~2017-02-19  8:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-19  8:18 ilove zfs [this message]
2017-02-20 22:06 ` bug#25790: guile-2.1.7 SOCK_CLOEXEC etc Matt Wette
2017-02-21 21:15 ` bug#25790: SOCK_CLOEXEC and SOCK_NONBLOCK undeclared identifier errors with 2.1.7 Andy Wingo

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

  List information: https://www.gnu.org/software/guile/

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

  git send-email \
    --in-reply-to=750c3b96-c1fb-40cb-b208-0dc2a205d283@me.com \
    --to=ilovezfs@icloud.com \
    --cc=25790@debbugs.gnu.org \
    /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).