Hi Dan, On Tue, Apr 4, 2017 at 9:52 AM, Daniel Mihai via iotivity-dev < iotivity-dev at lists.iotivity.org> wrote:
> 2. Different OS?s/platforms seem to have different requirements. > For example: > > a. If I understand correctly, non-static C functions in a *Linux* > shared library can be called by anyone outside the shared library. > > b. On *Windows*, we need to identify those functions that can be > called by anyone outside the shared library, and explicitly add them to the > exports list, one by one. > > Does this mean that all of the functions from (a) and (b) are Public and > cannot get breaking changes? That?s typically the approach on Windows, but > it is not clear to me if is the proper approach on Linux too. > On platforms that use GCC, including Linux, we can leverage GCC's symbol visibility feature <https://gcc.gnu.org/wiki/Visibility> to prevent functions, classes, etc, from being exported in a manner that is similar to Windows. The GCC Visibility wiki provides an example of how one could declare and use the import and export macros one sees in Windows libraries in manner that supports both Windows and GCC based builds. Library binaries that correctly leverage GCC symbol visibility often gain improved performance as well as a smaller footprint. It would be useful for IoTivity to leverage GCC symbol visibility if it isn't already doing so. HTH, -Ossama -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.iotivity.org/pipermail/iotivity-dev/attachments/20170404/9ade9731/attachment.html>
