summaryrefslogtreecommitdiff
path: root/libdecor/build/fl_libdecor.c
diff options
context:
space:
mode:
authorManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-04-20 13:35:53 +0200
committerManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com>2024-04-20 13:35:53 +0200
commit7ec6f96d9c53f23e9137a2deea2cbf71f959534e (patch)
tree9026b2aed8decf9542500f0d44cfbce8fdbbe17c /libdecor/build/fl_libdecor.c
parentd2bd3c62408945227bb13133ad6ce270851b4872 (diff)
Add "fl_" prefix to libdecor symbols when using the built-in copy of libdecor
This allows client apps to use other versions of libdecor if they wish, just like what FLTK already does with libpng and libjpeg.
Diffstat (limited to 'libdecor/build/fl_libdecor.c')
-rw-r--r--libdecor/build/fl_libdecor.c15
1 files changed, 10 insertions, 5 deletions
diff --git a/libdecor/build/fl_libdecor.c b/libdecor/build/fl_libdecor.c
index 71a4fc324..702682718 100644
--- a/libdecor/build/fl_libdecor.c
+++ b/libdecor/build/fl_libdecor.c
@@ -1,7 +1,7 @@
//
// Interface with the libdecor library for the Fast Light Tool Kit (FLTK).
//
-// Copyright 2022-2023 by Bill Spitzak and others.
+// Copyright 2022-2024 by Bill Spitzak and others.
//
// This library is free software. Distribution and use rights are outlined in
// the file "COPYING" which should have been included with this file. If this
@@ -22,15 +22,20 @@
# define HAVE_XDG_SHELL_V6 1
#endif
-#define libdecor_frame_set_minimized libdecor_frame_set_minimized_orig
-#define libdecor_new libdecor_new_orig
#include <dlfcn.h>
static void *dlopen_corrected(const char *, int);
#define dlopen(A, B) dlopen_corrected(A, B)
+#include "fl_libdecor.h"
+#undef libdecor_new
+#define libdecor_new libdecor_new_orig
+#undef libdecor_frame_set_minimized
+#define libdecor_frame_set_minimized libdecor_frame_set_minimized_orig
#include "../src/libdecor.c"
#undef dlopen
#undef libdecor_frame_set_minimized
#undef libdecor_new
+#define libdecor_new fl_libdecor_new
+#define libdecor_frame_set_minimized fl_libdecor_frame_set_minimized
extern bool fl_libdecor_using_weston(void);
extern const struct libdecor_plugin_description *fl_libdecor_plugin_description;
@@ -57,7 +62,7 @@ static void *dlopen_corrected(const char *filename, int flags) {
}
-LIBDECOR_EXPORT void libdecor_frame_set_minimized(struct libdecor_frame *frame)
+void fl_libdecor_frame_set_minimized(struct libdecor_frame *frame)
{
static bool done = false;
static bool using_weston = false;
@@ -104,7 +109,7 @@ LIBDECOR_EXPORT void libdecor_frame_set_minimized(struct libdecor_frame *frame)
so a plugin may be loaded that way only if FLTK was built with FLTK_USE_SYSTEM_LIBDECOR turned ON.
*/
-LIBDECOR_EXPORT struct libdecor *libdecor_new(struct wl_display *wl_display, const struct libdecor_interface *iface)
+struct libdecor *fl_libdecor_new(struct wl_display *wl_display, const struct libdecor_interface *iface)
{
struct libdecor *context;
context = zalloc(sizeof *context);