mirror of
https://github.com/kdave/btrfs-progs
synced 2025-04-28 14:08:00 +00:00
btrfs-progs: kerncompat: define __DECLARE_FLEX_ARRAY if missing
The macro is not available on LTS distros, copy definition from kernel. Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
ed1f7ac5ed
commit
d6e23e1d5f
@ -103,6 +103,26 @@
|
|||||||
#define BUILD_ASSERT(x)
|
#define BUILD_ASSERT(x)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef __DECLARE_FLEX_ARRAY
|
||||||
|
/*
|
||||||
|
* Copied from linux.git/include/uapi/stddef.h
|
||||||
|
*
|
||||||
|
* __DECLARE_FLEX_ARRAY() - Declare a flexible array usable in a union
|
||||||
|
*
|
||||||
|
* @TYPE: The type of each flexible array element
|
||||||
|
* @NAME: The name of the flexible array member
|
||||||
|
*
|
||||||
|
* In order to have a flexible array member in a union or alone in a struct, it
|
||||||
|
* needs to be wrapped in an anonymous struct with at least 1 named member, but
|
||||||
|
* that member can be empty.
|
||||||
|
*/
|
||||||
|
#define __DECLARE_FLEX_ARRAY(TYPE, NAME) \
|
||||||
|
struct { \
|
||||||
|
struct { } __empty_ ## NAME; \
|
||||||
|
TYPE NAME[]; \
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
static inline void print_trace(void)
|
static inline void print_trace(void)
|
||||||
{
|
{
|
||||||
#ifndef BTRFS_DISABLE_BACKTRACE
|
#ifndef BTRFS_DISABLE_BACKTRACE
|
||||||
|
Loading…
Reference in New Issue
Block a user