From e061b6da5ee46a334169d4e6a52e49857ae22f55 Mon Sep 17 00:00:00 2001 From: Tavian Barnes Date: Fri, 26 Apr 2024 17:42:44 -0400 Subject: config: Move .c files into config/{use,has} subdirectories --- config/acl-get-entry.c | 8 ---- config/acl-get-file.c | 8 ---- config/acl-get-tag-type.c | 10 ---- config/acl-is-trivial-np.c | 12 ----- config/acl-trivial.c | 8 ---- config/aligned-alloc.c | 8 ---- config/cc-define.sh | 19 -------- config/confstr.c | 9 ---- config/define-if.sh | 20 ++++++++ config/extattr-get-file.c | 10 ---- config/extattr-get-link.c | 10 ---- config/extattr-list-file.c | 10 ---- config/extattr-list-link.c | 10 ---- config/fdclosedir.c | 8 ---- config/getdents.c | 10 ---- config/getdents64-syscall.c | 12 ----- config/getdents64.c | 10 ---- config/getprogname-gnu.c | 9 ---- config/getprogname.c | 9 ---- config/has/acl-get-entry.c | 8 ++++ config/has/acl-get-file.c | 8 ++++ config/has/acl-get-tag-type.c | 10 ++++ config/has/acl-is-trivial-np.c | 12 +++++ config/has/acl-trivial.c | 8 ++++ config/has/aligned-alloc.c | 8 ++++ config/has/confstr.c | 9 ++++ config/has/extattr-get-file.c | 10 ++++ config/has/extattr-get-link.c | 10 ++++ config/has/extattr-list-file.c | 10 ++++ config/has/extattr-list-link.c | 10 ++++ config/has/fdclosedir.c | 8 ++++ config/has/getdents.c | 10 ++++ config/has/getdents64-syscall.c | 12 +++++ config/has/getdents64.c | 10 ++++ config/has/getprogname-gnu.c | 9 ++++ config/has/getprogname.c | 9 ++++ config/has/max-align-t.c | 8 ++++ config/has/pipe2.c | 10 ++++ config/has/posix-spawn-addfchdir-np.c | 11 +++++ config/has/posix-spawn-addfchdir.c | 11 +++++ config/has/st-acmtim.c | 12 +++++ config/has/st-acmtimespec.c | 12 +++++ config/has/st-birthtim.c | 9 ++++ config/has/st-birthtimespec.c | 9 ++++ config/has/st-flags.c | 9 ++++ config/has/statx-syscall.c | 13 +++++ config/has/statx.c | 11 +++++ config/has/strerror-l.c | 11 +++++ config/has/strerror-r-gnu.c | 11 +++++ config/has/strerror-r-posix.c | 11 +++++ config/has/tm-gmtoff.c | 9 ++++ config/has/uselocale.c | 9 ++++ config/header.mk | 89 +++++++++++++++++------------------ config/libacl.c | 9 ---- config/libcap.c | 9 ---- config/libselinux.c | 9 ---- config/liburing.c | 9 ---- config/max-align-t.c | 8 ---- config/oniguruma.c | 9 ---- config/pipe2.c | 10 ---- config/pkgconf.sh | 2 +- config/pkgs.mk | 28 +++++------ config/posix-spawn-addfchdir-np.c | 11 ----- config/posix-spawn-addfchdir.c | 11 ----- config/prelude.mk | 10 +++- config/st-acmtim.c | 12 ----- config/st-acmtimespec.c | 12 ----- config/st-birthtim.c | 9 ---- config/st-birthtimespec.c | 9 ---- config/st-flags.c | 9 ---- config/statx-syscall.c | 13 ----- config/statx.c | 11 ----- config/strerror-l.c | 11 ----- config/strerror-r-gnu.c | 11 ----- config/strerror-r-posix.c | 11 ----- config/tm-gmtoff.c | 9 ---- config/use/libacl.c | 9 ++++ config/use/libcap.c | 9 ++++ config/use/libselinux.c | 9 ++++ config/use/liburing.c | 9 ++++ config/use/oniguruma.c | 9 ++++ config/uselocale.c | 9 ---- 82 files changed, 457 insertions(+), 455 deletions(-) delete mode 100644 config/acl-get-entry.c delete mode 100644 config/acl-get-file.c delete mode 100644 config/acl-get-tag-type.c delete mode 100644 config/acl-is-trivial-np.c delete mode 100644 config/acl-trivial.c delete mode 100644 config/aligned-alloc.c delete mode 100755 config/cc-define.sh delete mode 100644 config/confstr.c create mode 100755 config/define-if.sh delete mode 100644 config/extattr-get-file.c delete mode 100644 config/extattr-get-link.c delete mode 100644 config/extattr-list-file.c delete mode 100644 config/extattr-list-link.c delete mode 100644 config/fdclosedir.c delete mode 100644 config/getdents.c delete mode 100644 config/getdents64-syscall.c delete mode 100644 config/getdents64.c delete mode 100644 config/getprogname-gnu.c delete mode 100644 config/getprogname.c create mode 100644 config/has/acl-get-entry.c create mode 100644 config/has/acl-get-file.c create mode 100644 config/has/acl-get-tag-type.c create mode 100644 config/has/acl-is-trivial-np.c create mode 100644 config/has/acl-trivial.c create mode 100644 config/has/aligned-alloc.c create mode 100644 config/has/confstr.c create mode 100644 config/has/extattr-get-file.c create mode 100644 config/has/extattr-get-link.c create mode 100644 config/has/extattr-list-file.c create mode 100644 config/has/extattr-list-link.c create mode 100644 config/has/fdclosedir.c create mode 100644 config/has/getdents.c create mode 100644 config/has/getdents64-syscall.c create mode 100644 config/has/getdents64.c create mode 100644 config/has/getprogname-gnu.c create mode 100644 config/has/getprogname.c create mode 100644 config/has/max-align-t.c create mode 100644 config/has/pipe2.c create mode 100644 config/has/posix-spawn-addfchdir-np.c create mode 100644 config/has/posix-spawn-addfchdir.c create mode 100644 config/has/st-acmtim.c create mode 100644 config/has/st-acmtimespec.c create mode 100644 config/has/st-birthtim.c create mode 100644 config/has/st-birthtimespec.c create mode 100644 config/has/st-flags.c create mode 100644 config/has/statx-syscall.c create mode 100644 config/has/statx.c create mode 100644 config/has/strerror-l.c create mode 100644 config/has/strerror-r-gnu.c create mode 100644 config/has/strerror-r-posix.c create mode 100644 config/has/tm-gmtoff.c create mode 100644 config/has/uselocale.c delete mode 100644 config/libacl.c delete mode 100644 config/libcap.c delete mode 100644 config/libselinux.c delete mode 100644 config/liburing.c delete mode 100644 config/max-align-t.c delete mode 100644 config/oniguruma.c delete mode 100644 config/pipe2.c delete mode 100644 config/posix-spawn-addfchdir-np.c delete mode 100644 config/posix-spawn-addfchdir.c delete mode 100644 config/st-acmtim.c delete mode 100644 config/st-acmtimespec.c delete mode 100644 config/st-birthtim.c delete mode 100644 config/st-birthtimespec.c delete mode 100644 config/st-flags.c delete mode 100644 config/statx-syscall.c delete mode 100644 config/statx.c delete mode 100644 config/strerror-l.c delete mode 100644 config/strerror-r-gnu.c delete mode 100644 config/strerror-r-posix.c delete mode 100644 config/tm-gmtoff.c create mode 100644 config/use/libacl.c create mode 100644 config/use/libcap.c create mode 100644 config/use/libselinux.c create mode 100644 config/use/liburing.c create mode 100644 config/use/oniguruma.c delete mode 100644 config/uselocale.c diff --git a/config/acl-get-entry.c b/config/acl-get-entry.c deleted file mode 100644 index 3cce771..0000000 --- a/config/acl-get-entry.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include - -int main(void) { - acl_t acl = acl_get_file(".", ACL_TYPE_DEFAULT); - acl_entry_t entry; - return acl_get_entry(acl, ACL_FIRST_ENTRY, &entry); -} diff --git a/config/acl-get-file.c b/config/acl-get-file.c deleted file mode 100644 index 89fbf23..0000000 --- a/config/acl-get-file.c +++ /dev/null @@ -1,8 +0,0 @@ -#include -#include -#include - -int main(void) { - acl_t acl = acl_get_file(".", ACL_TYPE_DEFAULT); - return acl == (acl_t)NULL; -} diff --git a/config/acl-get-tag-type.c b/config/acl-get-tag-type.c deleted file mode 100644 index 2901956..0000000 --- a/config/acl-get-tag-type.c +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include -#include - -int main(void) { - acl_entry_t entry; - memset(&entry, 0, sizeof(entry)); - acl_tag_t tag; - return acl_get_tag_type(entry, &tag); -} diff --git a/config/acl-is-trivial-np.c b/config/acl-is-trivial-np.c deleted file mode 100644 index 9ca9fc7..0000000 --- a/config/acl-is-trivial-np.c +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include - -int main(void) { - acl_t acl = acl_get_fd(3); - int trivial; - acl_is_trivial_np(acl, &trivial); - return 0; -} diff --git a/config/acl-trivial.c b/config/acl-trivial.c deleted file mode 100644 index 7efc838..0000000 --- a/config/acl-trivial.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - return acl_trivial("."); -} diff --git a/config/aligned-alloc.c b/config/aligned-alloc.c deleted file mode 100644 index 4460038..0000000 --- a/config/aligned-alloc.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - return !aligned_alloc(_Alignof(void *), sizeof(void *)); -} diff --git a/config/cc-define.sh b/config/cc-define.sh deleted file mode 100755 index edb5c87..0000000 --- a/config/cc-define.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh - -# Copyright © Tavian Barnes -# SPDX-License-Identifier: 0BSD - -# Output a C preprocessor definition based on whether a C source file could be -# compiled successfully - -set -eu - -SLUG="${1#config/}" -SLUG="${SLUG%.c}" -MACRO="BFS_HAS_$(printf '%s' "$SLUG" | tr 'a-z-' 'A-Z_')" - -if config/cc.sh "$1"; then - printf '#define %s true\n' "$MACRO" -else - printf '#define %s false\n' "$MACRO" -fi diff --git a/config/confstr.c b/config/confstr.c deleted file mode 100644 index 58280b4..0000000 --- a/config/confstr.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - confstr(_CS_PATH, NULL, 0); - return 0; -} diff --git a/config/define-if.sh b/config/define-if.sh new file mode 100755 index 0000000..059c1ac --- /dev/null +++ b/config/define-if.sh @@ -0,0 +1,20 @@ +#!/bin/sh + +# Copyright © Tavian Barnes +# SPDX-License-Identifier: 0BSD + +# Output a C preprocessor definition based on whether a command succeeds + +set -eu + +SLUG="${1#config/}" +SLUG="${SLUG%.c}" +MACRO="BFS_$(printf '%s' "$SLUG" | tr '/a-z-' '_A-Z_')" +shift + +if "$@"; then + printf '#define %s true\n' "$MACRO" +else + printf '#define %s false\n' "$MACRO" + exit 1 +fi diff --git a/config/extattr-get-file.c b/config/extattr-get-file.c deleted file mode 100644 index ac9cf96..0000000 --- a/config/extattr-get-file.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - return extattr_get_file("file", EXTATTR_NAMESPACE_USER, "xattr", NULL, 0); -} diff --git a/config/extattr-get-link.c b/config/extattr-get-link.c deleted file mode 100644 index c35be5b..0000000 --- a/config/extattr-get-link.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - return extattr_get_link("link", EXTATTR_NAMESPACE_USER, "xattr", NULL, 0); -} diff --git a/config/extattr-list-file.c b/config/extattr-list-file.c deleted file mode 100644 index e68a8bb..0000000 --- a/config/extattr-list-file.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - return extattr_list_file("file", EXTATTR_NAMESPACE_USER, NULL, 0); -} diff --git a/config/extattr-list-link.c b/config/extattr-list-link.c deleted file mode 100644 index 49f0ec2..0000000 --- a/config/extattr-list-link.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - return extattr_list_link("link", EXTATTR_NAMESPACE_USER, NULL, 0); -} diff --git a/config/fdclosedir.c b/config/fdclosedir.c deleted file mode 100644 index f4ad1f5..0000000 --- a/config/fdclosedir.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - return fdclosedir(opendir(".")); -} diff --git a/config/getdents.c b/config/getdents.c deleted file mode 100644 index d0d4228..0000000 --- a/config/getdents.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct dirent de; - getdents(3, &de, 1024); - return 0; -} diff --git a/config/getdents64-syscall.c b/config/getdents64-syscall.c deleted file mode 100644 index 4838c14..0000000 --- a/config/getdents64-syscall.c +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - struct dirent64 de; - syscall(SYS_getdents64, 3, &de, 1024); - return 0; -} diff --git a/config/getdents64.c b/config/getdents64.c deleted file mode 100644 index 1abf36d..0000000 --- a/config/getdents64.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct dirent64 de; - getdents64(3, &de, 1024); - return 0; -} diff --git a/config/getprogname-gnu.c b/config/getprogname-gnu.c deleted file mode 100644 index 6b97c5e..0000000 --- a/config/getprogname-gnu.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - const char *str = program_invocation_short_name; - return str[0]; -} diff --git a/config/getprogname.c b/config/getprogname.c deleted file mode 100644 index 83dc8e8..0000000 --- a/config/getprogname.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - const char *str = getprogname(); - return str[0]; -} diff --git a/config/has/acl-get-entry.c b/config/has/acl-get-entry.c new file mode 100644 index 0000000..3cce771 --- /dev/null +++ b/config/has/acl-get-entry.c @@ -0,0 +1,8 @@ +#include +#include + +int main(void) { + acl_t acl = acl_get_file(".", ACL_TYPE_DEFAULT); + acl_entry_t entry; + return acl_get_entry(acl, ACL_FIRST_ENTRY, &entry); +} diff --git a/config/has/acl-get-file.c b/config/has/acl-get-file.c new file mode 100644 index 0000000..89fbf23 --- /dev/null +++ b/config/has/acl-get-file.c @@ -0,0 +1,8 @@ +#include +#include +#include + +int main(void) { + acl_t acl = acl_get_file(".", ACL_TYPE_DEFAULT); + return acl == (acl_t)NULL; +} diff --git a/config/has/acl-get-tag-type.c b/config/has/acl-get-tag-type.c new file mode 100644 index 0000000..2901956 --- /dev/null +++ b/config/has/acl-get-tag-type.c @@ -0,0 +1,10 @@ +#include +#include +#include + +int main(void) { + acl_entry_t entry; + memset(&entry, 0, sizeof(entry)); + acl_tag_t tag; + return acl_get_tag_type(entry, &tag); +} diff --git a/config/has/acl-is-trivial-np.c b/config/has/acl-is-trivial-np.c new file mode 100644 index 0000000..9ca9fc7 --- /dev/null +++ b/config/has/acl-is-trivial-np.c @@ -0,0 +1,12 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include + +int main(void) { + acl_t acl = acl_get_fd(3); + int trivial; + acl_is_trivial_np(acl, &trivial); + return 0; +} diff --git a/config/has/acl-trivial.c b/config/has/acl-trivial.c new file mode 100644 index 0000000..7efc838 --- /dev/null +++ b/config/has/acl-trivial.c @@ -0,0 +1,8 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + return acl_trivial("."); +} diff --git a/config/has/aligned-alloc.c b/config/has/aligned-alloc.c new file mode 100644 index 0000000..4460038 --- /dev/null +++ b/config/has/aligned-alloc.c @@ -0,0 +1,8 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + return !aligned_alloc(_Alignof(void *), sizeof(void *)); +} diff --git a/config/has/confstr.c b/config/has/confstr.c new file mode 100644 index 0000000..58280b4 --- /dev/null +++ b/config/has/confstr.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + confstr(_CS_PATH, NULL, 0); + return 0; +} diff --git a/config/has/extattr-get-file.c b/config/has/extattr-get-file.c new file mode 100644 index 0000000..ac9cf96 --- /dev/null +++ b/config/has/extattr-get-file.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + return extattr_get_file("file", EXTATTR_NAMESPACE_USER, "xattr", NULL, 0); +} diff --git a/config/has/extattr-get-link.c b/config/has/extattr-get-link.c new file mode 100644 index 0000000..c35be5b --- /dev/null +++ b/config/has/extattr-get-link.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + return extattr_get_link("link", EXTATTR_NAMESPACE_USER, "xattr", NULL, 0); +} diff --git a/config/has/extattr-list-file.c b/config/has/extattr-list-file.c new file mode 100644 index 0000000..e68a8bb --- /dev/null +++ b/config/has/extattr-list-file.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + return extattr_list_file("file", EXTATTR_NAMESPACE_USER, NULL, 0); +} diff --git a/config/has/extattr-list-link.c b/config/has/extattr-list-link.c new file mode 100644 index 0000000..49f0ec2 --- /dev/null +++ b/config/has/extattr-list-link.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + return extattr_list_link("link", EXTATTR_NAMESPACE_USER, NULL, 0); +} diff --git a/config/has/fdclosedir.c b/config/has/fdclosedir.c new file mode 100644 index 0000000..f4ad1f5 --- /dev/null +++ b/config/has/fdclosedir.c @@ -0,0 +1,8 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + return fdclosedir(opendir(".")); +} diff --git a/config/has/getdents.c b/config/has/getdents.c new file mode 100644 index 0000000..d0d4228 --- /dev/null +++ b/config/has/getdents.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct dirent de; + getdents(3, &de, 1024); + return 0; +} diff --git a/config/has/getdents64-syscall.c b/config/has/getdents64-syscall.c new file mode 100644 index 0000000..4838c14 --- /dev/null +++ b/config/has/getdents64-syscall.c @@ -0,0 +1,12 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + struct dirent64 de; + syscall(SYS_getdents64, 3, &de, 1024); + return 0; +} diff --git a/config/has/getdents64.c b/config/has/getdents64.c new file mode 100644 index 0000000..1abf36d --- /dev/null +++ b/config/has/getdents64.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct dirent64 de; + getdents64(3, &de, 1024); + return 0; +} diff --git a/config/has/getprogname-gnu.c b/config/has/getprogname-gnu.c new file mode 100644 index 0000000..6b97c5e --- /dev/null +++ b/config/has/getprogname-gnu.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + const char *str = program_invocation_short_name; + return str[0]; +} diff --git a/config/has/getprogname.c b/config/has/getprogname.c new file mode 100644 index 0000000..83dc8e8 --- /dev/null +++ b/config/has/getprogname.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + const char *str = getprogname(); + return str[0]; +} diff --git a/config/has/max-align-t.c b/config/has/max-align-t.c new file mode 100644 index 0000000..96165ce --- /dev/null +++ b/config/has/max-align-t.c @@ -0,0 +1,8 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + return _Alignof(max_align_t); +} diff --git a/config/has/pipe2.c b/config/has/pipe2.c new file mode 100644 index 0000000..4cb43b5 --- /dev/null +++ b/config/has/pipe2.c @@ -0,0 +1,10 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include + +int main(void) { + int fds[2]; + return pipe2(fds, O_CLOEXEC); +} diff --git a/config/has/posix-spawn-addfchdir-np.c b/config/has/posix-spawn-addfchdir-np.c new file mode 100644 index 0000000..b870a53 --- /dev/null +++ b/config/has/posix-spawn-addfchdir-np.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + posix_spawn_file_actions_t actions; + posix_spawn_file_actions_init(&actions); + posix_spawn_file_actions_addfchdir_np(&actions, 3); + return 0; +} diff --git a/config/has/posix-spawn-addfchdir.c b/config/has/posix-spawn-addfchdir.c new file mode 100644 index 0000000..c52ff81 --- /dev/null +++ b/config/has/posix-spawn-addfchdir.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + posix_spawn_file_actions_t actions; + posix_spawn_file_actions_init(&actions); + posix_spawn_file_actions_addfchdir(&actions, 3); + return 0; +} diff --git a/config/has/st-acmtim.c b/config/has/st-acmtim.c new file mode 100644 index 0000000..d687ab0 --- /dev/null +++ b/config/has/st-acmtim.c @@ -0,0 +1,12 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct stat sb = {0}; + unsigned int a = sb.st_atim.tv_sec; + unsigned int c = sb.st_ctim.tv_sec; + unsigned int m = sb.st_mtim.tv_sec; + return a + c + m; +} diff --git a/config/has/st-acmtimespec.c b/config/has/st-acmtimespec.c new file mode 100644 index 0000000..f747bc0 --- /dev/null +++ b/config/has/st-acmtimespec.c @@ -0,0 +1,12 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct stat sb = {0}; + unsigned int a = sb.st_atimespec.tv_sec; + unsigned int c = sb.st_ctimespec.tv_sec; + unsigned int m = sb.st_mtimespec.tv_sec; + return a + c + m; +} diff --git a/config/has/st-birthtim.c b/config/has/st-birthtim.c new file mode 100644 index 0000000..4964571 --- /dev/null +++ b/config/has/st-birthtim.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct stat sb = {0}; + return sb.st_birthtim.tv_sec; +} diff --git a/config/has/st-birthtimespec.c b/config/has/st-birthtimespec.c new file mode 100644 index 0000000..91a613f --- /dev/null +++ b/config/has/st-birthtimespec.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct stat sb = {0}; + return sb.st_birthtimespec.tv_sec; +} diff --git a/config/has/st-flags.c b/config/has/st-flags.c new file mode 100644 index 0000000..b1d0c32 --- /dev/null +++ b/config/has/st-flags.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct stat sb = {0}; + return sb.st_flags; +} diff --git a/config/has/statx-syscall.c b/config/has/statx-syscall.c new file mode 100644 index 0000000..87ec869 --- /dev/null +++ b/config/has/statx-syscall.c @@ -0,0 +1,13 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include +#include + +int main(void) { + struct statx sb; + syscall(SYS_statx, AT_FDCWD, ".", 0, STATX_BASIC_STATS, &sb); + return 0; +} diff --git a/config/has/statx.c b/config/has/statx.c new file mode 100644 index 0000000..65f1674 --- /dev/null +++ b/config/has/statx.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include + +int main(void) { + struct statx sb; + statx(AT_FDCWD, ".", 0, STATX_BASIC_STATS, &sb); + return 0; +} diff --git a/config/has/strerror-l.c b/config/has/strerror-l.c new file mode 100644 index 0000000..3dcc4d7 --- /dev/null +++ b/config/has/strerror-l.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include +#include + +int main(void) { + locale_t locale = duplocale(LC_GLOBAL_LOCALE); + return !strerror_l(ENOMEM, locale); +} diff --git a/config/has/strerror-r-gnu.c b/config/has/strerror-r-gnu.c new file mode 100644 index 0000000..26ca0ee --- /dev/null +++ b/config/has/strerror-r-gnu.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include + +int main(void) { + char buf[256]; + // Check that strerror_r() returns a pointer + return *strerror_r(ENOMEM, buf, sizeof(buf)); +} diff --git a/config/has/strerror-r-posix.c b/config/has/strerror-r-posix.c new file mode 100644 index 0000000..41b2d30 --- /dev/null +++ b/config/has/strerror-r-posix.c @@ -0,0 +1,11 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include +#include + +int main(void) { + char buf[256]; + // Check that strerror_r() returns an integer + return 2 * strerror_r(ENOMEM, buf, sizeof(buf)); +} diff --git a/config/has/tm-gmtoff.c b/config/has/tm-gmtoff.c new file mode 100644 index 0000000..543df48 --- /dev/null +++ b/config/has/tm-gmtoff.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + struct tm tm = {0}; + return tm.tm_gmtoff; +} diff --git a/config/has/uselocale.c b/config/has/uselocale.c new file mode 100644 index 0000000..a712ff8 --- /dev/null +++ b/config/has/uselocale.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + locale_t locale = uselocale((locale_t)0); + return locale == LC_GLOBAL_LOCALE; +} diff --git a/config/header.mk b/config/header.mk index ccc36d3..50ad5e8 100644 --- a/config/header.mk +++ b/config/header.mk @@ -9,62 +9,61 @@ include config/exports.mk # All header fragments we generate HEADERS := \ - ${GEN}/acl-get-entry.h \ - ${GEN}/acl-get-file.h \ - ${GEN}/acl-get-tag-type.h \ - ${GEN}/acl-is-trivial-np.h \ - ${GEN}/acl-trivial.h \ - ${GEN}/aligned-alloc.h \ - ${GEN}/confstr.h \ - ${GEN}/extattr-get-file.h \ - ${GEN}/extattr-get-link.h \ - ${GEN}/extattr-list-file.h \ - ${GEN}/extattr-list-link.h \ - ${GEN}/fdclosedir.h \ - ${GEN}/getdents.h \ - ${GEN}/getdents64.h \ - ${GEN}/getdents64-syscall.h \ - ${GEN}/getprogname.h \ - ${GEN}/getprogname-gnu.h \ - ${GEN}/max-align-t.h \ - ${GEN}/pipe2.h \ - ${GEN}/posix-spawn-addfchdir.h \ - ${GEN}/posix-spawn-addfchdir-np.h \ - ${GEN}/st-acmtim.h \ - ${GEN}/st-acmtimespec.h \ - ${GEN}/st-birthtim.h \ - ${GEN}/st-birthtimespec.h \ - ${GEN}/st-flags.h \ - ${GEN}/statx.h \ - ${GEN}/statx-syscall.h \ - ${GEN}/strerror-l.h \ - ${GEN}/strerror-r-gnu.h \ - ${GEN}/strerror-r-posix.h \ - ${GEN}/tm-gmtoff.h \ - ${GEN}/uselocale.h + ${GEN}/has/acl-get-entry.h \ + ${GEN}/has/acl-get-file.h \ + ${GEN}/has/acl-get-tag-type.h \ + ${GEN}/has/acl-is-trivial-np.h \ + ${GEN}/has/acl-trivial.h \ + ${GEN}/has/aligned-alloc.h \ + ${GEN}/has/confstr.h \ + ${GEN}/has/extattr-get-file.h \ + ${GEN}/has/extattr-get-link.h \ + ${GEN}/has/extattr-list-file.h \ + ${GEN}/has/extattr-list-link.h \ + ${GEN}/has/fdclosedir.h \ + ${GEN}/has/getdents.h \ + ${GEN}/has/getdents64.h \ + ${GEN}/has/getdents64-syscall.h \ + ${GEN}/has/getprogname.h \ + ${GEN}/has/getprogname-gnu.h \ + ${GEN}/has/max-align-t.h \ + ${GEN}/has/pipe2.h \ + ${GEN}/has/posix-spawn-addfchdir.h \ + ${GEN}/has/posix-spawn-addfchdir-np.h \ + ${GEN}/has/st-acmtim.h \ + ${GEN}/has/st-acmtimespec.h \ + ${GEN}/has/st-birthtim.h \ + ${GEN}/has/st-birthtimespec.h \ + ${GEN}/has/st-flags.h \ + ${GEN}/has/statx.h \ + ${GEN}/has/statx-syscall.h \ + ${GEN}/has/strerror-l.h \ + ${GEN}/has/strerror-r-gnu.h \ + ${GEN}/has/strerror-r-posix.h \ + ${GEN}/has/tm-gmtoff.h \ + ${GEN}/has/uselocale.h -${GEN}/config.h: ${HEADERS} +# Previously generated by pkgs.mk +PKG_HEADERS := ${ALL_PKGS:%=${GEN}/use/%.h} + +${GEN}/config.h: ${PKG_HEADERS} ${HEADERS} ${MSG} "[ GEN] ${TGT}" printf '// %s\n' "${TGT}" >$@ printf '#ifndef BFS_CONFIG_H\n' >>$@ printf '#define BFS_CONFIG_H\n' >>$@ - printf '#define BFS_USE_%s true\n' $$(printf '%s\n' ${PKGS} | tr 'a-z-' 'A-Z_') >>$@ cat ${.ALLSRC} >>$@ printf '#endif // BFS_CONFIG_H\n' >>$@ cat ${.ALLSRC:%=%.log} >$@.log - ${RM} ${.ALLSRC} ${.ALLSRC:%=%.log} ${VCAT} $@ .PHONY: ${GEN}/config.h -# The C source file to attempt to compile -CSRC = ${@:${GEN}/%.h=config/%.c} +# The short name of the config test +SLUG = ${@:${GEN}/%.h=%} ${HEADERS}:: - config/cc-define.sh ${CSRC} >$@ 2>$@.log - if ! [ "${IS_V}" ]; then \ - if grep -q 'true$$' $@; then \ - printf '[ CC ] %-${MSG_WIDTH}s ✔\n' ${CSRC}; \ - else \ - printf '[ CC ] %-${MSG_WIDTH}s ✘\n' ${CSRC}; \ - fi; \ + ${MKDIR} ${@D} + if config/define-if.sh ${SLUG} config/cc.sh config/${SLUG}.c >$@ 2>$@.log; then \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' ${SLUG}.c; \ + else \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' ${SLUG}.c; \ fi diff --git a/config/libacl.c b/config/libacl.c deleted file mode 100644 index de1fe50..0000000 --- a/config/libacl.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - acl_free(0); - return 0; -} diff --git a/config/libcap.c b/config/libcap.c deleted file mode 100644 index 58e832c..0000000 --- a/config/libcap.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - cap_free(0); - return 0; -} diff --git a/config/libselinux.c b/config/libselinux.c deleted file mode 100644 index bca409d..0000000 --- a/config/libselinux.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - freecon(0); - return 0; -} diff --git a/config/liburing.c b/config/liburing.c deleted file mode 100644 index bea499a..0000000 --- a/config/liburing.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - io_uring_free_probe(0); - return 0; -} diff --git a/config/max-align-t.c b/config/max-align-t.c deleted file mode 100644 index 96165ce..0000000 --- a/config/max-align-t.c +++ /dev/null @@ -1,8 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - return _Alignof(max_align_t); -} diff --git a/config/oniguruma.c b/config/oniguruma.c deleted file mode 100644 index cb17596..0000000 --- a/config/oniguruma.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - onig_free(0); - return 0; -} diff --git a/config/pipe2.c b/config/pipe2.c deleted file mode 100644 index 4cb43b5..0000000 --- a/config/pipe2.c +++ /dev/null @@ -1,10 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include - -int main(void) { - int fds[2]; - return pipe2(fds, O_CLOEXEC); -} diff --git a/config/pkgconf.sh b/config/pkgconf.sh index 2fb2f1e..365ed61 100755 --- a/config/pkgconf.sh +++ b/config/pkgconf.sh @@ -41,7 +41,7 @@ if [ -z "$MODE" ]; then CFLAGS=$("$0" --cflags "$LIB") || exit 1 LDFLAGS=$("$0" --ldflags "$LIB") || exit 1 LDLIBS=$("$0" --ldlibs "$LIB") || exit 1 - config/cc.sh $CFLAGS $LDFLAGS config/$LIB.c $LDLIBS || exit 1 + config/cc.sh $CFLAGS $LDFLAGS config/use/$LIB.c $LDLIBS || exit 1 done fi diff --git a/config/pkgs.mk b/config/pkgs.mk index 2c100ab..898f262 100644 --- a/config/pkgs.mk +++ b/config/pkgs.mk @@ -8,15 +8,9 @@ include ${GEN}/vars.mk include ${GEN}/flags.mk include config/exports.mk -# External dependencies -USE_PKGS := \ - ${GEN}/libacl.use \ - ${GEN}/libcap.use \ - ${GEN}/libselinux.use \ - ${GEN}/liburing.use \ - ${GEN}/oniguruma.use +HEADERS := ${ALL_PKGS:%=${GEN}/use/%.h} -${GEN}/pkgs.mk: ${USE_PKGS} +${GEN}/pkgs.mk: ${HEADERS} ${MSG} "[ GEN] ${TGT}" printf '# %s\n' "${TGT}" >$@ gen() { \ @@ -25,18 +19,18 @@ ${GEN}/pkgs.mk: ${USE_PKGS} printf 'LDFLAGS += %s\n' "$$(config/pkgconf.sh --ldflags "$$@")"; \ printf 'LDLIBS := %s $${LDLIBS}\n' "$$(config/pkgconf.sh --ldlibs "$$@")"; \ }; \ - gen $$(cat ${.ALLSRC}) >>$@ + gen $$(grep -l ' true$$' ${.ALLSRC} | sed 's|.*/\(.*\)\.h|\1|') >>$@ ${VCAT} $@ + .PHONY: ${GEN}/pkgs.mk -# Convert ${GEN}/foo.use to foo -PKG = ${@:${GEN}/%.use=%} +# Convert ${GEN}/use/foo.h to foo +PKG = ${@:${GEN}/use/%.h=%} -${USE_PKGS}:: - if config/pkgconf.sh ${PKG} 2>$@.log; then \ - printf '%s\n' ${PKG} >$@; \ - test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' config/${PKG}.c; \ +${HEADERS}:: + ${MKDIR} ${@D} + if config/define-if.sh use/${PKG} config/pkgconf.sh ${PKG} >$@ 2>$@.log; then \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✔\n' use/${PKG}.c; \ else \ - : >$@; \ - test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' config/${PKG}.c; \ + test "${IS_V}" || printf '[ CC ] %-${MSG_WIDTH}s ✘\n' use/${PKG}.c; \ fi diff --git a/config/posix-spawn-addfchdir-np.c b/config/posix-spawn-addfchdir-np.c deleted file mode 100644 index b870a53..0000000 --- a/config/posix-spawn-addfchdir-np.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - posix_spawn_file_actions_t actions; - posix_spawn_file_actions_init(&actions); - posix_spawn_file_actions_addfchdir_np(&actions, 3); - return 0; -} diff --git a/config/posix-spawn-addfchdir.c b/config/posix-spawn-addfchdir.c deleted file mode 100644 index c52ff81..0000000 --- a/config/posix-spawn-addfchdir.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - posix_spawn_file_actions_t actions; - posix_spawn_file_actions_init(&actions); - posix_spawn_file_actions_addfchdir(&actions, 3); - return 0; -} diff --git a/config/prelude.mk b/config/prelude.mk index e1e7a4d..6b0b649 100644 --- a/config/prelude.mk +++ b/config/prelude.mk @@ -110,13 +110,21 @@ MSG = @msg() { \ msg # Maximum width of a short message, to align the ✔/✘ -MSG_WIDTH := 33 +MSG_WIDTH := 30 # cat a file if V=1 VCAT,y := @cat VCAT, := @: VCAT := ${VCAT,${IS_V}} +# All external dependencies +ALL_PKGS := \ + libacl \ + libcap \ + libselinux \ + liburing \ + oniguruma + # List all object files here, as they're needed by both `make config` and `make` # All object files except the entry point diff --git a/config/st-acmtim.c b/config/st-acmtim.c deleted file mode 100644 index d687ab0..0000000 --- a/config/st-acmtim.c +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct stat sb = {0}; - unsigned int a = sb.st_atim.tv_sec; - unsigned int c = sb.st_ctim.tv_sec; - unsigned int m = sb.st_mtim.tv_sec; - return a + c + m; -} diff --git a/config/st-acmtimespec.c b/config/st-acmtimespec.c deleted file mode 100644 index f747bc0..0000000 --- a/config/st-acmtimespec.c +++ /dev/null @@ -1,12 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct stat sb = {0}; - unsigned int a = sb.st_atimespec.tv_sec; - unsigned int c = sb.st_ctimespec.tv_sec; - unsigned int m = sb.st_mtimespec.tv_sec; - return a + c + m; -} diff --git a/config/st-birthtim.c b/config/st-birthtim.c deleted file mode 100644 index 4964571..0000000 --- a/config/st-birthtim.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct stat sb = {0}; - return sb.st_birthtim.tv_sec; -} diff --git a/config/st-birthtimespec.c b/config/st-birthtimespec.c deleted file mode 100644 index 91a613f..0000000 --- a/config/st-birthtimespec.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct stat sb = {0}; - return sb.st_birthtimespec.tv_sec; -} diff --git a/config/st-flags.c b/config/st-flags.c deleted file mode 100644 index b1d0c32..0000000 --- a/config/st-flags.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct stat sb = {0}; - return sb.st_flags; -} diff --git a/config/statx-syscall.c b/config/statx-syscall.c deleted file mode 100644 index 87ec869..0000000 --- a/config/statx-syscall.c +++ /dev/null @@ -1,13 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include -#include - -int main(void) { - struct statx sb; - syscall(SYS_statx, AT_FDCWD, ".", 0, STATX_BASIC_STATS, &sb); - return 0; -} diff --git a/config/statx.c b/config/statx.c deleted file mode 100644 index 65f1674..0000000 --- a/config/statx.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include - -int main(void) { - struct statx sb; - statx(AT_FDCWD, ".", 0, STATX_BASIC_STATS, &sb); - return 0; -} diff --git a/config/strerror-l.c b/config/strerror-l.c deleted file mode 100644 index 3dcc4d7..0000000 --- a/config/strerror-l.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include -#include - -int main(void) { - locale_t locale = duplocale(LC_GLOBAL_LOCALE); - return !strerror_l(ENOMEM, locale); -} diff --git a/config/strerror-r-gnu.c b/config/strerror-r-gnu.c deleted file mode 100644 index 26ca0ee..0000000 --- a/config/strerror-r-gnu.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include - -int main(void) { - char buf[256]; - // Check that strerror_r() returns a pointer - return *strerror_r(ENOMEM, buf, sizeof(buf)); -} diff --git a/config/strerror-r-posix.c b/config/strerror-r-posix.c deleted file mode 100644 index 41b2d30..0000000 --- a/config/strerror-r-posix.c +++ /dev/null @@ -1,11 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include -#include - -int main(void) { - char buf[256]; - // Check that strerror_r() returns an integer - return 2 * strerror_r(ENOMEM, buf, sizeof(buf)); -} diff --git a/config/tm-gmtoff.c b/config/tm-gmtoff.c deleted file mode 100644 index 543df48..0000000 --- a/config/tm-gmtoff.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - struct tm tm = {0}; - return tm.tm_gmtoff; -} diff --git a/config/use/libacl.c b/config/use/libacl.c new file mode 100644 index 0000000..de1fe50 --- /dev/null +++ b/config/use/libacl.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + acl_free(0); + return 0; +} diff --git a/config/use/libcap.c b/config/use/libcap.c new file mode 100644 index 0000000..58e832c --- /dev/null +++ b/config/use/libcap.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + cap_free(0); + return 0; +} diff --git a/config/use/libselinux.c b/config/use/libselinux.c new file mode 100644 index 0000000..bca409d --- /dev/null +++ b/config/use/libselinux.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + freecon(0); + return 0; +} diff --git a/config/use/liburing.c b/config/use/liburing.c new file mode 100644 index 0000000..bea499a --- /dev/null +++ b/config/use/liburing.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + io_uring_free_probe(0); + return 0; +} diff --git a/config/use/oniguruma.c b/config/use/oniguruma.c new file mode 100644 index 0000000..cb17596 --- /dev/null +++ b/config/use/oniguruma.c @@ -0,0 +1,9 @@ +// Copyright © Tavian Barnes +// SPDX-License-Identifier: 0BSD + +#include + +int main(void) { + onig_free(0); + return 0; +} diff --git a/config/uselocale.c b/config/uselocale.c deleted file mode 100644 index a712ff8..0000000 --- a/config/uselocale.c +++ /dev/null @@ -1,9 +0,0 @@ -// Copyright © Tavian Barnes -// SPDX-License-Identifier: 0BSD - -#include - -int main(void) { - locale_t locale = uselocale((locale_t)0); - return locale == LC_GLOBAL_LOCALE; -} -- cgit v1.2.3