Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit bc50b14

Browse files
authored
Merge pull request #2778 from ErnyTech/master
Fix Issue 16380 - no bindings for err.h merged-on-behalf-of: Nathan Sashihara <n8sh@users.noreply.github.com>
2 parents f07859b + 4dc5d92 commit bc50b14

File tree

11 files changed

+266
-0
lines changed

11 files changed

+266
-0
lines changed

mak/COPY

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,12 @@ COPY=\
8888
\
8989
$(IMPDIR)\core\sync\event.d \
9090
\
91+
$(IMPDIR)\core\sys\bionic\err.d \
9192
$(IMPDIR)\core\sys\bionic\string.d \
9293
\
9394
$(IMPDIR)\core\sys\darwin\crt_externs.d \
9495
$(IMPDIR)\core\sys\darwin\dlfcn.d \
96+
$(IMPDIR)\core\sys\darwin\err.d \
9597
$(IMPDIR)\core\sys\darwin\execinfo.d \
9698
$(IMPDIR)\core\sys\darwin\pthread.d \
9799
$(IMPDIR)\core\sys\darwin\string.d \
@@ -111,6 +113,7 @@ COPY=\
111113
$(IMPDIR)\core\sys\darwin\sys\mman.d \
112114
\
113115
$(IMPDIR)\core\sys\freebsd\dlfcn.d \
116+
$(IMPDIR)\core\sys\freebsd\err.d \
114117
$(IMPDIR)\core\sys\freebsd\execinfo.d \
115118
\
116119
$(IMPDIR)\core\sys\freebsd\netinet\in_.d \
@@ -132,6 +135,7 @@ COPY=\
132135
$(IMPDIR)\core\sys\freebsd\unistd.d \
133136
\
134137
$(IMPDIR)\core\sys\dragonflybsd\dlfcn.d \
138+
$(IMPDIR)\core\sys\dragonflybsd\err.d \
135139
$(IMPDIR)\core\sys\dragonflybsd\execinfo.d \
136140
\
137141
$(IMPDIR)\core\sys\dragonflybsd\netinet\in_.d \
@@ -154,6 +158,7 @@ COPY=\
154158
$(IMPDIR)\core\sys\linux\dlfcn.d \
155159
$(IMPDIR)\core\sys\linux\elf.d \
156160
$(IMPDIR)\core\sys\linux\epoll.d \
161+
$(IMPDIR)\core\sys\linux\err.d \
157162
$(IMPDIR)\core\sys\linux\errno.d \
158163
$(IMPDIR)\core\sys\linux\execinfo.d \
159164
$(IMPDIR)\core\sys\linux\fcntl.d \
@@ -182,10 +187,12 @@ COPY=\
182187
$(IMPDIR)\core\sys\linux\sys\time.d \
183188
$(IMPDIR)\core\sys\linux\sys\prctl.d \
184189
\
190+
$(IMPDIR)\core\sys\netbsd\err.d \
185191
$(IMPDIR)\core\sys\netbsd\sys\featuretest.d \
186192
$(IMPDIR)\core\sys\netbsd\string.d \
187193
\
188194
$(IMPDIR)\core\sys\openbsd\dlfcn.d \
195+
$(IMPDIR)\core\sys\openbsd\err.d \
189196
$(IMPDIR)\core\sys\openbsd\string.d \
190197
\
191198
$(IMPDIR)\core\sys\posix\arpa\inet.d \
@@ -242,6 +249,7 @@ COPY=\
242249
\
243250
$(IMPDIR)\core\sys\solaris\dlfcn.d \
244251
$(IMPDIR)\core\sys\solaris\elf.d \
252+
$(IMPDIR)\core\sys\solaris\err.d \
245253
$(IMPDIR)\core\sys\solaris\execinfo.d \
246254
$(IMPDIR)\core\sys\solaris\libelf.d \
247255
$(IMPDIR)\core\sys\solaris\link.d \

