For review: Ticket 2781

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

For review: Ticket 2781

Jackie Ng
Hi All,

I've attached a patch for ticket 2781

I've been experimenting in an external sandbox with using vanilla SWIG to
generate bindings for the MapGuide API, with an eye towards finally moving
off of PHP 5.6 (which is EOL in december) to PHP 7.2.

One small annoyance in my current work is that the current MapGuide common
header layout leaks out ACE and xerces, which introduces additional hacks
and workarounds especially for ACE where it collides with PHP on a few
certain typedefs.

This patch reduces that annoyance by tightening up the encapsulation of the
MapGuide common headers by introducing a new SWIG_PUBLIC_API symbol, which
is used to:

 1. #ifdef out any trace of xerces. Where xerces types are referenced, they
are forward-declared away.
 2. #ifdef out a whole lot of ACE headers and forward-declare away whatever
ACE types we can. Unfortunately, one ACE header still has to be leaked out,
which the one for ACE_Recursive_Thread_Mutex as it is present as a class
member on some publicly exported types.

The patch adds SWIG_PUBLIC_API to the .net/Java/PHP binding projects. The
other server/webtier consumer projects do not define this symbol, so they
still see the full set of ACE/xerces headers.

This patch slightly broke the SWIG C++ glue code generation for the current
.net wrapper (list<T> was un-qualified), so SWIG has been patched up to emit
the correct code (use std::list<T>) there as well.

Please review. Thanks.

- Jackie

Sent from:
mapguide-internals mailing list
[hidden email]