Question

I have been handed a good-sized chunk of c-code that would be better packaged as an ios framework, that our apps may choose to embed in their projects or, potentially, distribute to 3rd party.

While following the instructions @ https://github.com/jverkoey/iOS-Framework#first_parties, the question i am asking popped up in my mind especially that the idea of a rewrite in objective-c is daunting, given the schedule and my current level of objective-c expertise.

A minimal set/amount of Objective-c is fine, if necessary for language binding or some such thing.

The original code is written in C (it's designed to be portable) but makes extensive use of gcc macros and extensions.

Your advice would be highly appreciated!

Was it helpful?

Solution

Yes, the straightforward (though possibly non-trivial) approach is simply to write a wrapper around the C library. If you need to support Obj-C and C developers down the road, I'd move the very-core functionality into a C only library, and the write better libraries to access the core feature set for both Obj-C and C (if this is even needed), so that there's less extra "wrapping" happening.

The original code is written in C (it's designed to be portable) but makes extensive use of gcc macros and extensions.

Clang has a pretty good attitude and approach to supporting the GCC extensions. I'd keep an eye out for anything very esoteric, but you should be OK.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top