]> gcc.gnu.org Git - gcc.git/commitdiff
libphobos: Fix static asserts on NetBSD, FreeBSD, DragonFlyBSD
authorIain Buclaw <ibuclaw@gdcproject.org>
Thu, 13 May 2021 17:09:48 +0000 (19:09 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 13 May 2021 17:24:56 +0000 (19:24 +0200)
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)

libphobos/libdruntime/core/sys/dragonflybsd/dlfcn.d
libphobos/libdruntime/core/sys/freebsd/dlfcn.d
libphobos/libdruntime/core/sys/netbsd/dlfcn.d
libphobos/libdruntime/core/sys/posix/dlfcn.d

index 1d3812fc55bedad4953fb0ceffed085d4b3d3548..2c5d8d79c22bf8d279ab909ecfc3c2d04c242520 100644 (file)
@@ -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*);
index fad91418e6d701587f5844a2fa653d09acd27696..7baacfeeb7bcc7631161916b8cd56a4d8752806e 100644 (file)
@@ -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)
index dbbcc7638fdbcd53859f17712b4eac21ae654b5b..468ffbfe435e4a45b987ca3325a69be14d62cf88 100644 (file)
@@ -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)
 {
index 2477e26dc53df080d4a9e9129cd6eafb3951b40b..f6476ec31060c9be3883930e2bb38d051c90ce44 100644 (file)
@@ -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
This page took 0.072411 seconds and 5 git commands to generate.