libimobiledevice / libimobiledevice-glue

A library with common code used by libraries and tools around the libimobiledevice project
GNU Lesser General Public License v2.1
86 stars 69 forks source link

Include stdio.h #23

Closed Schlaubischlump closed 2 years ago

Schlaubischlump commented 2 years ago

When trying to compile the library files as a swift package to expose the API to swift, you will get an error message, that stdio.h must be included in termcolors.h, since FILE is defined in stdio.h. The error says:

Declaration of 'FILE' must be imported from module 'Darwin.C._stdio' before it is required

The error does only appear if you try to import the generated module inside of swift. This change should not break any existing functionality and it would help with compiling the project as a swift module. Is there any reason not to include stdio.h ? You can find an example swift module here. You would still need to add a test target, that imports the module and remove the #include <stdio.h> line that I added to my fork, to reproduce the error.

nikias commented 2 years ago

Thanks for the tip. In fact there is no reason not to include this.