compat: fix compilation with !BABELTRACE_HAVE_OPEN_MEMSTREAM
authorSimon Marchi <simon.marchi@efficios.com>
Sun, 23 Jan 2022 01:37:19 +0000 (20:37 -0500)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Fri, 28 Jan 2022 16:22:26 +0000 (11:22 -0500)
commit516bf0a77e025cfccce2fa400b757e94dc0bf1d8
tree1b97900cedf89d3903e5cdfe4992b4863f996513
parentcf81cdaeac58c2fdb99ba15bdcb588fc09750fd3
compat: fix compilation with !BABELTRACE_HAVE_OPEN_MEMSTREAM

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>
src/compat/memstream.h
This page took 0.02445 seconds and 4 git commands to generate.