[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: undefined or invalid # directive (#import ...) when compiling coreba
Re: undefined or invalid # directive (#import ...) when compiling corebase with gcc-2.95
Fri, 10 Jun 2011 08:49:15 -0500
No, the problem is the use of a variable length argument (...) in a macro.
On Fri, Jun 10, 2011 at 12:53 AM, Richard Frith-Macdonald <address@hidden>
On 10 Jun 2011, at 02:48, Stefan Bidi wrote:
> I ran into some extra time tonight and put something together. Wasn't at all hard since I used NSByteOrder.h in base as a template.
> The one thing I found weird is that none of the SwappedFloat functions in -base actually swap anything. It seems like they just return the same value. Richard, your name is on that file, can you confirm that that's correct?
They certainly do something. However it's so long ago that I can't remember the code and don't know for sure that what they do is correct.
There are two sets of inline functions there ... ones that act like casts to convert between float/double and the NSSwappedFloat/NSSwappedDouble forms (where the individual bytes are accessible) and the others which swap the byte order in the NSSwapped forms. The real work is done by a combination of the two.
Ah, taking a better look at it I see that there is a NSSwapDouble() before the call to the convert functions... hadn't seen that before.
> I'm still not sure what to do with the CFRuntime issue. Can anyone else suggest something?
Is this just the compiler not liking objc stuff?
Why not just use a .m file extension? CoreFoundation/Corebase code doesn't have to be implemented as C code ... it just needs to provide C functions as its formal API for people to link to.