Refer to external symbol without leading underscore from C

Viewed 143

I am trying to refer to object files generated by clang from ObjC sources from C code, however the compiler is generating symbols not prepended by underscore so extern specification does not work. I'm using the latest Apple clang. I am guessing this must be possible, since kernels would need to do this. Anyone confirm it is possible or not, if so how to do it, if not, a workaround if known please. Thanks!

1 Answers

Sorry I found the answer immediately after posting the question:

extern void *name asm("name");

appears to work with both clang and gcc. Not sure about Windows.

Related