Enhance FOO_EXPORT macro

Allen Winter winter at kde.org
Sun May 6 15:35:27 BST 2007


On Friday 04 May 2007 8:19:22 am David Faure wrote:
> On Friday 04 May 2007, Christian Ehrlicher wrote:
> > It should be changed after alpha1 is ready, then also the export macro creator (afair someone wrote a small script for this) should be updated.
> 
> Yes, I wrote kdesdk/scripts/kde_generate_export_header for this.
> 
I fixed kde_generate_export_header accordingly.

So, 
% $SVN/trunk/KDE/kdesdk/scripts/kde_generate_export_header  solid_export.h SOLID_EXPORT solid
creates sold_export.h

which looks like:
#ifndef SOLID_EXPORT_H
#define SOLID_EXPORT_H

/* needed for KDE_EXPORT and KDE_IMPORT macros */
#include <kdemacros.h>

/* We use _WIN32/_WIN64 instead of Q_OS_WIN so that this header can be used from C files too */

#ifndef SOLID_EXPORT
# if defined _WIN32 || defined _WIN64
# if defined(MAKE_SOLID_LIB)
   /* We are building this library */ 
#  define SOLID_EXPORT KDE_EXPORT
# else
   /* We are using this library */ 
#  define SOLID_EXPORT KDE_IMPORT
# endif
# else /* UNIX */
#  define SOLID_EXPORT KDE_EXPORT
# endif
#endif

# ifndef SOLID_EXPORT_DEPRECATED
#  define SOLID_EXPORT_DEPRECATED KDE_DEPRECATED SOLID_EXPORT
# endif

#endif





More information about the kde-core-devel mailing list