[Libreoffice-commits] libmspub.git: inc/libmspub src/lib

Fridrich Å trba fridrich.strba at bluewin.ch
Wed Dec 18 01:54:00 PST 2013


 inc/libmspub/MSPUBDocument.h |   14 ++++++++++++--
 src/lib/MSPUBDocument.cpp    |    4 ++--
 src/lib/Makefile.am          |    2 +-
 3 files changed, 15 insertions(+), 5 deletions(-)

New commits:
commit 30cead30b424282664a70f28636ab290ac7267fb
Author: Fridrich Å trba <fridrich.strba at bluewin.ch>
Date:   Wed Dec 18 10:53:10 2013 +0100

    Export only needed stuff on Windows
    
    Change-Id: I276cdce38ad9b2a8a62ded67f7d34a5bca6a698f

diff --git a/inc/libmspub/MSPUBDocument.h b/inc/libmspub/MSPUBDocument.h
index 284d202..5ae2fd5 100644
--- a/inc/libmspub/MSPUBDocument.h
+++ b/inc/libmspub/MSPUBDocument.h
@@ -32,15 +32,25 @@
 
 #include <librevenge/librevenge.h>
 
+#ifdef DLL_EXPORT
+#ifdef LIBMSPUB_BUILD
+#define PUBAPI __declspec(dllexport)
+#else
+#define PUBAPI __declspec(dllimport)
+#endif
+#else
+#define PUBAPI
+#endif
+
 namespace libmspub
 {
 class MSPUBDocument
 {
 public:
 
-  static bool isSupported(librevenge::RVNGInputStream *input);
+  static PUBAPI bool isSupported(librevenge::RVNGInputStream *input);
 
-  static bool parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
+  static PUBAPI bool parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter);
 };
 
 } // namespace libmspub
diff --git a/src/lib/MSPUBDocument.cpp b/src/lib/MSPUBDocument.cpp
index 0371b00..0d2f184 100644
--- a/src/lib/MSPUBDocument.cpp
+++ b/src/lib/MSPUBDocument.cpp
@@ -99,7 +99,7 @@ Analyzes the content of an input stream to see if it can be parsed
 \return A value that indicates whether the content from the input
 stream is a Microsoft Publisher Document that libmspub is able to parse
 */
-bool libmspub::MSPUBDocument::isSupported(librevenge::RVNGInputStream *input)
+PUBAPI bool libmspub::MSPUBDocument::isSupported(librevenge::RVNGInputStream *input)
 {
   try
   {
@@ -132,7 +132,7 @@ RVNGDrawingInterface class implementation when needed. This is often commonly ca
 \param painter A MSPUBPainterInterface implementation
 \return A value that indicates whether the parsing was successful
 */
-bool libmspub::MSPUBDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
+PUBAPI bool libmspub::MSPUBDocument::parse(librevenge::RVNGInputStream *input, librevenge::RVNGDrawingInterface *painter)
 {
   try
   {
diff --git a/src/lib/Makefile.am b/src/lib/Makefile.am
index 5f98d61..89c06e1 100644
--- a/src/lib/Makefile.am
+++ b/src/lib/Makefile.am
@@ -10,7 +10,7 @@ libmspub_ at MSPUB_MAJOR_VERSION@_ at MSPUB_MINOR_VERSION@_include_HEADERS = \
 	$(top_srcdir)/inc/libmspub/libmspub.h \
 	$(top_srcdir)/inc/libmspub/MSPUBDocument.h
 
-AM_CXXFLAGS = -I$(top_srcdir)/inc $(REVENGE_CFLAGS) $(ZLIB_CFLAGS) $(ICU_CFLAGS) $(DEBUG_CXXFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/inc $(REVENGE_CFLAGS) $(ZLIB_CFLAGS) $(ICU_CFLAGS) $(DEBUG_CXXFLAGS) -DLIBMSPUB_BUILD=1
 
 libmspub_ at MSPUB_MAJOR_VERSION@_ at MSPUB_MINOR_VERSION@_la_LIBADD  = $(REVENGE_LIBS) $(ZLIB_LIBS) $(ICU_LIBS) @LIBMSPUB_WIN32_RESOURCE@
 libmspub_ at MSPUB_MAJOR_VERSION@_ at MSPUB_MINOR_VERSION@_la_DEPENDENCIES = @LIBMSPUB_WIN32_RESOURCE@


More information about the Libreoffice-commits mailing list