|
-
May 26th, 2013, 11:44 AM
#1
C abi
hi,
I am in the process of developing a dynamic plugin system for an application written in C++.
Requirements:
- support Win, Linux, OSX (x86 and x64)
- support at least C/C++ plugins (bonus: delphi and other native languages)
Ergo i am perfectly happy with plain Functions exported by the main application and used by plugins. No templates, no OOP; though i would like to pass structs back and forth, if possible.
I read this excellent article:
http://philippe.ameline.free.fr/tech...nFramework.htm
which describes a few interesting concepts.
Most notably, it states that if i wrap my Function- and Struct definitions in <extern "C">, i can not only use function pointers, but also exchange pointers to structs (and make use of them) with "virtually all C compilers".
I find that hard to believe. Is the C ABI really that standardized? What about x64? Alignment?
The relevant quote from the article:
The ultimate in compatibility is to just forget about C++ and expose a pure C API. C is compatible in practice between all compiler implementations.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|