chiark / gitweb /
portability: Provide implementation of fmemopen
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Tue, 26 Nov 2019 22:16:22 +0000 (22:16 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Mon, 30 Dec 2019 13:15:49 +0000 (13:15 +0000)
commit4c6a3e3eee6288d264f1335cbe48ee074d6f86e4
treec3480ee35f5ff119b4c05b901fb09fed865d6b06
parentb873ef8ae5b6713b9b746a40b210b7b5859be077
portability: Provide implementation of fmemopen

We are going to want one of these.  I have tested it as follows:

1. In configure.ac just before AC_CHECK_FUNCS, add:  LIBS+=-lbsd
2. In osdep.c, add:  #include <bsd/stdio.h>
3. Change all fmemopen to Yfmemopen, with
     git-ls-files | perl -lne 'print if lstat and -f _' | xargs perl -i~ -pe 's/fmemopen/Y$&/gi'

The result is that we do not find Yfmemopen.  The tests still pass and
I have verified that my stunt implementation is called.

FTR, this rune undoes the Y:
     git-ls-files | perl -lne 'print if lstat and -f _' | xargs perl -i~ -pe 's/Y(fmemopen)/$1/gi'

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
config.h.in
configure
configure.ac
osdep.c
osdep.h