[Libreoffice-commits] core.git: Branch 'feature/lok_sofficemain' - 2 commits - include/LibreOfficeKit libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk libreofficekit/Library_libreofficekitgtk.mk libreofficekit/Module_libreofficekit.mk libreofficekit/qa libreofficekit/source libreofficekit/StaticLibrary_libreofficekit.mk smoketest/Executable_libtest.mk smoketest/libtest.cxx
Andrzej Hunt
andrzej.hunt at collabora.com
Mon Jul 28 22:18:35 PDT 2014
Rebased ref, commits from common ancestor:
commit cd79bf9cbffaf1a00e0eea5a66a10d5992887749
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Tue Jul 29 07:18:28 2014 +0200
Upgrade lokconf_init to LibreOfficeKitInit.h
Change-Id: I0581a107c3eefd33c25b003afe9f7be217598441
diff --git a/libreofficekit/qa/lokconf_init/lokconf_init.cxx b/libreofficekit/qa/lokconf_init/lokconf_init.cxx
index 9677159..aa12bc9 100644
--- a/libreofficekit/qa/lokconf_init/lokconf_init.cxx
+++ b/libreofficekit/qa/lokconf_init/lokconf_init.cxx
@@ -14,6 +14,7 @@
#include <sal/main.h>
#include <LibreOfficeKit/LibreOfficeKit.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
using namespace std;
commit e6c75f1c9d589df8b0b2cee3ee2be90ac76647bb
Author: Andrzej Hunt <andrzej.hunt at collabora.com>
Date: Mon Jul 28 20:23:03 2014 +0200
Kill the libreofficekit static library / shim.c.
It looks like the cleanest method of getting lok_init into
a LibreOfficeKitInit.h header (in a c89 compatible way) is to
have it as a static function.
(inline is only available in C99 or later -- this is actually
available on Linux which is the only place that we can actually
use lok_init anyways currently, however given we have to keep
c89 for the C code (for MSVC) compatibility, selectively enabling
c99 would likely be more messy.)
Conflicts:
libreofficekit/Module_libreofficekit.mk
Change-Id: I0493e7a68ed5397479220bb6ba8c3db870b6dd32
diff --git a/include/LibreOfficeKit/LibreOfficeKit.h b/include/LibreOfficeKit/LibreOfficeKit.h
index 675eabc..9c74634 100644
--- a/include/LibreOfficeKit/LibreOfficeKit.h
+++ b/include/LibreOfficeKit/LibreOfficeKit.h
@@ -105,8 +105,6 @@ struct _LibreOfficeKitDocumentClass
#endif // LOK_USE_UNSTABLE_API
};
-LibreOfficeKit* lok_init (const char* pInstallPath);
-
#ifdef __cplusplus
}
#endif
diff --git a/libreofficekit/source/shim.c b/include/LibreOfficeKit/LibreOfficeKitInit.h
similarity index 80%
rename from libreofficekit/source/shim.c
rename to include/LibreOfficeKit/LibreOfficeKitInit.h
index b533a61..ef01b1c 100644
--- a/libreofficekit/source/shim.c
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -7,17 +7,24 @@
* file, You can obtain one at http://mozilla.org/MPL/2.0/.
*/
-#ifdef LINUX
+#ifndef INCLUDED_DESKTOP_INC_LIBREOFFICEKIT_INIT_H
+#define INCLUDED_DESKTOP_INC_LIBREOFFICEKIT_INIT_H
+
+#include "LibreOfficeKit.h"
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif
+
+#if defined(__linux__) || defined(_AIX)
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sal/types.h>
-#include <LibreOfficeKit/LibreOfficeKit.h>
-
#include <dlfcn.h>
-#ifdef AIX
+#ifdef _AIX
# include <sys/ldr.h>
#endif
@@ -26,7 +33,7 @@
typedef LibreOfficeKit *(HookFunction)( const char *install_path);
-SAL_DLLPUBLIC_EXPORT LibreOfficeKit *lok_init( const char *install_path )
+static LibreOfficeKit *lok_init( const char *install_path )
{
char *imp_lib;
size_t partial_length;
@@ -58,7 +65,8 @@ SAL_DLLPUBLIC_EXPORT LibreOfficeKit *lok_init( const char *install_path )
dlhandle = dlopen(imp_lib, RTLD_LAZY);
if (!dlhandle)
{
- fprintf(stderr, "failed to open library '%s' or '%s' in '%s/'\n", TARGET_LIB, TARGET_MERGED_LIB, install_path);
+ fprintf(stderr, "failed to open library '%s' or '%s' in '%s/'\n",
+ TARGET_LIB, TARGET_MERGED_LIB, install_path);
free(imp_lib);
return NULL;
}
@@ -77,6 +85,12 @@ SAL_DLLPUBLIC_EXPORT LibreOfficeKit *lok_init( const char *install_path )
return pSym( install_path );
}
-#endif // not LINUX => port me !
+#endif // defined(__linux__) || defined(_AIX)
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
index 9159a24..acc708f 100644
--- a/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
+++ b/libreofficekit/CppunitTest_libreofficekit_tiledrendering.mk
@@ -41,10 +41,6 @@ endif
$(eval $(call gb_CppunitTest_use_sdk_api,libreofficekit_tiledrendering))
-$(eval $(call gb_CppunitTest_use_static_libraries,libreofficekit_tiledrendering,\
- libreofficekit \
-))
-
$(eval $(call gb_CppunitTest_use_ure,libreofficekit_tiledrendering))
#$(eval $(call gb_CppunitTest_use_vcl,libreofficekit_tiledrendering))
diff --git a/libreofficekit/Library_libreofficekitgtk.mk b/libreofficekit/Library_libreofficekitgtk.mk
index be485cd..bcf1a5b 100644
--- a/libreofficekit/Library_libreofficekitgtk.mk
+++ b/libreofficekit/Library_libreofficekitgtk.mk
@@ -14,10 +14,6 @@ $(eval $(call gb_Library_use_externals,libreofficekitgtk,\
gtk \
))
-$(eval $(call gb_Library_use_static_libraries,libreofficekitgtk,\
- libreofficekit \
-))
-
$(eval $(call gb_Library_add_cobjects,libreofficekitgtk,\
libreofficekit/source/gtk/lokdocview \
))
diff --git a/libreofficekit/Module_libreofficekit.mk b/libreofficekit/Module_libreofficekit.mk
index 8523b1a..075cbdd 100644
--- a/libreofficekit/Module_libreofficekit.mk
+++ b/libreofficekit/Module_libreofficekit.mk
@@ -12,7 +12,6 @@ $(eval $(call gb_Module_Module,libreofficekit))
ifeq ($(OS),LINUX)
$(eval $(call gb_Module_add_targets,libreofficekit,\
- StaticLibrary_libreofficekit \
Executable_lokconf_init \
))
diff --git a/libreofficekit/StaticLibrary_libreofficekit.mk b/libreofficekit/StaticLibrary_libreofficekit.mk
deleted file mode 100644
index 7a82670..0000000
--- a/libreofficekit/StaticLibrary_libreofficekit.mk
+++ /dev/null
@@ -1,16 +0,0 @@
-# -*- Mode: makefile-gmake; tab-width: 4; indent-tabs-mode: t -*-
-#
-# This file is part of the LibreOffice project.
-#
-# This Source Code Form is subject to the terms of the Mozilla Public
-# License, v. 2.0. If a copy of the MPL was not distributed with this
-# file, You can obtain one at http://mozilla.org/MPL/2.0/.
-#
-
-$(eval $(call gb_StaticLibrary_StaticLibrary,libreofficekit))
-
-$(eval $(call gb_StaticLibrary_add_cobjects,libreofficekit,\
- libreofficekit/source/shim \
-))
-
-# vim: set noet sw=4 ts=4:
diff --git a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
index 1887442..21cb179 100644
--- a/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
+++ b/libreofficekit/qa/gtktiledviewer/gtktiledviewer.cxx
@@ -14,6 +14,7 @@
#include <gtk/gtk.h>
#include <LibreOfficeKit/LibreOfficeKitGtk.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include "../lokdocview_quad/lokdocview_quad.h"
static int help()
diff --git a/libreofficekit/qa/unit/tiledrendering.cxx b/libreofficekit/qa/unit/tiledrendering.cxx
index b231eb0..73958e2 100644
--- a/libreofficekit/qa/unit/tiledrendering.cxx
+++ b/libreofficekit/qa/unit/tiledrendering.cxx
@@ -23,6 +23,7 @@
#include <vcl/pngwrite.hxx>
#define LOK_USE_UNSTABLE_API
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>
using namespace ::boost;
diff --git a/smoketest/Executable_libtest.mk b/smoketest/Executable_libtest.mk
index 881e604..3b3bd16 100644
--- a/smoketest/Executable_libtest.mk
+++ b/smoketest/Executable_libtest.mk
@@ -17,10 +17,6 @@ $(eval $(call gb_Executable_use_libraries,libtest,\
$(gb_UWINAPI) \
))
-$(eval $(call gb_Executable_use_static_libraries,libtest,\
- libreofficekit \
-))
-
$(eval $(call gb_Executable_add_libs,libtest,\
-ldl \
-pthread \
diff --git a/smoketest/libtest.cxx b/smoketest/libtest.cxx
index 8a0b724..91bbcae 100644
--- a/smoketest/libtest.cxx
+++ b/smoketest/libtest.cxx
@@ -14,6 +14,7 @@
#include <math.h>
#include <sys/time.h>
#include <sal/types.h>
+#include <LibreOfficeKit/LibreOfficeKitInit.h>
#include <LibreOfficeKit/LibreOfficeKit.hxx>
using namespace ::lok;
More information about the Libreoffice-commits
mailing list