mirror of
https://github.com/kdave/btrfs-progs
synced 2024-12-22 14:13:04 +00:00
btrfs-progs: kerncompat: rename swap to __swap
The 'swap' is too generic and clashes with some userspace tools that compile against btrfs, eg. snapper when including boost::smart_ptr::scoped_array after kerncompat.h: /usr/include/boost/smart_ptr/scoped_array.hpp:127:13: error: macro "swap" requires 2 arguments, but only 1 given a.swap(b); Signed-off-by: David Sterba <dsterba@suse.com>
This commit is contained in:
parent
01e35d9f53
commit
d96671ae54
@ -201,7 +201,7 @@ static bool merge_ref(struct btrfs_trans_handle *trans,
|
||||
mod = next->ref_mod;
|
||||
} else {
|
||||
if (ref->ref_mod < next->ref_mod) {
|
||||
swap(ref, next);
|
||||
__swap(ref, next);
|
||||
done = true;
|
||||
}
|
||||
mod = -next->ref_mod;
|
||||
|
@ -266,11 +266,11 @@ static inline int IS_ERR_OR_NULL(const void *ptr)
|
||||
#define div_u64(x, y) ((x) / (y))
|
||||
|
||||
/**
|
||||
* swap - swap values of @a and @b
|
||||
* __swap - swap values of @a and @b
|
||||
* @a: first value
|
||||
* @b: second value
|
||||
*/
|
||||
#define swap(a, b) \
|
||||
#define __swap(a, b) \
|
||||
do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0)
|
||||
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user