]> git.ipfire.org Git - thirdparty/libbsd.git/commitdiff
Handle systems missing <sys/cdefs.h>
authorGuillem Jover <guillem@hadrons.org>
Tue, 6 Mar 2018 00:41:35 +0000 (01:41 +0100)
committerGuillem Jover <guillem@hadrons.org>
Tue, 13 Mar 2018 01:28:53 +0000 (02:28 +0100)
This is a non-portable header, and we cannot expect it to be provided by
the system libc (e.g. musl). We just need and rely on declaration that
we have defined ourselves in our own <bsd/sys/cdefs.h>. So we switch to
only ever assume that.

Fixes: https://bugs.freedesktop.org/105281
12 files changed:
include/bsd/libutil.h
include/bsd/md5.h
include/bsd/nlist.h
include/bsd/readpassphrase.h
include/bsd/stdlib.h
include/bsd/string.h
include/bsd/stringlist.h
include/bsd/sys/queue.h
include/bsd/sys/tree.h
include/bsd/timeconv.h
include/bsd/vis.h
include/bsd/wchar.h

index 45b3b15ac77b7254a855ac6125042f091937b3ee..ccca29a0ace355ef1014e7f655e161cbf8763f74 100644 (file)
 #define LIBBSD_LIBUTIL_H
 
 #include <features.h>
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 #include <stdint.h>
 #include <stdio.h>
index 5f3ae4629319d5104657040454a95555f85e568b..bf36a300e12ddf3876906be8d68e0e2ed209cc3c 100644 (file)
@@ -27,7 +27,11 @@ typedef struct MD5Context {
        uint8_t buffer[MD5_BLOCK_LENGTH];       /* input buffer */
 } MD5_CTX;
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 
 __BEGIN_DECLS
index cb297e8a3369cf7edf9d319d0c8dc8d8e8c781db..8767117c6b457df319c23528bbc0f27157b62ebe 100644 (file)
 #ifndef LIBBSD_NLIST_H
 #define LIBBSD_NLIST_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 
 struct nlist {
        union {
index 14744b81f22bb748c8d6d98adc345c56e6ee73b3..5eb80212393c9ce170f9126056d8d6cdd0a5dff5 100644 (file)
 #define RPP_SEVENBIT    0x10           /* Strip the high bit from input. */
 #define RPP_STDIN       0x20           /* Read from stdin, not /dev/tty */
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 
 __BEGIN_DECLS
index ebc9638d0b2444b96e4ef1bb6b5316dc346fbbdc..8d33d1fc9de39565e9e20a34133f25855adb5ad5 100644 (file)
 #ifndef LIBBSD_STDLIB_H
 #define LIBBSD_STDLIB_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/stat.h>
 #include <stdint.h>
 
index 6798bf65cbe377dfa8c0b1fe372e34f0b966ae8b..29097f66b6c107ffc824a17249f26aab278caab4 100644 (file)
 #ifndef LIBBSD_STRING_H
 #define LIBBSD_STRING_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 
 __BEGIN_DECLS
index ff30caca204e2286955e200fe8a8c002a912a2d5..dd71496fc2c63ef73fcd7450d35324fefa3ba61a 100644 (file)
 
 #ifndef LIBBSD_STRINGLIST_H
 #define LIBBSD_STRINGLIST_H
+
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 
 /*
index 4a94ea7724fb2e911616aa854ad8b0c32bd186f5..ac0002687e523d2e54ced60eace8f0cc1597d918 100644 (file)
 #ifndef LIBBSD_SYS_QUEUE_H
 #define LIBBSD_SYS_QUEUE_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 
 /*
  * This file defines four types of data structures: singly-linked lists,
index 628bec0eef667cf65b773b005582ea4ea6cf2541..325b382b1e922bfbad4e67127bba31efe256bb16 100644 (file)
 #ifndef LIBBSD_SYS_TREE_H
 #define LIBBSD_SYS_TREE_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 
 /*
  * This file defines data structures for different types of trees:
index e2a2c5511ff225626936e6fa4d463ae4568f2958..a426bd34ddddb875ac956e5b3e24fc7949e0c247 100644 (file)
 #ifndef LIBBSD_TIMECONV_H
 #define LIBBSD_TIMECONV_H
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <stdint.h>
 #include <time.h>
 
index 970dfddaa46d4a9a4f09843b2c598b112ad43ad0..ab5430c90b261f0273c8b3232a94d71084ca8ec7 100644 (file)
  */
 #define        UNVIS_END       1       /* no more characters */
 
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 
 __BEGIN_DECLS
 char   *vis(char *, int, int, int);
index 33a500ee3ddc1518f2efa4f8cc434b4611b8024d..7216503f474d628db66404cd1edcfe8c5dc1576e 100644 (file)
 #define LIBBSD_WCHAR_H
 
 #include <stddef.h>
+#ifdef LIBBSD_OVERLAY
 #include <sys/cdefs.h>
+#else
+#include <bsd/sys/cdefs.h>
+#endif
 #include <sys/types.h>
 
 __BEGIN_DECLS