summaryrefslogtreecommitdiff
path: root/src/basic/macro.h
diff options
context:
space:
mode:
authorJan Janssen <medhefgo@web.de>2021-08-11 14:59:46 +0200
committerJan Janssen <medhefgo@web.de>2021-08-11 14:59:46 +0200
commitf862e847246b5588d9d6ed7d91da11b6adbf39e7 (patch)
tree91bc9418e754ac7aea79c432b9f29273de3c7824 /src/basic/macro.h
parentd178203d8e2dae9bba48790a93031f2e776a2f83 (diff)
downloadsystemd-f862e847246b5588d9d6ed7d91da11b6adbf39e7.tar.gz
macro: Move some macros to macro-fundamental.h
Also, make sure STRLEN works with wide strings too.
Diffstat (limited to 'src/basic/macro.h')
-rw-r--r--src/basic/macro.h23
1 files changed, 0 insertions, 23 deletions
diff --git a/src/basic/macro.h b/src/basic/macro.h
index 92498b0f20..3e89ba5e4d 100644
--- a/src/basic/macro.h
+++ b/src/basic/macro.h
@@ -23,28 +23,12 @@
#define _packed_ __attribute__((__packed__))
#define _malloc_ __attribute__((__malloc__))
#define _weak_ __attribute__((__weak__))
-#define _likely_(x) (__builtin_expect(!!(x), 1))
-#define _unlikely_(x) (__builtin_expect(!!(x), 0))
#define _public_ __attribute__((__visibility__("default")))
#define _hidden_ __attribute__((__visibility__("hidden")))
#define _weakref_(x) __attribute__((__weakref__(#x)))
#define _alignas_(x) __attribute__((__aligned__(__alignof(x))))
#define _alignptr_ __attribute__((__aligned__(sizeof(void*))))
#define _warn_unused_result_ __attribute__((__warn_unused_result__))
-#if __GNUC__ >= 7
-#define _fallthrough_ __attribute__((__fallthrough__))
-#else
-#define _fallthrough_
-#endif
-/* Define C11 noreturn without <stdnoreturn.h> and even on older gcc
- * compiler versions */
-#ifndef _noreturn_
-#if __STDC_VERSION__ >= 201112L
-#define _noreturn_ _Noreturn
-#else
-#define _noreturn_ __attribute__((__noreturn__))
-#endif
-#endif
#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
# if defined(__has_feature)
@@ -210,13 +194,6 @@ static inline size_t GREEDY_ALLOC_ROUND_UP(size_t l) {
}
/*
- * STRLEN - return the length of a string literal, minus the trailing NUL byte.
- * Contrary to strlen(), this is a constant expression.
- * @x: a string literal.
- */
-#define STRLEN(x) (sizeof(""x"") - 1U)
-
-/*
* container_of - cast a member of a structure out to the containing structure
* @ptr: the pointer to the member.
* @type: the type of the container struct this is embedded in.