mak/SRCS

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,10 +92,12 @@ SRCS=\
9292
src\core\sync\rwmutex.d \
9393
src\core\sync\semaphore.d \
9494
\
95+
src\core\sys\bionic\err.d \
9596
src\core\sys\bionic\string.d \
9697
\
9798
src\core\sys\darwin\crt_externs.d \
9899
src\core\sys\darwin\dlfcn.d \
100+
src\core\sys\darwin\err.d \
99101
src\core\sys\darwin\execinfo.d \
100102
src\core\sys\darwin\pthread.d \
101103
src\core\sys\darwin\string.d \
@@ -113,6 +115,7 @@ SRCS=\
113115
src\core\sys\darwin\sys\mman.d \
114116
\
115117
src\core\sys\freebsd\dlfcn.d \
118+
src\core\sys\freebsd\err.d \
116119
src\core\sys\freebsd\execinfo.d \
117120
src\core\sys\freebsd\netinet\in_.d \
118121
src\core\sys\freebsd\pthread_np.d \
@@ -132,6 +135,7 @@ SRCS=\
132135
src\core\sys\freebsd\unistd.d \
133136
\
134137
src\core\sys\dragonflybsd\dlfcn.d \
138+
src\core\sys\dragonflybsd\err.d \
135139
src\core\sys\dragonflybsd\execinfo.d \
136140
src\core\sys\dragonflybsd\netinet\in_.d \
137141
src\core\sys\dragonflybsd\pthread_np.d \
@@ -152,6 +156,7 @@ SRCS=\
152156
src\core\sys\linux\dlfcn.d \
153157
src\core\sys\linux\elf.d \
154158
src\core\sys\linux\epoll.d \
159+
src\core\sys\linux\err.d \
155160
src\core\sys\linux\errno.d \
156161
src\core\sys\linux\execinfo.d \
157162
src\core\sys\linux\fcntl.d \
@@ -180,10 +185,12 @@ SRCS=\
180185
src\core\sys\linux\sys\time.d \
181186
src\core\sys\linux\sys\prctl.d \
182187
\
188+
src\core\sys\netbsd\err.d \
183189
src\core\sys\netbsd\sys\featuretest.d \
184190
src\core\sys\netbsd\string.d \
185191
\
186192
src\core\sys\openbsd\dlfcn.d \
193+
src\core\sys\openbsd\err.d \
187194
src\core\sys\openbsd\string.d \
188195
\
189196
src\core\sys\posix\arpa\inet.d \
@@ -240,6 +247,7 @@ SRCS=\
240247
\
241248
src\core\sys\solaris\dlfcn.d \
242249
src\core\sys\solaris\elf.d \
250+
src\core\sys\solaris\err.d \
243251
src\core\sys\solaris\execinfo.d \
244252
src\core\sys\solaris\libelf.d \
245253
src\core\sys\solaris\link.d \

mak/WINDOWS

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -300,6 +300,9 @@ $(IMPDIR)\core\stdcpp\vector.d : src\core\stdcpp\vector.d
300300
$(IMPDIR)\core\stdcpp\xutility.d : src\core\stdcpp\xutility.d
301301
copy $** $@
302302

303+
$(IMPDIR)\core\sys\bionic\err.d : src\core\sys\bionic\err.d
304+
copy $** $@
305+
303306
$(IMPDIR)\core\sys\bionic\string.d : src\core\sys\bionic\string.d
304307
copy $** $@
305308

@@ -309,6 +312,9 @@ $(IMPDIR)\core\sys\darwin\crt_externs.d : src\core\sys\darwin\crt_externs.d
309312
$(IMPDIR)\core\sys\darwin\dlfcn.d : src\core\sys\darwin\dlfcn.d
310313
copy $** $@
311314

315+
$(IMPDIR)\core\sys\darwin\err.d : src\core\sys\darwin\err.d
316+
copy $** $@
317+
312318
$(IMPDIR)\core\sys\darwin\execinfo.d : src\core\sys\darwin\execinfo.d
313319
copy $** $@
314320

@@ -354,6 +360,9 @@ $(IMPDIR)\core\sys\darwin\sys\mman.d : src\core\sys\darwin\sys\mman.d
354360
$(IMPDIR)\core\sys\freebsd\dlfcn.d : src\core\sys\freebsd\dlfcn.d
355361
copy $** $@
356362

363+
$(IMPDIR)\core\sys\freebsd\err.d : src\core\sys\freebsd\err.d
364+
copy $** $@
365+
357366
$(IMPDIR)\core\sys\freebsd\execinfo.d : src\core\sys\freebsd\execinfo.d
358367
copy $** $@
359368

@@ -408,6 +417,9 @@ $(IMPDIR)\core\sys\freebsd\unistd.d : src\core\sys\freebsd\unistd.d
408417
$(IMPDIR)\core\sys\dragonflybsd\dlfcn.d : src\core\sys\dragonflybsd\dlfcn.d
409418
copy $** $@
410419

