This is an implementation of liburing that's header only and trying to be standard compliant (which liburing itself is not).
extern "C"
or extern "C++"
esThis library is a fork of liburing 2.4 (or 2.5, here's the exact commit); we've kept up with the changes so far (version 2.7).
noexcept
for C++Using CPM.cmake (Use a release link instead of the master branch, and adjust the version):
CPMAddPackage(
NAME liburing
URL https://github.com/the-moisrex/liburing-hdr-only/archive/refs/heads/master.zip
VERSION 2.7
OPTIONS
"LIBURING_CXX ON"
)
#ifdef __linux__
# if defined(USE_OS_LIBURING) && __has_include(<liburing.h>)
# include <liburing.h>
# else
# include <liburing/liburing-hdr-only.h>
# endif
#endif
Then define USE_OS_LIBURING
in your build system (-DUSE_OS_LIBURING
) to enable the use of original liburing if it exists,
and fallback on the header-only version otherwise.
#ifdef __linux__
# if __has_include(<liburing/liburing-hdr-only.h>)
# include <liburing/liburing-hdr-only.h>
# else
# include <liburing.h>
# endif
#endif