]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
basic: Include time-util.h in constants.h
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 07:23:13 +0000 (09:23 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 08:49:42 +0000 (10:49 +0200)
constants.h defines a bunch of constants that use macros from
time-util.h, so add the needed include. To avoid cyclic dependencies,
we move the HAS_FEATURE_MEMORY_SANITIZER and HAS_FEATURE_ADDRESS_SANITIZER
logic to macro.h and get rid of the constants.h include there.

The rest of this commit is adding missing constants.h includes where
needed due to it being removed from macro.h.

src/basic/constants.h
src/basic/macro.h
src/core/ipe-setup.c
src/resolve/resolved-dns-delegate.c
src/systemctl/systemctl-daemon-reload.c
src/timedate/timedatectl.c

index 93e6efbdcae1bd077481692f7c8a7d0522b30923..7a09fbf878e89c18ddb819c0d815360cc4980bdb 100644 (file)
@@ -1,29 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
-#  if defined(__has_feature)
-#    if __has_feature(memory_sanitizer)
-#      define HAS_FEATURE_MEMORY_SANITIZER 1
-#    endif
-#  endif
-#  if !defined(HAS_FEATURE_MEMORY_SANITIZER)
-#    define HAS_FEATURE_MEMORY_SANITIZER 0
-#  endif
-#endif
-
-#if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
-#  ifdef __SANITIZE_ADDRESS__
-#      define HAS_FEATURE_ADDRESS_SANITIZER 1
-#  elif defined(__has_feature)
-#    if __has_feature(address_sanitizer)
-#      define HAS_FEATURE_ADDRESS_SANITIZER 1
-#    endif
-#  endif
-#  if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
-#    define HAS_FEATURE_ADDRESS_SANITIZER 0
-#  endif
-#endif
+#include "time-util.h"
 
 #define DEFAULT_RESTART_USEC (100*USEC_PER_MSEC)
 
index 9391fc5e88ca64b20edb36d1bbf491f920cd5bed..03a05b136807a71a9189868bc148cb38dcca5050 100644 (file)
@@ -1,9 +1,32 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "constants.h"
 #include "macro-fundamental.h"
 
+#if !defined(HAS_FEATURE_MEMORY_SANITIZER)
+#  if defined(__has_feature)
+#    if __has_feature(memory_sanitizer)
+#      define HAS_FEATURE_MEMORY_SANITIZER 1
+#    endif
+#  endif
+#  if !defined(HAS_FEATURE_MEMORY_SANITIZER)
+#    define HAS_FEATURE_MEMORY_SANITIZER 0
+#  endif
+#endif
+
+#if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
+#  ifdef __SANITIZE_ADDRESS__
+#      define HAS_FEATURE_ADDRESS_SANITIZER 1
+#  elif defined(__has_feature)
+#    if __has_feature(address_sanitizer)
+#      define HAS_FEATURE_ADDRESS_SANITIZER 1
+#    endif
+#  endif
+#  if !defined(HAS_FEATURE_ADDRESS_SANITIZER)
+#    define HAS_FEATURE_ADDRESS_SANITIZER 0
+#  endif
+#endif
+
 /* Note: on GCC "no_sanitize_address" is a function attribute only, on llvm it may also be applied to global
  * variables. We define a specific macro which knows this. Note that on GCC we don't need this decorator so much, since
  * our primary use case for this attribute is registration structures placed in named ELF sections which shall not be
index 392c9187e5e1e39b02a28732bb97e1e135239494..7bf4f52d04781179d69d8da26640d8bbaa9c7b74 100644 (file)
@@ -4,6 +4,7 @@
 
 #include "alloc-util.h"
 #include "conf-files.h"
+#include "constants.h"
 #include "copy.h"
 #include "fd-util.h"
 #include "fileio.h"
index 6a094ce68e6263db09f5ca9f0f56af962d0f515a..969836c30479dfb6b22271b1f2c7d47c95905cb7 100644 (file)
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "conf-files.h"
+#include "constants.h"
 #include "dns-domain.h"
 #include "in-addr-util.h"
 #include "path-util.h"
index 03a06c077d8e593e441e4c7090accdae538d295e..2e924b75b1ac54212df610f9015ec8c5f26ba7fa 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "bus-error.h"
 #include "bus-locator.h"
+#include "constants.h"
 #include "systemctl.h"
 #include "systemctl-daemon-reload.h"
 #include "systemctl-util.h"
index 78b4feaebe58a14cf0546a204542fb36499ca962..d55b26188f6facc2578a56b98f064b826efd478b 100644 (file)
@@ -14,6 +14,7 @@
 #include "bus-locator.h"
 #include "bus-map-properties.h"
 #include "bus-print-properties.h"
+#include "constants.h"
 #include "env-util.h"
 #include "format-table.h"
 #include "in-addr-util.h"