420+
$(IMPDIR)\core\sys\dragonflybsd\err.d : src\core\sys\dragonflybsd\err.d
421+
copy $** $@
422+
411423
$(IMPDIR)\core\sys\dragonflybsd\execinfo.d : src\core\sys\dragonflybsd\execinfo.d
412424
copy $** $@
413425

@@ -465,6 +477,9 @@ $(IMPDIR)\core\sys\linux\elf.d : src\core\sys\linux\elf.d
465477
$(IMPDIR)\core\sys\linux\epoll.d : src\core\sys\linux\epoll.d
466478
copy $** $@
467479

480+
$(IMPDIR)\core\sys\linux\err.d : src\core\sys\linux\err.d
481+
copy $** $@
482+
468483
$(IMPDIR)\core\sys\linux\errno.d : src\core\sys\linux\errno.d
469484
copy $** $@
470485

@@ -540,6 +555,9 @@ $(IMPDIR)\core\sys\linux\sys\xattr.d : src\core\sys\linux\sys\xattr.d
540555
$(IMPDIR)\core\sys\linux\sys\time.d : src\core\sys\linux\sys\time.d
541556
copy $** $@
542557

558+
$(IMPDIR)\core\sys\netbsd\err.d : src\core\sys\netbsd\err.d
559+
copy $** $@
560+
543561
$(IMPDIR)\core\sys\netbsd\sys\featuretest.d : src\core\sys\netbsd\sys\featuretest.d
544562
copy $** $@
545563

@@ -549,6 +567,9 @@ $(IMPDIR)\core\sys\netbsd\string.d : src\core\sys\netbsd\string.d
549567
$(IMPDIR)\core\sys\openbsd\dlfcn.d : src\core\sys\openbsd\dlfcn.d
550568
copy $** $@
551569

570+
$(IMPDIR)\core\sys\openbsd\err.d : src\core\sys\openbsd\err.d
571+
copy $** $@
572+
552573
$(IMPDIR)\core\sys\openbsd\string.d : src\core\sys\openbsd\string.d
553574
copy $** $@
554575

@@ -702,6 +723,9 @@ $(IMPDIR)\core\sys\solaris\dlfcn.d : src\core\sys\solaris\dlfcn.d
702723
$(IMPDIR)\core\sys\solaris\elf.d : src\core\sys\solaris\elf.d
703724
copy $** $@
704725

726+
$(IMPDIR)\core\sys\solaris\err.d : src\core\sys\solaris\err.d
727+
copy $** $@
728+
705729
$(IMPDIR)\core\sys\solaris\execinfo.d : src\core\sys\solaris\execinfo.d
706730
copy $** $@
707731

src/core/sys/bionic/err.d

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* D header file for Bionic err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.bionic.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (CRuntime_Bionic):
12+
extern (C):
13+
nothrow:
14+
@nogc:
15+
16+
void err(int eval, scope const char* fmt, ...);
17+
void errx(int eval, scope const char* fmt, ...);
18+
void warn(scope const char* fmt, ...);
19+
void warnx(scope const char* fmt, ...);
20+
void verr(int eval, scope const char* fmt, va_list args);
21+
void verrx(int eval, scope const char* fmt, va_list args);
22+
void vwarn(scope const char* fmt, va_list args);
23+
void vwarnx(scope const char* fmt, va_list args);

