From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.devel Subject: Re: good examples of Emacs modules? Date: Fri, 01 Apr 2016 15:20:42 +0200 Message-ID: <87lh4x5utx.fsf@wanadoo.es> References: <56FC5E99.7090804@cs.ucla.edu> <8737r67jbo.fsf@wanadoo.es> <83a8levbaf.fsf@gnu.org> <87y48y60fi.fsf@wanadoo.es> <834mbmv95h.fsf@gnu.org> <87twjm5rc3.fsf@wanadoo.es> <87poua5mwn.fsf@wanadoo.es> <83mvpdu79a.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1459517204 22566 80.91.229.3 (1 Apr 2016 13:26:44 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 1 Apr 2016 13:26:44 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 01 15:26:37 2016 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1alz5v-0001UL-PC for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2016 15:26:35 +0200 Original-Received: from localhost ([::1]:44389 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alz5v-0001u4-4S for ged-emacs-devel@m.gmane.org; Fri, 01 Apr 2016 09:26:35 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:56676) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alz0T-0001Gc-VV for emacs-devel@gnu.org; Fri, 01 Apr 2016 09:20:58 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1alz0O-00025o-CY for emacs-devel@gnu.org; Fri, 01 Apr 2016 09:20:57 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:50678) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1alz0O-00025R-5C for emacs-devel@gnu.org; Fri, 01 Apr 2016 09:20:52 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1alz0L-000705-Oe for emacs-devel@gnu.org; Fri, 01 Apr 2016 15:20:49 +0200 Original-Received: from 151.red-79-153-146.dynamicip.rima-tde.net ([79.153.146.151]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Apr 2016 15:20:49 +0200 Original-Received: from ofv by 151.red-79-153-146.dynamicip.rima-tde.net with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 01 Apr 2016 15:20:49 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 49 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 151.red-79-153-146.dynamicip.rima-tde.net User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.92 (gnu/linux) Cancel-Lock: sha1:0dzKBr7u4qyfRzxz3GTHWE9mvxU= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:202565 Archived-At: Eli Zaretskii writes: >> From: Óscar Fuentes >> Date: Thu, 31 Mar 2016 23:59:36 +0200 >> >> BTW, it is necessary to explicitly export the symbols on Windows (and on >> GNU/Linux too depending on the arguments used): >> >> int plugin_is_GPL_compatible; >> >> should be >> >> int __declspec(dllexport) plugin_is_GPL_compatible; >> >> (Windows) >> >> int __attribute__ ((visibility("default"))) plugin_is_GPL_compatible; > > I don't need any such Windows-specific attributes, so I'm unsure why > you think you do. The test in modules/mod-test compiles and passes > the tests just fine without that. This is because MinGW defaults to "export everything" (as soon as the compiler sees a dllexport, it disables the "export everything" feature), same as gcc on GNU/Linux does. On Windows this is not a good practice if you have multiple dlls (modules) with potentially identical symbols exported. Not a big deal on the case of Emacs modules, but having to explicitly exporting symbols is something a non-MinGW-immersed Windows developer assumes as a fact. >> (GNU/Linux, when you compile your module with -fvisibility=hidden, which >> is a Good Thing.) > > If someone uses -fvisibility=hidden on a shared object, they know what > they are doing, and they need the attribute on every exported symbol, > not just on plugin_is_GPL_compatible. Yes, that's the idea. Explicitly exporting symbols is a recommended practice (by GCC) on GNU/Linux and a requirement on Windows, except on the case of MinGW which implements a hack, which is problematic, and the MinGW developers (the old ones such as Danny, who knew the binutils and gcc internals) advised against using it. Anyway, it is possibly a good idea to left things how they are now as most modules will be developed on GNU/Linux and decorating `plugin_is_GPL_compatible' may cause confusion, both to module writers on GNU/Linux and builders on Windows. So let's forget the issue for now.