]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-sizeof: let's be a tiny bit more careful when using glibc internal types
authorLennart Poettering <lennart@poettering.net>
Thu, 1 Jun 2023 08:46:47 +0000 (10:46 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Thu, 1 Jun 2023 12:10:04 +0000 (21:10 +0900)
One can argue that internal glibc types (i.e. those starting with __)
are not really part of the glibc API, hence let's at least ifdef them.

src/test/test-sizeof.c

index 30b252ecd9da7bb31844d4403e1c6827bb777460..5dd8a04bbd7ea2b855162c0ac8a981ab52c38031 100644 (file)
@@ -55,8 +55,10 @@ int main(void) {
         info(unsigned);
         info(unsigned long);
         info(unsigned long long);
+#ifdef __GLIBC__
         info(__syscall_ulong_t);
         info(__syscall_slong_t);
+#endif
         info(intmax_t);
         info(uintmax_t);
 
@@ -76,13 +78,17 @@ int main(void) {
         info(ssize_t);
         info(time_t);
         info(usec_t);
+#ifdef __GLIBC__
         info(__time_t);
+#endif
         info(pid_t);
         info(uid_t);
         info(gid_t);
         info(socklen_t);
 
+#ifdef __GLIBC__
         info(__cpu_mask);
+#endif
 
         info(enum Enum);
         info(enum BigEnum);