[PATCH weston] shared: fix matrix build failure
Kristian Høgsberg
hoegsberg at gmail.com
Fri Dec 7 07:33:20 PST 2012
On Fri, Dec 07, 2012 at 03:26:28PM +0200, Pekka Paalanen wrote:
> Fix the error
> matrix.c:27:28: fatal error: wayland-server.h: No such file or directory
>
> The only thing needed from wayland-server.h was WL_EXPORT. It was used
> for exporting the matrix functions from Weston core to the modules.
>
> Remove the use of WL_EXPORT. It is not needed anymore, because core and
> every module will link to the static helper library, and get its own
> copy of the functions.
This will remove the weston_matrix_* symbols from the weston ABI. If
you're an out-of-tree module, you can't just link to ../shared stuff,
so I'd like to keep the symbols in weston.
I talked to Rob about it IRC, he's doing a patch that will link
../shared/matrix.o into weston with a -D define to enable the
wayland-server.h include and the WL_EXPORT. Or maybe we can just
include wayland-util.h instead for the WL_EXPORT #define.
Kristian
> Signed-off-by: Pekka Paalanen <ppaalanen at gmail.com>
> ---
> shared/matrix.c | 13 ++++++-------
> shared/matrix.h | 2 +-
> 2 files changed, 7 insertions(+), 8 deletions(-)
>
> diff --git a/shared/matrix.c b/shared/matrix.c
> index 91acdd3..b746ae4 100644
> --- a/shared/matrix.c
> +++ b/shared/matrix.c
> @@ -24,7 +24,6 @@
> #include <string.h>
> #include <stdlib.h>
> #include <math.h>
> -#include <wayland-server.h>
>
> #include "matrix.h"
>
> @@ -37,7 +36,7 @@
> * 3 7 11 15
> */
>
> -WL_EXPORT void
> +void
> weston_matrix_init(struct weston_matrix *matrix)
> {
> static const struct weston_matrix identity = {
> @@ -48,7 +47,7 @@ weston_matrix_init(struct weston_matrix *matrix)
> }
>
> /* m <- n * m, that is, m is multiplied on the LEFT. */
> -WL_EXPORT void
> +void
> weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n)
> {
> struct weston_matrix tmp;
> @@ -67,7 +66,7 @@ weston_matrix_multiply(struct weston_matrix *m, const struct weston_matrix *n)
> memcpy(m, &tmp, sizeof tmp);
> }
>
> -WL_EXPORT void
> +void
> weston_matrix_translate(struct weston_matrix *matrix, float x, float y, float z)
> {
> struct weston_matrix translate = {
> @@ -77,7 +76,7 @@ weston_matrix_translate(struct weston_matrix *matrix, float x, float y, float z)
> weston_matrix_multiply(matrix, &translate);
> }
>
> -WL_EXPORT void
> +void
> weston_matrix_scale(struct weston_matrix *matrix, float x, float y,float z)
> {
> struct weston_matrix scale = {
> @@ -88,7 +87,7 @@ weston_matrix_scale(struct weston_matrix *matrix, float x, float y,float z)
> }
>
> /* v <- m * v */
> -WL_EXPORT void
> +void
> weston_matrix_transform(struct weston_matrix *matrix, struct weston_vector *v)
> {
> int i, j;
> @@ -230,7 +229,7 @@ inverse_transform(const double *LU, const unsigned *p, float *v)
> v[j] = b[j];
> }
>
> -WL_EXPORT int
> +int
> weston_matrix_invert(struct weston_matrix *inverse,
> const struct weston_matrix *matrix)
> {
> diff --git a/shared/matrix.h b/shared/matrix.h
> index bacb7bf..31a31d3 100644
> --- a/shared/matrix.h
> +++ b/shared/matrix.h
> @@ -49,7 +49,7 @@ weston_matrix_invert(struct weston_matrix *inverse,
> const struct weston_matrix *matrix);
>
> #ifdef UNIT_TEST
> -# define MATRIX_TEST_EXPORT WL_EXPORT
> +# define MATRIX_TEST_EXPORT
>
> int
> matrix_invert(double *A, unsigned *p, const struct weston_matrix *matrix);
> --
> 1.7.8.6
>
More information about the wayland-devel
mailing list