Reduce the number of Makefiles in 'src/'
[babeltrace.git] / src / cpp-common / libc-up.hpp
CommitLineData
23ed167e
SM
1/*
2 * Copyright (c) 2022 EfficiOS, inc.
3 *
4 * SPDX-License-Identifier: MIT
5 */
6
7#ifndef BABELTRACE_CPP_COMMON_LIBC_UP_HPP
8#define BABELTRACE_CPP_COMMON_LIBC_UP_HPP
9
10#include <cstdio>
11#include <memory>
12
13namespace bt2_common {
14namespace internal {
15
16struct FileCloserDeleter
17{
18 void operator()(std::FILE * const f) noexcept
19 {
20 std::fclose(f);
21 }
22};
23
24} /* namespace internal */
25
26using FileUP = std::unique_ptr<std::FILE, internal::FileCloserDeleter>;
27
28} /* namespace bt2_common */
29
30#endif /* BABELTRACE_CPP_COMMON_LIBC_UP_HPP */
This page took 0.031244 seconds and 4 git commands to generate.