fundamental: move several macros and functions into src/fundamental/
sd-boot has a copy of a subset of codes from libbasic. This makes sd-boot share the code with libbasic, and dedup the code. Note, startswith_no_case() is dropped from sd-boot, as - it is not used, - the previous implementation is not correct, - gnu-efi does not have StrniCmp() or so.
This commit is contained in:
@@ -158,15 +158,6 @@ void* greedy_realloc0(void **p, size_t *allocated, size_t need, size_t size);
|
||||
(void*)memset(_new_, 0, _xsize_); \
|
||||
})
|
||||
|
||||
/* Takes inspiration from Rust's Option::take() method: reads and returns a pointer, but at the same time
|
||||
* resets it to NULL. See: https://doc.rust-lang.org/std/option/enum.Option.html#method.take */
|
||||
#define TAKE_PTR(ptr) \
|
||||
({ \
|
||||
typeof(ptr) _ptr_ = (ptr); \
|
||||
(ptr) = NULL; \
|
||||
_ptr_; \
|
||||
})
|
||||
|
||||
#if HAS_FEATURE_MEMORY_SANITIZER
|
||||
# define msan_unpoison(r, s) __msan_unpoison(r, s)
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user