Re: What needs to be done for next release?

"Gary Setter" <[email protected]>
Newsgroups gmane.comp.gnu.aspell.devel
Message-ID <000401c5002c$ce04a8a0$05144a0c@pavilion>
----- Original Message ----- 
From: "Kevin Atkinson" <[email protected]>
To: "Gary Setter" <[email protected]>
Cc: <[email protected]>
Sent: Friday, January 21, 2005 1:09 AM
Subject: Re: [aspell-devel] What needs to be done for next
release?


> On Thu, 20 Jan 2005, Gary Setter wrote:
>
> > Hi Kevin,
> >
> > What needs to be done for the next release of Aspell?
>
> I take it you mean 0.61?  I have posted a TODO on this list a
while ago
>
> > What role
> > does Win32 support play in it?
>
> I do not have any specific Win32 plans.  If it looks like VC6
compliance is
> close than I may delay the release a bit.  Other than that I
myself do not
> plan to put any effort into it.
Understood
>
> > I'm wondering if anyone on this list has the free VC Toolkit
> > 2003. I downloaded it but it requires Window2000, and my
humble
> > system only has Windows98. The reason I bring it up is that
many
> > of the problems I had with VC6 may not be problems with the
newer
> > compiler. If so, I would quietly end my efforts to make
aspell
> > more compatible with VC6.
> >
> > The one issue that I can't imagine going away is how to
export
> > functions that are part of the Aspell libraries API. Would it
be
> > a good thing to submit a patch that marks the API functions
for
> > export?
>
> Well a lot of C API code is generated so it will be necessary
to modify
> the mk-src script.  I will not accept a patch that only
modifies the
> generated files.  Perhaps it will be best to describe the
changes needed
> and let me modify the script and send you a patch to try.
>
> But the Aspell utility currently uses a good deal of the
internal API.  If
> absolutely necessary I will accept code that marks the
necessary
> functions/methods to export.  However,
>   1) I hope to make the external (ie C) API powerful enough
that the
>      Aspell utility does not have to use any of the API.
>   2) I would rather find another way.  For example are there
any flags
>      you can pass in to export ALL symbols in a given namespace
or maybe
>      ones that match a regular expressions?
>
> -- 
> http://kevin.atkinson.dhs.org
>
Hi Kevin,
This is my description of the changes needed to export a symbol
from a Windows DLL file.
The key is using the __declspec() keyword on the symbol. You can
export a function, global variable, or a whole class, but you can
not export a whole namespace. The  __declspec() keyword  can take
several attributes, but we are only interested in two - dllimport
and dllexport. What I always do, is define a macros that defines
whether we are importing or export, which means, are we building
the main application or the library. I use those macro to define
one macro that has the right __declspec for the current build.
This is basically what the guy that did the Aspell 0.50 wrote:

#ifndef aspell_root_h
#define aspell_root_h

// The following ifdef block is the standard way of creating
macros which make exporting
// from a DLL simpler. All files within this DLL are compiled
with the ASPELL_EXPORTS
// symbol defined on the command line. this symbol should not be
defined on any project
// that uses this DLL. This way any other project whose source
files include this file see
// ASPELL_API functions as being imported from a DLL, wheras this
DLL sees symbols
// defined with this macro as being exported.
#ifdef WIN32PORT
# if defined( ASPELL_NO_EXPORTS )
#  define ASPELL_API
# elif defined( ASPELL_EXPORTS )
#  define ASPELL_API __declspec(dllexport)
# else
#  define ASPELL_API __declspec(dllimport)
# endif
#else
# define ASPELL_API
#endif

#endif

This header file went into each source file that involves
exported functions.
To export a function from /lib/speller-c.cpp I have this line:
extern "C" ASPELL_API CanHaveError * new_aspell_speller(Config *
config)

There may be better ways to define the ASPELL_API macro, but that
was what the previous version did.

BTW, I read and read the makefile, mk-src.pl and the pm and I
still don't see how something an intricate as speller-c.cpp could
be generated. Is it really generated?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.