| ... | ... | @@ -3887,6 +3887,17 @@ comptime { |
| 3887 | 3887 | <code>@cInclude</code>, <code>@cDefine</code>, and <code>@cUndef</code> work |
| 3888 | 3888 | within this expression, appending to a temporary buffer which is then parsed as C code. |
| 3889 | 3889 | </p> |
| 3890 | <p> |
| 3891 | Usually you should only have one <code>@cImport</code> in your entire application, because it saves the compiler |
| 3892 | from invoking clang multiple times, and prevents inline functions from being duplicated. |
| 3893 | </p> |
| 3894 | <p> |
| 3895 | Reasons for having multiple <code>@cImport</code> expressions would be: |
| 3896 | </p> |
| 3897 | <ul> |
| 3898 | <li>To avoid a symbol collision, for example if foo.h and bar.h both <code>#define CONNECTION_COUNT</code></li> |
| 3899 | <li>To analyze the C code with different preprocessor defines</li> |
| 3900 | </ul> |
| 3890 | 3901 | {#see_also|Import from C Header File|@cInclude|@cDefine|@cUndef#} |
| 3891 | 3902 | {#header_close#} |
| 3892 | 3903 | {#header_open|@cInclude#} |