mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 21:21:48 +03:00
Fix bugzilla issue 24669 - Make -i work with C modules (#16776)
This commit is contained in:
parent
8dabb67ee5
commit
05b2c0dfe2
3 changed files with 12 additions and 1 deletions
3
changelog/dmd.import-c-i.dd
Normal file
3
changelog/dmd.import-c-i.dd
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
Using the compiler flag `-i` will now properly pick up C source files
|
||||||
|
|
||||||
|
Previously you needed to manually include .c source files, it now works just like with .d files
|
|
@ -138,7 +138,7 @@ extern (C++) struct Compiler
|
||||||
*/
|
*/
|
||||||
extern(C++) static bool onImport(Module m)
|
extern(C++) static bool onImport(Module m)
|
||||||
{
|
{
|
||||||
if (includeImports && m.filetype == FileType.d)
|
if (includeImports && (m.filetype == FileType.d || m.filetype == FileType.c))
|
||||||
{
|
{
|
||||||
if (includeImportedModuleCheck(ModuleComponentRange(
|
if (includeImportedModuleCheck(ModuleComponentRange(
|
||||||
m.md ? m.md.packages : [], m.ident, m.isPackageFile)))
|
m.md ? m.md.packages : [], m.ident, m.isPackageFile)))
|
||||||
|
|
8
compiler/test/compilable/test16776.d
Normal file
8
compiler/test/compilable/test16776.d
Normal file
|
@ -0,0 +1,8 @@
|
||||||
|
// ARG_SETS: -i
|
||||||
|
// PERMUTE_ARGS:
|
||||||
|
// LINK:
|
||||||
|
import imports.cstuff3;
|
||||||
|
void main()
|
||||||
|
{
|
||||||
|
int s = squared(2);
|
||||||
|
}
|
Loading…
Add table
Add a link
Reference in a new issue