Skip to content

Commit 8d5567a

Browse files
ibuclawdlang-bot
authored andcommitted
importc: Add .h files to list of ImportC file extensions
1 parent 263740e commit 8d5567a

File tree

3 files changed

+9
-5
lines changed

3 files changed

+9
-5
lines changed

dcompiler.dd

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,10 @@ $(H2 $(LNAME2 switches, Compiler Arguments and Switches))
299299
$(TD $(RELATIVE_LINK2 interface-files, D interface files))
300300
)
301301
$(TR
302+
$(TD $(B .h))
303+
$(TD C header files)
304+
)
305+
$(TR
302306
$(TD $(B .i))
303307
$(TD preprocessed C source files)
304308
)

spec/importc.dd

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -95,8 +95,7 @@ $(H2 $(LNAME2 command-line, Invoking ImportC))
9595

9696
$(H3 $(LNAME2 command-line, ImportC Files on the Command Line))
9797

98-
$(P ImportC files have one of the extensions `.i`, or `.c`. If no
99-
extension is given, `.i` is tried first, then `.c`.
98+
$(P ImportC files have one of the extensions `.i`, `.h`, or `.c`.
10099
)
101100

102101
$(CONSOLE
@@ -106,7 +105,7 @@ dmd hello.c)
106105
file `hello` (`hello.exe` on Windows)
107106
)
108107

109-
$(BEST_PRACTICE explicitly use a `.i` or `.c` extension when
108+
$(BEST_PRACTICE explicitly use a `.i`, `.h`, or `.c` extension when
110109
specifying C files on the command line.)
111110

112111
$(H3 $(LNAME2 importing, Importing C Files from D Code))
@@ -117,8 +116,8 @@ dmd hello.c)
117116
import hello;
118117
---
119118

120-
$(P which will, if `hello` is not a D file, and has an extension `.i` or `.c`,
121-
compile `hello` with ImportC.
119+
$(P which will, if `hello` is not a D file, and has an extension `.i`,
120+
`.h`, or `.c`, compile `hello` with ImportC.
122121
)
123122

124123
$(H2 $(LNAME2 preprocessor, Preprocessor))

spec/module.dd

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,7 @@ qualified with whatever packages they are in. They are not considered to be
229229
relative to the module that imports them.)
230230

231231
$(IMPLEMENTATION_DEFINED
232+
$(OL
232233
$(LI How the compiler resolves the package and module identifiers in an
233234
import declaration to its corresponding source files.)
234235
))

0 commit comments

Comments
 (0)