]> git.ipfire.org Git - thirdparty/shadow.git/commitdiff
lib/, src/: Move macros to "typetraits.h"
authorAlejandro Colomar <alx@kernel.org>
Mon, 26 May 2025 12:17:25 +0000 (14:17 +0200)
committerSerge Hallyn <serge@hallyn.com>
Tue, 3 Jun 2025 14:34:55 +0000 (09:34 -0500)
The macros that remain in "must_be.h" really belong in "typetraits.h".
Move them there, and remove "must_be.h".

Signed-off-by: Alejandro Colomar <alx@kernel.org>
lib/Makefile.am
lib/must_be.h [deleted file]
lib/search/l/lfind.h
lib/search/l/lsearch.h
lib/search/sort/qsort.h
lib/typetraits.h
src/usermod.c

index b492d420bacd5f3e659dbdffb90c9f23fb612db1..55d340397bdbcd1e66c17104d5ef6668df58e6db 100644 (file)
@@ -124,7 +124,6 @@ libshadow_la_SOURCES = \
        loginprompt.c \
        mail.c \
        motd.c \
-       must_be.h \
        myname.c \
        nss.c \
        nscd.c \
diff --git a/lib/must_be.h b/lib/must_be.h
deleted file mode 100644 (file)
index ff9b150..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * SPDX-FileCopyrightText: 2019-2023, Alejandro Colomar <alx@kernel.org>
- * SPDX-License-Identifier: BSD-3-Clause
- */
-
-
-#ifndef SHADOW_INCLUDE_LIBMISC_MUST_BE_H_
-#define SHADOW_INCLUDE_LIBMISC_MUST_BE_H_
-
-
-#include <config.h>
-
-
-#define is_same_type(a, b)                                                    \
-(                                                                             \
-       __builtin_types_compatible_p(a, b)                                    \
-)
-
-
-#define is_same_typeof(a, b)                                                  \
-(                                                                             \
-       is_same_type(typeof(a), typeof(b))                                    \
-)
-
-
-#endif  // include guard
index 2a6f6f6efed43dc3fbdf947fca942d52758c07b3..ddbadb1d4e23959b6ec507d713285ec530413ede 100644 (file)
@@ -11,8 +11,8 @@
 #include <search.h>
 #include <stddef.h>
 
-#include "must_be.h"
 #include "search/cmp/cmp.h"
+#include "typetraits.h"
 
 #include <assert.h>
 
index fd269cb5e8fe9371a0b4a630d35e6b57daf4f9c0..7ee4c9bfd39949143c781779e06e9f690c1c6278 100644 (file)
@@ -10,8 +10,8 @@
 
 #include <search.h>
 
-#include "must_be.h"
 #include "search/cmp/cmp.h"
+#include "typetraits.h"
 
 #include <assert.h>
 
index 4a23506b007a6badaafc0ab514f2e5f5c3afaa87..962dba2499ee19c59a64f3503550738256397183 100644 (file)
@@ -10,8 +10,8 @@
 
 #include <stdlib.h>
 
-#include "must_be.h"
 #include "search/cmp/cmp.h"
+#include "typetraits.h"
 
 
 #define QSORT(a, n)  do                                               \
index 47bd30d94699848cad019a295c456252431313d1..7d3269d61aa46719d1775c6963556e44a689ece8 100644 (file)
@@ -1,4 +1,4 @@
-// SPDX-FileCopyrightText: 2022-2024, Alejandro Colomar <alx@kernel.org>
+// SPDX-FileCopyrightText: 2019-2024, Alejandro Colomar <alx@kernel.org>
 // SPDX-License-Identifier: BSD-3-Clause
 
 
 )
 
 
+#define is_same_type(a, b)                                                    \
+(                                                                             \
+       __builtin_types_compatible_p(a, b)                                    \
+)
+
+#define is_same_typeof(a, b)                                                  \
+(                                                                             \
+       is_same_type(typeof(a), typeof(b))                                    \
+)
+
+
 #endif  // include guard
index e886a1531eab6332be1de8de43946f44349675fc..cbae052fbe212adae9c4c18bcfd347c9e17e0288 100644 (file)
@@ -42,7 +42,6 @@
 #include "faillog.h"
 #include "getdef.h"
 #include "groupio.h"
-#include "must_be.h"
 #include "nscd.h"
 #include "prototypes.h"
 #include "pwauth.h"
@@ -68,6 +67,7 @@
 #include "string/strcmp/strprefix.h"
 #include "string/strdup/xstrdup.h"
 #include "time/day_to_str.h"
+#include "typetraits.h"
 
 
 /*