When commenting out BABELTRACE_HAVE_OPEN_MEMSTREAM in config.h, to test
the alternative implementation of bt_open_memstream, I get:
CC decoder.lo
In file included from /home/simark/src/babeltrace/src/plugins/ctf/common/metadata/decoder.c:20:
/home/simark/src/babeltrace/src/compat/memstream.h: In function ‘bt_open_memstream’:
/home/simark/src/babeltrace/src/compat/memstream.h:257:15: error: implicit declaration of function ‘unlink’ [-Werror=implicit-function-declaration]
257 | ret = unlink(tmpname);
| ^~~~~~
Fix that by including unistd.h.
Change-Id: Iaa44bc51846a0b8c9e16fdc24d42aef0c5ad0aca
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/7107
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
#else /* __MINGW32__ */
+#include <unistd.h>
+
/*
* Fallback for systems which don't have open_memstream. Create FILE *
* with bt_open_memstream, but require call to