Subject | Re: [Firebird-Architect] External Engines (and Plugins) |
---|---|
Author | Adriano dos Santos Fernandes |
Post date | 2008-06-25T11:05:32Z |
Vlad Khorsun escreveu:
to allow exceptions throw/catch across EXE/DLLs boundaries. It was only
possible using dynamic library versions of libstd++, but such version
was not officially distributed as people worried about GPL issues. Also,
MSVC exceptions can be throw across MSVC EXE/DLLs.
so the original idea was to use it for C++. I'll split it into two
header files. It declares macros, catch exceptions and transfer to Error
object. The macros will be used in user code, hence exception code is in
user code.
I suppose you didn't looked at it. There is no mixed/violation layers
there, sorry.
Adriano
> Adriano dos Santos Fernandes :My first contribution to open source projects was a patch to GCC/MinGW
>
>> Dmitry Yemanov escreveu:
>>
>>> Adriano dos Santos Fernandes wrote:
>>>
>>>
>>>> C++ libraries can throw exceptions and the plugin part (CppEngine.h)
>>>> embedded on them deal with exceptions and translate to the Error object.
>>>> There is no boundaries violation.
>>>>
>>>>
>>> Maybe Vlad meant to say that a properly implemented dynamic library
>>> should never throw exceptions to the caller process.
>>>
>
> Yes. More - one library must never throw exceptions even to caller library.
to allow exceptions throw/catch across EXE/DLLs boundaries. It was only
possible using dynamic library versions of libstd++, but such version
was not officially distributed as people worried about GPL issues. Also,
MSVC exceptions can be throw across MSVC EXE/DLLs.
> OSThis is *not* true. It may cause incorrect stack unwind.
> level exceptions can be handled correctly between different libraries compiled
> by different compilers but not "language" exceptions.
>
>Error object was designed to not put we in trouble.
>> This is not always true, but...
>>
>
> This must be always true else we in trouble.
>
>Why? The header file is named CppEngine (CPP means C++, remember :-) ),
>>> As long as this rule is followed, you don't need to handle C++ and Delphi plugins
>>> differently in terms of exceptions.
>>>
>> CppEngine.h becomes part of user library. This header file was many
>> inline implementation just for it. Libraries could (and are encouraged
>> to) throw ThrowError::Exception (or use ThrowError::check) and the error
>> will be converted to status vector. Others (...) exceptions are just
>> caught as unrecognized. All done without cross library boundaries.
>>
>
> Then you mixed two layers (plugin itself and user library) in one header file.
>
so the original idea was to use it for C++. I'll split it into two
header files. It declares macros, catch exceptions and transfer to Error
object. The macros will be used in user code, hence exception code is in
user code.
I suppose you didn't looked at it. There is no mixed/violation layers
there, sorry.
Adriano