Skip to content

Commit b5a978c

Browse files
dkorpeldlang-bot
authored andcommitted
Mention ImportC in interfaceToC.dd
1 parent 9e56a6f commit b5a978c

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

spec/interfaceToC.dd

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,22 @@ $(SPEC_S Interfacing to C,
55
$(HEADERNAV_TOC)
66

77
$(P D is designed to fit comfortably with a C compiler for the target
8-
system. D makes up for not having its own VM by relying on the
9-
target environment's C runtime library. It would be senseless to
10-
attempt to port to D or write D wrappers for the vast array of C APIs
11-
available. How much easier it is to just call them directly.
8+
system. It is able to call C functions directly without requiring
9+
wrapper functions.
1210
)
1311

1412
$(P This is done by matching the C compiler's data types, layouts,
1513
and function call/return sequences.
1614
)
1715

16+
$(P The $(DDLINK spec/importc, ImportC, ImportC) compiler extention lets you import or compile `.c` files directly. )
17+
18+
$(P Bindings for popular C libraries can be found in the
19+
$(LINK2 https://dlang.org/phobos/index.html, standard library) and
20+
$(LINK2 https://code.dlang.org/?sort=updated&limit=20&category=library.binding, package repository).)
21+
22+
$(P The rest of this page describes the manual, low-level side of interfacing with C.)
23+
1824
$(H2 $(LNAME2 calling_c_functions, Calling C Functions))
1925

2026
$(P C functions can be called directly from D. There is no need for

0 commit comments

Comments
 (0)