Writing portable C library in SwiftPM question

Is there anything SwiftPM-specific here that wouldn't apply to any C library in abstract?

  1. No. It's not SwiftPM-specific.It's because the C and Swift Package are mostly provided via SwiftPM in Linux.

By "build" here do you mean the build system specifically, or writing the library itself in a portable way?

  1. I mean writing the library itself in a portable way. I do not think I should duplicate such macro in every portable C library I wrote.
    https://github.com/apple/swift-corelibs-foundation/blob/8a9b69b5041b5069360239cd18304fd8e2eb91d9/CoreFoundation/Base.subproj/CFBase.h#L121-L149

Do you already have a C library that utilizes Darwin APIs and want to port it to non-Darwin platform?

  1. I do not depend on specified Darwin Only API(eg. CFLock CFString). Mostly depend on the CF cross-platform C macro(CFOption CFExport).

Does the library have to be written in C? Why not write it in Swift and expose the C API to it with @_cdecl and corresponding headers? Or expose a C++ API via C++ interop?

  1. Some part of the code is very low level. There is some limitation in the current Swift version to do it right.

Formalizing the unavailability of Core Foundation - #12 by Max_Desiatov

  1. Deep sorry for this interruption. I forgot to check the last active time of the past. By the way, can we consider automatically locking posts that have not received a new reply for more than a period of time(eg. 1 year)?