public inbox for gcc-cvs@sourceware.org help / color / mirror / Atom feed
From: Iain Buclaw <ibuclaw@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org Subject: [gcc r11-8411] libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD Date: Thu, 13 May 2021 17:25:15 +0000 (GMT) [thread overview] Message-ID: <20210513172515.14D8B3854821@sourceware.org> (raw) https://gcc.gnu.org/g:e218c2985d21dbdf747f39aa478cf696f85f226b commit r11-8411-ge218c2985d21dbdf747f39aa478cf696f85f226b Author: Iain Buclaw <ibuclaw@gdcproject.org> Date: Thu May 13 19:09:48 2021 +0200 libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD The function declarations were updated to use `const scope', but the static asserts were not. libphobos/ChangeLog: * libdruntime/core/sys/dragonflybsd/dlfcn.d: Update static assert. * libdruntime/core/sys/freebsd/dlfcn.d: Likewise. * libdruntime/core/sys/netbsd/dlfcn.d: Likewise. * libdruntime/core/sys/posix/dlfcn.d: Replace 'in' with 'const scope'. (cherry picked from commit 7677b501341d84e9889ddf0f3834b5d1ad2922f9) Diff: --- libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d | 15 ++++++--------- libphobos/libdruntime/core/sys/freebsd/dlfcn.d | 4 ++-- libphobos/libdruntime/core/sys/netbsd/dlfcn.d | 15 ++++++--------- libphobos/libdruntime/core/sys/posix/dlfcn.d | 4 ++-- 4 files changed, 16 insertions(+), 22 deletions(-) diff --git a/libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d b/libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d index 1d3812fc55b..2c5d8d79c22 100644 --- a/libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d +++ b/libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d @@ -82,16 +82,13 @@ struct __dlfunc_arg { alias dlfunc_t = void function(__dlfunc_arg); -private template __externC(RT, P...) -{ - alias __externC = extern(C) RT function(P) nothrow @nogc @system; -} - /* XSI functions first. */ -static assert(is(typeof(&dlclose) == __externC!(int, void*))); -static assert(is(typeof(&dlerror) == __externC!(char*))); -static assert(is(typeof(&dlopen) == __externC!(void*, const char*, int))); -static assert(is(typeof(&dlsym) == __externC!(void*, void*, const char*))); +extern(C) { + static assert(is(typeof(&dlclose) == int function(void*))); + static assert(is(typeof(&dlerror) == char* function())); + static assert(is(typeof(&dlopen) == void* function(const scope char*, int))); + static assert(is(typeof(&dlsym) == void* function(void*, const scope char*))); +} void* fdlopen(int, int); int dladdr(const(void)*, Dl_info*); diff --git a/libphobos/libdruntime/core/sys/freebsd/dlfcn.d b/libphobos/libdruntime/core/sys/freebsd/dlfcn.d index fad91418e6d..7baacfeeb7b 100644 --- a/libphobos/libdruntime/core/sys/freebsd/dlfcn.d +++ b/libphobos/libdruntime/core/sys/freebsd/dlfcn.d @@ -90,8 +90,8 @@ static if (__BSD_VISIBLE) extern(C) { static assert(is(typeof(&dlclose) == int function(void*))); static assert(is(typeof(&dlerror) == char* function())); - static assert(is(typeof(&dlopen) == void* function(in char*, int))); - static assert(is(typeof(&dlsym) == void* function(void*, in char*))); + static assert(is(typeof(&dlopen) == void* function(const scope char*, int))); + static assert(is(typeof(&dlsym) == void* function(void*, const scope char*))); } static if (__BSD_VISIBLE) diff --git a/libphobos/libdruntime/core/sys/netbsd/dlfcn.d b/libphobos/libdruntime/core/sys/netbsd/dlfcn.d index dbbcc7638fd..468ffbfe435 100644 --- a/libphobos/libdruntime/core/sys/netbsd/dlfcn.d +++ b/libphobos/libdruntime/core/sys/netbsd/dlfcn.d @@ -87,16 +87,13 @@ static if (__BSD_VISIBLE) } } -private template __externC(RT, P...) -{ - alias __externC = extern(C) RT function(P) nothrow @nogc; -} - /* XSI functions first. */ -static assert(is(typeof(&dlclose) == __externC!(int, void*))); -static assert(is(typeof(&dlerror) == __externC!(char*))); -static assert(is(typeof(&dlopen) == __externC!(void*, const char*, int))); -static assert(is(typeof(&dlsym) == __externC!(void*, void*, const char*))); +extern(C) { + static assert(is(typeof(&dlclose) == int function(void*))); + static assert(is(typeof(&dlerror) == char* function())); + static assert(is(typeof(&dlopen) == void* function(const scope char*, int))); + static assert(is(typeof(&dlsym) == void* function(void*, const scope char*))); +} static if (__BSD_VISIBLE) { diff --git a/libphobos/libdruntime/core/sys/posix/dlfcn.d b/libphobos/libdruntime/core/sys/posix/dlfcn.d index 2477e26dc53..f6476ec3106 100644 --- a/libphobos/libdruntime/core/sys/posix/dlfcn.d +++ b/libphobos/libdruntime/core/sys/posix/dlfcn.d @@ -158,8 +158,8 @@ else version (FreeBSD) int dlclose(void*); char* dlerror(); - void* dlopen(in char*, int); - void* dlsym(void*, in char*); + void* dlopen(const scope char*, int); + void* dlsym(void*, const scope char*); int dladdr(const(void)* addr, Dl_info* info); struct Dl_info
reply other threads:[~2021-05-13 17:25 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=20210513172515.14D8B3854821@sourceware.org \ --to=ibuclaw@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox; as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).