Wireshark mailing list archives

Re: Simpifying exporting DLL symbols


From: Bálint Réczey <balint () balintreczey hu>
Date: Wed, 27 Feb 2013 13:47:17 +0100

Hi Gisle,

2013/2/27 Gisle Vanem <gvanem () broadpark no>:
"Bálint Réczey" <balint () balintreczey hu> wrote:

I have created the attached patch to control symbol visibility using
C defines instead of .def and .sym files. It is expected to work on every
platform and every build system we support, but I did not want to
commit it without discussing the direction.


Nice, but why not use nicer indenting to make it more readable?
I think more indentation would look better, but starting #define-s at
the beginning
of the lines also has some value. If you don't mind I will leave
indentation as it is
now, but if we define coding guidelines covering this I won't stick to
this style. :-)


And what about foreign programs that would like to use e.g. libwireshark
code as a static lib? ws_symbol_export.h should IMHO account for this.
Something like:

#if (defined (_WIN32) || defined (__CYGWIN__)) & !defined(WS_STATIC_LIB)
 #ifdef WS_BUILD_DLL
   #ifdef __GNUC__
     #define WS_DLL_PUBLIC __attribute__ ((dllexport))
   #else
     #define WS_DLL_PUBLIC __declspec(dllexport) // Note: actually gcc seems
to also support this syntax.
   #endif
..
Good point, I have updated the patch.
AFAIK only MSVC compilers could have problems with the original #defines thus I
fixed only that case.


There is some interest out there to use libwireshark outside *shark
programs:

http://stackoverflow.com/questions/10308127/using-libwireshark-to-get-wireshark-functionality-programatically

The old Packetyzer 5.0 also uses ethereal libs. See:
 http://sourceforge.net/projects/packetyzer/
There is also netexpect (http://netexpect.org) which is packaged in Debian.
I usually collaborate with its author, Eloy, when I update packaged
libraries in Debian.

The new patch also covers Jakub's very valid concern about old (or
other) compilers
not supporting -fvisibility=hidden.

Cheers,
Balint

Attachment: 0001-Export-libwsutil-symbols-using-WS_DLL_PUBLIC-define.patch
Description:

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: