diff options
-rwxr-xr-x | configure | 47 | ||||
-rw-r--r-- | src/Makefile | 1 | ||||
-rw-r--r-- | src/include/liburing.h | 9 | ||||
-rw-r--r-- | src/include/liburing/compat.h | 18 |
4 files changed, 48 insertions, 27 deletions
@@ -259,3 +259,50 @@ if test "$open_how" = "yes"; then fi echo "CC=$cc" >> $config_host_mak + +# generate compat.h +compat_h="src/include/liburing/compat.h" +cat > $compat_h << EOF +/* SPDX-License-Identifier: MIT */ +#ifndef LIBURING_COMPAT_H +#define LIBURING_COMPAT_H + +EOF + +if test "$__kernel_rwf_t" != "yes"; then +cat > $compat_h << EOF +typedef int __kernel_rwf_t; + +EOF +fi +if test "$__kernel_timespec" != "yes"; then +cat >> $compat_h << EOF +struct __kernel_timespec { + int64_t tv_sec; + long long tv_nsec; +}; + +EOF +else +cat >> $compat_h << EOF +#include <linux/time_types.h> + +EOF +fi +if test "$open_how" != "yes"; then +cat >> $compat_h << EOF +#include <inttypes.h> + +struct open_how { + uint64_t flags; + uint16_t mode; + uint16_t __padding[3]; + uint64_t resolve; +}; + +EOF +fi + +cat >> $compat_h << EOF +#endif +EOF diff --git a/src/Makefile b/src/Makefile index 0a1b198..54eee0f 100644 --- a/src/Makefile +++ b/src/Makefile @@ -69,3 +69,4 @@ $(liburing_objs): include/liburing.h clean: @rm -f $(all_targets) $(liburing_objs) $(liburing_sobjs) $(soname).new @rm -f *.so* *.a *.o + @rm -f include/liburing/compat.h diff --git a/src/include/liburing.h b/src/include/liburing.h index 7cd8fb4..8ca6cd9 100644 --- a/src/include/liburing.h +++ b/src/include/liburing.h @@ -15,15 +15,6 @@ extern "C" { #include "liburing/io_uring.h" #include "liburing/barrier.h" -#ifndef CONFIG_HAVE_OPEN_HOW -struct open_how { - uint64_t flags; - uint16_t mode; - uint16_t __padding[3]; - uint64_t resolve; -}; -#endif - /* * Library interface to io_uring */ diff --git a/src/include/liburing/compat.h b/src/include/liburing/compat.h deleted file mode 100644 index 7eaad41..0000000 --- a/src/include/liburing/compat.h +++ /dev/null @@ -1,18 +0,0 @@ -/* SPDX-License-Identifier: MIT */ -#ifndef LIBURING_COMPAT_H -#define LIBURING_COMPAT_H - -#if !defined(CONFIG_HAVE_KERNEL_RWF_T) -typedef int __kernel_rwf_t; -#endif - -#if !defined(CONFIG_HAVE_KERNEL_TIMESPEC) -struct __kernel_timespec { - int64_t tv_sec; - long long tv_nsec; -}; -#else -#include <linux/time_types.h> -#endif - -#endif |