This is the mail archive of the
gsl-discuss@sources.redhat.com
mailing list for the GSL project.
Re: BORLAND C++
Santiago Calderon writes:
> In the Borland C++ compiler is the some as far as I know.
> When you build the dll you must define this variables as
> __declspec(dllexport)
> and when you write an application that use the dll you must define
> the variable in you include files as __declspec(dllimport)
> I suppose that to solve that definitively , the source of the
> library should be modified so that the dll knows about these
> variable to be exported using the __declspec(dllexport) and when we
> use it in the program using the __declspec(dllimport), at least to
> do it fully compatible with Borland compiler (and perhaps MSCV??).
There's a perl script in msvc/mkdllheaders.pl which I've been using
to add this to the headers of the Windows version.
regards
Brian
#!/usr/bin/perl
while (<>) {
if (/^extern/ && !/^extern inline/) {
$a = $_; $a =~ s/^extern/__declspec(dllexport)/;
$b = $_; $b =~ s/^extern/__declspec(dllimport)/;
print "#ifdef GSL_EXPORTS\n";
print "$a";
print "#elif defined(GSL_IMPORTS)\n";
print "$b";
print "#else\n";
print "$_";
print "#endif\n";
} else {
print;
}
}