Opened 6 years ago

Closed 6 years ago

Last modified 5 years ago

#2781 closed defect (fixed)

Find a way to not leak ACE/xerces headers/definitions in MapGuide common headers

Reported by: jng Owned by: jng
Priority: high Milestone: 4.0
Component: Build System Version: 3.1.0
Severity: trivial Keywords:
Cc: External ID:

Description (last modified by jng)

The SWIG bindings do not call anything in ace or xerces, but due to their headers/types leaking out of Foundation/MapGuideCommon, this gives us grief when building the PHP api due to its headers conflicting with ACE on certain platform definitions (eg. uid_t, gid_t, struct dirent). Also the leaking of xerces headers is completely unnecessary

Our current workaround has been to overlay patched PHP headers to resolve such conflicts, but this is not a tenable solution. We should either properly encapsulate or #ifdef any traces of ACE and xerces out of these headers when building SWIG bindings.

Attachments (1)

2781.patch (68.8 KB ) - added by jng 6 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by jng, 6 years ago

Description: modified (diff)
Summary: Find a way to not leak ACE headers/definitions in MapGuide common headersFind a way to not leak ACE/xerces headers/definitions in MapGuide common headers

comment:2 by jng, 6 years ago

Description: modified (diff)

by jng, 6 years ago

Attachment: 2781.patch added

comment:3 by jng, 6 years ago

Resolution: fixed
Status: assignedclosed

In 9393:

Introduce a new preprocessor symbol SWIG_PUBLIC_API

With this symbol, we #ifdef out and forward-declare as much of ACE and xerces types and headers in our MapGuide common headers. The only ACE header that is leaked out now is the header for ACE_Recursive_Thread_Mutex as that is present as member of several classes in the public MapGuide API surface.

In our SWIG binding projects, SWIG_PUBLIC_API is defined. All other consuming projects do not define this symbol so they see the original set of ACE and xerces headers.

This change slightly breaks the SWIG C++ glue code for .net (which used un-qualified list), so our internal copy of SWIG is updated to use fully qualified list (std::list) and our various SWIG parameter files include the <list> header.

This change eliminates the need for us to maintain a patched copy of TSRM/readdir.h for PHP, so that is removed.

Fixes #2781

comment:4 by jng, 6 years ago

In 9396:

Merged revision(s) 9393-9395 from branches/3.1/MgDev:
Introduce a new preprocessor symbol SWIG_PUBLIC_API

With this symbol, we #ifdef out and forward-declare as much of ACE and xerces types and headers in our MapGuide common headers. The only ACE header that is leaked out now is the header for ACE_Recursive_Thread_Mutex as that is present as member of several classes in the public MapGuide API surface.

In our SWIG binding projects, SWIG_PUBLIC_API is defined. All other consuming projects do not define this symbol so they see the original set of ACE and xerces headers.

This change slightly breaks the SWIG C++ glue code for .net (which used un-qualified list), so our internal copy of SWIG is updated to use fully qualified list (std::list) and our various SWIG parameter files include the <list> header.

This change eliminates the need for us to maintain a patched copy of TSRM/readdir.h for PHP, so that is removed.

Fixes #2781
........
#2781: Remove xerces include and linker settings
........
#2781: Limit the scope of these changes to Windows. Linux never had these conflicts, so no need to apply any of these changes there.
........

comment:5 by jng, 5 years ago

Milestone: 3.34.0

Milestone renamed

Note: See TracTickets for help on using tickets.