title: What's safe for a C++ plug-in system?
body: <p>Plug-in systems in C++ are hard because the ABI is not properly defined, and each compiler (or version thereof) follows its own rules. However, COM on Windows shows that it's  possible to create a minimal plug-in system that allows programmers with different compilers to create plug-ins for a host application using a simple interface.</p>
  
  <p>Let's be practical, and leave the C++ standard, which is not very helpful in this respect, aside for a minute. If I want to write an app for Windows and Mac (and optionally Linux) that supports C++ plug-ins, and if I want to give plug-in authors a reasonably large choice of compilers (say less than 2 year old versions of Visual C++, GCC or Intel's C++ compiler), what features of C++ could I count on?</p>
  
  <p>Of course, I assume that plug-ins would be written for a specific platform.</p>
  
  <p>Off the top of my head, here are some C++ features I can think of, with what I think is the answer:</p>
  
  <ul>
  <li>vtable layout, to use objects through abstract classes? (yes)</li>
  <li>built-in types, pointers? (yes)</li>
  <li>structs, unions? (yes)</li>
  <li>exceptions? (no)</li>
  <li>extern "C" functions? (yes)</li>
  <li>stdcall non-extern "C" functions with built-in parameter types? (yes)</li>
  <li>non-stdcall non-extern "C" functions with user-defined parameter types? (no)</li>
  </ul>
  
  <p>I would appreciate any experience you have in that area that you could share. If you know of any moderately successful app that has a C++ plug-in system, that's cool too.</p>
  
  <p>Carl</p>