#define assert(expr) ({ _likely_(expr) ? VOID_0 : efi_assert(#expr, __FILE__, __LINE__, __PRETTY_FUNCTION__); })
#define assert_not_reached() efi_assert("Code should not be reached", __FILE__, __LINE__, __PRETTY_FUNCTION__)
#endif
+
+ #define memcpy(a, b, c) CopyMem((a), (b), (c))
#endif
#if defined(static_assert)
#include "string-util-fundamental.h"
sd_char *startswith(const sd_char *s, const sd_char *prefix) {
- sd_size_t l;
+ size_t l;
assert(s);
assert(prefix);
#ifndef SD_BOOT
sd_char *startswith_no_case(const sd_char *s, const sd_char *prefix) {
- sd_size_t l;
+ size_t l;
assert(s);
assert(prefix);
#endif
sd_char* endswith(const sd_char *s, const sd_char *postfix) {
- sd_size_t sl, pl;
+ size_t sl, pl;
assert(s);
assert(postfix);
}
sd_char* endswith_no_case(const sd_char *s, const sd_char *postfix) {
- sd_size_t sl, pl;
+ size_t sl, pl;
assert(s);
assert(postfix);
sd_int strverscmp_improved(const sd_char *a, const sd_char *b);
/* Like startswith(), but operates on arbitrary memory blocks */
-static inline void *memory_startswith(const void *p, sd_size_t sz, const sd_char *token) {
+static inline void *memory_startswith(const void *p, size_t sz, const sd_char *token) {
assert(token);
- sd_size_t n = strlen(token) * sizeof(sd_char);
+ size_t n = strlen(token) * sizeof(sd_char);
if (sz < n)
return NULL;
typedef BOOLEAN sd_bool;
typedef CHAR16 sd_char;
typedef INTN sd_int;
-typedef UINTN sd_size_t;
+typedef UINTN size_t;
#define true TRUE
#define false FALSE
typedef bool sd_bool;
typedef char sd_char;
typedef int sd_int;
-typedef size_t sd_size_t;
#endif