[email protected] (Ludovic Courtès) writes: > should be OK. However, I’m slightly concerned about MSVC’s > __declspec: does it work if it sees: > > __declspec(dllexport) extern SCM foo (SCM); > extern SCM foo (SCM);
I don't know for sure, but I know I've seen "function redeclared with different linkage" warnings in the past, and this could well be one of the situations that generates such warnings. But what about using SCM_API instead of extern? Wouldn't that always generate the right code? (At least for building guile itself.) > If it works, that probably means this point is moot. > > 2. The automatically added ‘extern’ declaration makes > ‘-Wmissing-prototypes’ useless, which is annoying. I guess it depends if the primitives in question are designed to be used only from Scheme, or also from other C files. If they're only for Scheme, it's a nice feature that SCM_DEFINE does everything needed and the developer doesn't need a matching prototype. If they're for other C files, the missing prototype warning could be helpful. Then again, the developer will get some kind of warning anyway when trying to use the function from another file. So I think the balance is in favour of SCM_DEFINE including the prototype. Neil
