summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeka Friedrich <friedrix@gmail.com>2022-02-06 22:39:17 +0100
committerJeka Friedrich <friedrix@gmail.com>2022-02-20 16:47:10 +0100
commitd7ae6f01d059cb466a0e28d3c0de7b977161c6c4 (patch)
treecbd177db29c8e48146856c74c080f0b4449a851b
parentea3eb6b70478b3c4860dbbf51d307a783d6c0687 (diff)
downloadwayland-ivi-extension-d7ae6f01d059cb466a0e28d3c0de7b977161c6c4.tar.gz
ilm: remove declaration of a global variable in a header file
fixes following error with the gcc 11.2.0: usr/bin/ld: CMakeFiles/ilmCommon.dir/src/ilm_common_wayland_platform.c.o:(.bss+0x0): multiple definition of `gIlmCommonPlatformFunc'; CMakeFiles/ilmCommon.dir/src/ilm_common.c.o:(.bss+0x0): first defined here collect2: error: ld returned 1 exit status make[2]: *** [ivi-layermanagement-api/ilmCommon/CMakeFiles/ilmCommon.dir/build.make:119: ivi-layermanagement-api/ilmCommon/libilmCommon.so.2.2.0] Error 1 make[1]: *** [CMakeFiles/Makefile2:511: ivi-layermanagement-api/ilmCommon/CMakeFiles/ilmCommon.dir/all] Error 2 ilm_client and ilm_common both has the same issue. fix: move the declaration to the c file and define the variable as "external" in the header file Signed-off-by: Jeka Friedrich <friedrix@gmail.com>
-rw-r--r--ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h2
-rw-r--r--ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c2
-rw-r--r--ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h2
-rw-r--r--ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c2
4 files changed, 6 insertions, 2 deletions
diff --git a/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h b/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
index 1fb10af..f281c3e 100644
--- a/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
+++ b/ivi-layermanagement-api/ilmClient/include/ilm_client_platform.h
@@ -35,7 +35,7 @@ typedef struct _ILM_CLIENT_PLATFORM_FUNC
ilmErrorTypes (*destroy)();
} ILM_CLIENT_PLATFORM_FUNC;
-ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
+extern ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
void init_ilmClientPlatformTable();
diff --git a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
index 55b1621..12052f8 100644
--- a/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmClient/src/ilm_client_wayland_platform.c
@@ -27,6 +27,8 @@
#include "wayland-util.h"
#include "ivi-application-client-protocol.h"
+ILM_CLIENT_PLATFORM_FUNC gIlmClientPlatformFunc;
+
static ilmErrorTypes wayland_surfaceCreate(t_ilm_nativehandle nativehandle,
t_ilm_int width, t_ilm_int height,
ilmPixelFormat pixelFormat,
diff --git a/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h b/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
index 4e7b55e..ec49467 100644
--- a/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
+++ b/ivi-layermanagement-api/ilmCommon/include/ilm_common_platform.h
@@ -32,7 +32,7 @@ typedef struct _ILM_COMMON_PLATFORM_FUNC
ilmErrorTypes (*destroy)();
} ILM_COMMON_PLATFORM_FUNC;
-ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
+extern ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
void init_ilmCommonPlatformTable();
diff --git a/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c b/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
index 7470d0d..eef842d 100644
--- a/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
+++ b/ivi-layermanagement-api/ilmCommon/src/ilm_common_wayland_platform.c
@@ -32,6 +32,8 @@ static t_ilm_nativedisplay wayland_getNativedisplay(void);
static t_ilm_bool wayland_isInitialized(void);
static ilmErrorTypes wayland_destroy(void);
+ILM_COMMON_PLATFORM_FUNC gIlmCommonPlatformFunc;
+
void init_ilmCommonPlatformTable(void)
{
gIlmCommonPlatformFunc.init = wayland_init;