[Libreoffice-commits] core.git: include/LibreOfficeKit ios/experimental
Stephan Bergmann
sbergman at redhat.com
Wed Mar 22 08:05:08 UTC 2017
include/LibreOfficeKit/LibreOfficeKitInit.h | 45 ++-----------
ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c | 2
2 files changed, 10 insertions(+), 37 deletions(-)
New commits:
commit 587e9c2d15119927c89d052835ce495af9ff7d19
Author: Stephan Bergmann <sbergman at redhat.com>
Date: Mon Mar 20 21:45:35 2017 +0100
Consistently mark function definitions in LibreOfficeKitInit.h as static
...to give them internal linkage in both C and C++. Of those definitions that
were not marked as static:
* Those that had not been marked as inline had external linkage in both C and
C++, so would have caused ODR violations were LibreOfficeKitInit.h included in
multiple translation units.
* Those that had been marked as inline lacked an external defintion in C.
(Which 3f02b2aa51e32c46d5b6610480bc1ba22156a3ec "LOK init: avoid non-inline
function definition in header file" had apparently faied to take into
account.)
(IOS_SWIFTCBRIDGE introduced in 028ef4748e53aa8f72c6464ce6bbeeb28c61d30c
"LibreOfficeKitInit.h modified to avoid ODR" becomes unnecessary again.)
Change-Id: Ibb8033cdbac87b20fa0e3b203b99571c1a7e7234
Reviewed-on: https://gerrit.libreoffice.org/35491
Tested-by: Jenkins <ci at libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman at redhat.com>
diff --git a/include/LibreOfficeKit/LibreOfficeKitInit.h b/include/LibreOfficeKit/LibreOfficeKitInit.h
index ce8daaf28892..4dafe180cdb6 100644
--- a/include/LibreOfficeKit/LibreOfficeKitInit.h
+++ b/include/LibreOfficeKit/LibreOfficeKitInit.h
@@ -42,12 +42,7 @@ extern "C"
#endif
#define SEPARATOR '/'
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
- inline
-#endif
-#endif
- void *lok_loadlib(const char *pFN)
+ static void *lok_loadlib(const char *pFN)
{
return dlopen(pFN, RTLD_LAZY
#if defined LOK_LOADLIB_GLOBAL
@@ -56,42 +51,22 @@ extern "C"
);
}
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
- inline
-#endif
-#endif
- char *lok_dlerror(void)
+ static char *lok_dlerror(void)
{
return dlerror();
}
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
- inline
-#endif
-#endif
- void *lok_dlsym(void *Hnd, const char *pName)
+ static void *lok_dlsym(void *Hnd, const char *pName)
{
return dlsym(Hnd, pName);
}
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
- inline
-#endif
-#endif
- int lok_dlclose(void *Hnd)
+ static int lok_dlclose(void *Hnd)
{
return dlclose(Hnd);
}
-#ifndef __OBJC__
-#ifndef IOS_SWIFTCBRIDGE
- inline
-#endif
-#endif
- void extendUnoPath(const char *pPath)
+ static void extendUnoPath(const char *pPath)
{
(void)pPath;
}
@@ -104,29 +79,29 @@ extern "C"
#define SEPARATOR '\\'
#define UNOPATH "\\..\\URE\\bin"
- void *lok_loadlib(const char *pFN)
+ static void *lok_loadlib(const char *pFN)
{
return (void *) LoadLibraryA(pFN);
}
- char *lok_dlerror(void)
+ static char *lok_dlerror(void)
{
LPSTR buf = NULL;
FormatMessageA(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0, reinterpret_cast<LPSTR>(&buf), 0, NULL);
return buf;
}
- void *lok_dlsym(void *Hnd, const char *pName)
+ static void *lok_dlsym(void *Hnd, const char *pName)
{
return reinterpret_cast<void *>(GetProcAddress((HINSTANCE) Hnd, pName));
}
- int lok_dlclose(void *Hnd)
+ static int lok_dlclose(void *Hnd)
{
return FreeLibrary((HINSTANCE) Hnd);
}
- void extendUnoPath(const char *pPath)
+ static void extendUnoPath(const char *pPath)
{
if (!pPath)
return;
diff --git a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
index 539713d95160..748c601f268e 100755
--- a/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
+++ b/ios/experimental/LibreOfficeLight/LibreOfficeLight/lokit.c
@@ -7,9 +7,7 @@
//
#include <stdio.h>
#define LOK_USE_UNSTABLE_API
-#define IOS_SWIFTCBRIDGE
#include <LibreOfficeKit/LibreOfficeKitInit.h>
-#undef IOS_SWIFTCBRIDGE
// pointers to our instance
static LibreOfficeKit* kit;
More information about the Libreoffice-commits
mailing list