On 02/15/2015 09:00 AM, Eli Zaretskii wrote: >> Date: Sun, 15 Feb 2015 05:50:07 -0800 >> From: Daniel Colascione >> >>>> #ifdef WINDOWS >>>> # ifdef emacs >>>> # define EMACS_EXPORT __declspec(dllexport) >>>> # else >>>> # define EMACS_EXPORT __declspec(dllimport) >>>> # endif >>>> # else >>>> # define EMACS_EXPORT >>>> #endif >>>> >>>> That's because they should be exported by Emacs, but imported by >>>> modules. >>> >>> Right, that makes sense. >> >> No it doesn't. Modules shouldn't be importing anything from Emacs: Emacs >> should _give_ modules a table of all function pointers they need. It's a >> lot less error-prone that way. > > I don't follow: how will the linker succeed in linking the module's > shared library, if you don't submit to it an import library with the > symbols in that table you mention? And how do you suggest to produce > an import library, except by the above decorations? > > What am I missing? Emacs doesn't provide symbols to modules. Modules provide an initialization function to Emacs: Emacs then calls this initialization function with a pointer to a C structure containing a table of function pointers. Modules call these function pointers to do their work. There's no need for Emacs itself to export any symbols.