We have these macros already, hence use them.
-__attribute__((destructor)) static void cleanup_pools(void) {
+_destructor_ static void cleanup_pools(void) {
_cleanup_free_ char *t = NULL;
int r;
_cleanup_free_ char *t = NULL;
int r;
* headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
* libpthread, as it is part of glibc anyway. */
extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
* headers. __register_atfork() is mostly equivalent to pthread_atfork(), but doesn't require us to link against
* libpthread, as it is part of glibc anyway. */
extern int __register_atfork(void (*prepare) (void), void (*parent) (void), void (*child) (void), void *dso_handle);
-extern void* __dso_handle __attribute__ ((__weak__));
+extern void* __dso_handle _weak_;
pid_t getpid_cached(void) {
static bool installed = false;
pid_t getpid_cached(void) {
static bool installed = false;
/* Beginning and end of our section listing the destructors. We define these as weak as we want this to work even if
* there's not a single destructor is defined in which case the section will be missing. */
/* Beginning and end of our section listing the destructors. We define these as weak as we want this to work even if
* there's not a single destructor is defined in which case the section will be missing. */
-extern const struct StaticDestructor __attribute__((__weak__)) __start_SYSTEMD_STATIC_DESTRUCT[];
-extern const struct StaticDestructor __attribute__((__weak__)) __stop_SYSTEMD_STATIC_DESTRUCT[];
+extern const struct StaticDestructor _weak_ __start_SYSTEMD_STATIC_DESTRUCT[];
+extern const struct StaticDestructor _weak_ __stop_SYSTEMD_STATIC_DESTRUCT[];
/* The function to destroy everything. (Note that this must be static inline, as it's key that it remains in the same
* linking unit as the variables we want to destroy. */
/* The function to destroy everything. (Note that this must be static inline, as it's key that it remains in the same
* linking unit as the variables we want to destroy. */
}
#define PROTECT_ERRNO \
}
#define PROTECT_ERRNO \
- _cleanup_(_reset_errno_) __attribute__((__unused__)) int _saved_errno_ = errno
+ _cleanup_(_reset_errno_) _unused_ int _saved_errno_ = errno
static inline int negative_errno(void) {
/* This helper should be used to shut up gcc if you know 'errno' is
static inline int negative_errno(void) {
/* This helper should be used to shut up gcc if you know 'errno' is