Commit edd6f3d
authored
cgen: stop treating every .m as an Objective-C import (#26794)
cgen was using a plain `contains('.m')` check when deciding whether a hash directive should be deferred until after V type definitions. That worked for real Objective-C includes, but it also caught unrelated cases like a `#insert` under a `@VMODROOT` path that happened to include a `.m` directory, or a `#define` value containing `.m`.
When that happened, the directive was moved out of the normal include section and never emitted.
Tighten the check so only `#include` and `#preinclude` directives whose target file actually ends in `.m` get the Objective-C treatment, and add regression tests for both the `#insert` and `#define` cases.1 parent e8d0714 commit edd6f3d
4 files changed
Lines changed: 28 additions & 5 deletions
File tree
- vlib/v/gen/c
- testdata
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6179 | 6179 | | |
6180 | 6180 | | |
6181 | 6181 | | |
| 6182 | + | |
6182 | 6183 | | |
6183 | 6184 | | |
6184 | 6185 | | |
6185 | | - | |
| 6186 | + | |
6186 | 6187 | | |
6187 | 6188 | | |
6188 | 6189 | | |
| |||
6195 | 6196 | | |
6196 | 6197 | | |
6197 | 6198 | | |
6198 | | - | |
| 6199 | + | |
6199 | 6200 | | |
6200 | 6201 | | |
6201 | 6202 | | |
| |||
6216 | 6217 | | |
6217 | 6218 | | |
6218 | 6219 | | |
| 6220 | + | |
| 6221 | + | |
| 6222 | + | |
| 6223 | + | |
| 6224 | + | |
| 6225 | + | |
| 6226 | + | |
| 6227 | + | |
| 6228 | + | |
| 6229 | + | |
| 6230 | + | |
| 6231 | + | |
6219 | 6232 | | |
6220 | 6233 | | |
6221 | 6234 | | |
| |||
6272 | 6285 | | |
6273 | 6286 | | |
6274 | 6287 | | |
| 6288 | + | |
6275 | 6289 | | |
6276 | 6290 | | |
6277 | | - | |
| 6291 | + | |
6278 | 6292 | | |
6279 | 6293 | | |
6280 | | - | |
| 6294 | + | |
6281 | 6295 | | |
6282 | 6296 | | |
6283 | 6297 | | |
| |||
6286 | 6300 | | |
6287 | 6301 | | |
6288 | 6302 | | |
6289 | | - | |
| 6303 | + | |
6290 | 6304 | | |
6291 | 6305 | | |
6292 | 6306 | | |
| |||
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
0 commit comments