Submitted by Peter Burns on Wed, 4 Aug 1999 12:40:32
+1000
Windows uses a special keyword to export a classes
symbol to a dll.
For example to export a class named Exportable you
do something like this.
class __declspec(dllexport) Exportable
{
...
};
I think Os/2 uses a similar scheme except the
keyword is _Export.
Often people will define a macro like EXPORT so
that compilers where you don't have to do this
don't complain about the strange keyword.
At the moment perceps doesn't handle this very well.
Here is a simple change to the pattern in
PROCCLASS that could be used to get around the
problem although it doesn't work for the
__declspec(dllexport) keyword.
$block=~/^\s*(class|struct|union)\s+(\w+\s+)*(\w+)/
I'm not a perl programmer so I guess I'll let you
work out what the pattern needs to be.
Perceps also doesn't seem to handle struct
variables well. It thinks they are declarations
of new structs. ie variables declared like -
struct tm time;
I know that in C++ you don't need to use the
struct keyword but programmers are still likely to
use it. The same problem occurs with some forward
declarations of classes.
like
int MyFunction(class MyClass* x)
{
}
Peter Burns