File tree Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Expand file tree Collapse file tree 1 file changed +10
-4
lines changed Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments