[OpendTect_Developers] mClass on Windows
Nanne Hemstra
nanne.hemstra at dgbes.com
Wed Nov 23 06:42:50 CET 2011
Hi all,
If you have done some browsing through our code, you must have noticed that
we the use the 'mClass' macro when we declare a new type in stead of the
using the 'class' keyword.
On Unix this macro expands to nothing more than 'class', On Windows
however, 'mClass' translates to 'class __declspec( dllexport )'. The macro
is defined in '$WORK/include/Basic/commondefs.h' btw.
As the Windows developers among us know, this '__declspec( dllexport )' is
required to make sure the class is exposed and usable in other modules, or
dll's. For example the BufferString class is declared in our Basic module,
and has to be exported before we can use it in for instance the Algo
module.
We find this mClass macro a good solution to prevent code pollution with
Windows specific stuff. But is this the standard way of doing it? What
solutions did you all come up with?
Looking forward to hear your experiences.
Best regards,
Nanne
--
Nanne Hemstra
Executive Vice President - Americas
dGB Earth Sciences
1, Sugar Creek Center Blvd - Suite 935
Sugar Land, Tx, 77478 - USA
Phone: +1 281-240-3939, Fax: +1 281-240-3944
http://www.dgbes.com , http://www.opendtect.org
Join us on facebook <http://www.facebook.com/OpendTect>!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opendtect.org/pipermail/developers/attachments/20111122/59109d88/attachment.html>
More information about the Developers
mailing list