emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Dynamic loading progress


From: Daniel Colascione
Subject: Re: Dynamic loading progress
Date: Sun, 15 Feb 2015 05:50:07 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0

On 02/14/2015 05:04 PM, Stephen Leake wrote:
> Eli Zaretskii <address@hidden> writes:
> 
>>> but I don't see how we are going to restrict what symbols are
>>> available to the module.
>>
>> The way to restrict the export is to declare the symbols you want to
>> export with __declspec(dllexport).  Then only those symbols will be
>> exported.
>>
>> Note that, since emacs.h will be included by modules as well, we will
>> need something like
>>
>>   #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.

> 
>>> Is there an acceptable (ie portable and reliable) way to determine the
>>> OS in a Makefile? I'm not aware of one (short of Gnu config.guess).
>>
>> Windows can be detected by looking at environment variables.  Since
>> Make converts them to Make variables, they are easily accessed.
>>
>> Another possibility is to invoke "gcc -dumpmachine" via the $shell
>> function.  We could also invoke uname in a similar manner, but that
>> requires MSYS or Coreutils to be installed.  We could even invoke Make
>> itself with the --version option, and see what follows the "Built for"
>> header.
>>
>> So ways to do that exist, we just need to decide whether we want to go
>> that way.
> 
> I've attempted to take that approach for other projects, and it isn't
> very portable
> 

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]