src/core/sys/darwin/err.d

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
/**
2+
* D header file for Darwin err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.darwin.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (OSX)
12+
version = Darwin;
13+
else version (iOS)
14+
version = Darwin;
15+
else version (TVOS)
16+
version = Darwin;
17+
else version (WatchOS)
18+
version = Darwin;
19+
20+
21+
version (Darwin):
22+
extern (C):
23+
nothrow:
24+
@nogc:
25+
26+
alias ExitFunction = void function(int);
27+
28+
void err(int eval, scope const char* fmt, ...);
29+
void errc(int eval, int code, scope const char* fmt, ...);
30+
void errx(int eval, scope const char* fmt, ...);
31+
void warn(scope const char* fmt, ...);
32+
void warnc(int code, scope const char* fmt, ...);
33+
void warnx(scope const char* fmt, ...);
34+
void verr(int eval, scope const char* fmt, va_list args);
35+
void verrc(int eval, int code, scope const char* fmt, va_list args);
36+
void verrx(int eval, scope const char* fmt, va_list args);
37+
void vwarn(scope const char* fmt, va_list args);
38+
void vwarnc(int code, scope const char* fmt, va_list args);
39+
void vwarnx(scope const char* fmt, va_list args);
40+
void err_set_file(void* vfp);
41+
void err_set_exit(ExitFunction exitf);

src/core/sys/dragonflybsd/err.d

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* D header file for DragonFlyBSD err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.dragonflybsd.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (DragonFlyBSD):
12+
extern (C):
13+
nothrow:
14+
@nogc:
15+
16+
alias ExitFunction = void function(int);
17+
18+
void err(int eval, scope const char* fmt, ...);
19+
void errc(int eval, int code, scope const char* fmt, ...);
20+
void errx(int eval, scope const char* fmt, ...);
21+
void warn(scope const char* fmt, ...);
22+
void warnc(int code, scope const char* fmt, ...);
23+
void warnx(scope const char* fmt, ...);
24+
void verr(int eval, scope const char* fmt, va_list args);
25+
void verrc(int eval, int code, scope const char* fmt, va_list args);
26+
void verrx(int eval, scope const char* fmt, va_list args);
27+
void vwarn(scope const char* fmt, va_list args);
28+
void vwarnc(int code, scope const char* fmt, va_list args);
29+
void vwarnx(scope const char* fmt, va_list args);
30+
void err_set_file(void* vfp);
31+
void err_set_exit(ExitFunction exitf);

src/core/sys/freebsd/err.d

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
/**
2+
* D header file for FreeBSD err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.freebsd.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (FreeBSD):
12+
extern (C):
13+
nothrow:
14+
@nogc:
15+
16+
alias ExitFunction = void function(int);
17+
18+
void err(int eval, scope const char* fmt, ...);
19+
void errc(int eval, int code, scope const char* fmt, ...);
20+
void errx(int eval, scope const char* fmt, ...);
21+
void warn(scope const char* fmt, ...);
22+
void warnc(int code, scope const char* fmt, ...);
23+
void warnx(scope const char* fmt, ...);
24+
void verr(int eval, scope const char* fmt, va_list args);
25+
void verrc(int eval, int code, scope const char* fmt, va_list args);
26+
void verrx(int eval, scope const char* fmt, va_list args);
27+
void vwarn(scope const char* fmt, va_list args);
28+
void vwarnc(int code, scope const char* fmt, va_list args);
29+
void vwarnx(scope const char* fmt, va_list args);
30+
void err_set_file(void* vfp);
31+
void err_set_exit(ExitFunction exitf);

src/core/sys/linux/err.d

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/**
2+
* D header file for Linux err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.linux.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (linux):
12+
extern (C):
13+
nothrow:
14+
@nogc:
15+
16+
void err(int eval, scope const char* fmt, ...);
17+
void errx(int eval, scope const char* fmt, ...);
18+
void warn(scope const char* fmt, ...);
19+
void warnx(scope const char* fmt, ...);
20+
void verr(int eval, scope const char* fmt, va_list args);
21+
void verrx(int eval, scope const char* fmt, va_list args);
22+
void vwarn(scope const char* fmt, va_list args);
23+
void vwarnx(scope const char* fmt, va_list args);

src/core/sys/netbsd/err.d

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
/**
2+
* D header file for NetBSD err.h.
3+
*
4+
* Copyright: Copyright © 2019, The D Language Foundation
5+
* License: <a href="http://www.boost.org/LICENSE_1_0.txt">Boost License 1.0</a>.
6+
* Authors: Ernesto Castellotti
7+
*/
8+
module core.sys.netbsd.err;
9+
import core.stdc.stdarg : va_list;
10+
11+
version (NetBSD):
12+
extern (C):
13+
nothrow:
14+
@nogc:
15+
16+
void err(int eval, scope const char* fmt, ...);
17+
void errc(int eval, int code, scope const char* fmt, ...);
18+
void errx(int eval, scope const char* fmt, ...);
19+
void warn(scope const char* fmt, ...);
20+
void warnc(int code, scope const char* fmt, ...);
21+
void warnx(scope const char* fmt, ...);
22+
void verr(int eval, scope const char* fmt, va_list args);
23+
void verrc(int eval, int code, scope const char* fmt, va_list args);
24+
void verrx(int eval, scope const char* fmt, va_list args);
25+
void vwarn(scope const char* fmt, va_list args);
26+
void vwarnc(int code, scope const char* fmt, va_list args);
27+
void vwarnx(scope const char* fmt, va_list args);

0 commit comments

Comments
 (0)