diff --git a/server/Makefile.am b/server/Makefile.am index 00450c5f..2f75839b 100644 --- a/server/Makefile.am +++ b/server/Makefile.am @@ -137,6 +137,8 @@ libserver_la_SOURCES = \ net-utils.h \ pixmap-cache.cpp \ pixmap-cache.h \ + pop-visibility.h \ + push-visibility.h \ red-channel.cpp \ red-channel-capabilities.c \ red-channel-capabilities.h \ diff --git a/server/common-graphics-channel.h b/server/common-graphics-channel.h index b19f1413..00cfdd05 100644 --- a/server/common-graphics-channel.h +++ b/server/common-graphics-channel.h @@ -23,7 +23,7 @@ #include "red-channel.h" #include "red-channel-client.h" -G_BEGIN_DECLS +#include "push-visibility.h" #define COMMON_CLIENT_TIMEOUT (NSEC_PER_SEC * 30) @@ -77,6 +77,6 @@ protected: virtual bool config_socket() override; }; -G_END_DECLS +#include "pop-visibility.h" #endif /* COMMON_GRAPHICS_CHANNEL_H_ */ diff --git a/server/cursor-channel-client.h b/server/cursor-channel-client.h index 805012ff..ff208e86 100644 --- a/server/cursor-channel-client.h +++ b/server/cursor-channel-client.h @@ -26,7 +26,7 @@ #include "cursor-channel.h" #include "utils.hpp" -G_BEGIN_DECLS +#include "push-visibility.h" struct CursorChannelClientPrivate; @@ -66,6 +66,6 @@ enum { RED_PIPE_ITEM_TYPE_INVAL_CURSOR_CACHE, }; -G_END_DECLS +#include "pop-visibility.h" #endif /* CURSOR_CHANNEL_CLIENT_H_ */ diff --git a/server/dcc-private.h b/server/dcc-private.h index 13b1b660..7b1643d1 100644 --- a/server/dcc-private.h +++ b/server/dcc-private.h @@ -25,6 +25,8 @@ #include "video-stream.h" #include "red-channel-client.h" +#include "push-visibility.h" + struct DisplayChannelClientPrivate { SPICE_CXX_GLIB_ALLOCATOR @@ -67,4 +69,6 @@ struct DisplayChannelClientPrivate bool gl_draw_ongoing; }; +#include "pop-visibility.h" + #endif /* DCC_PRIVATE_H_ */ diff --git a/server/dcc.h b/server/dcc.h index 20a39ffd..8999bf7c 100644 --- a/server/dcc.h +++ b/server/dcc.h @@ -26,7 +26,7 @@ #include "common-graphics-channel.h" #include "utils.hpp" -G_BEGIN_DECLS +#include "push-visibility.h" struct DisplayChannel; struct DisplayChannelClientPrivate; @@ -197,6 +197,6 @@ gboolean dcc_is_low_bandwidth(DisplayChannelClient *dcc); GArray *dcc_get_preferred_video_codecs_for_encoding(DisplayChannelClient *dcc); void dcc_video_codecs_update(DisplayChannelClient *dcc); -G_END_DECLS +#include "pop-visibility.h" #endif /* DCC_H_ */ diff --git a/server/inputs-channel-client.h b/server/inputs-channel-client.h index 7c802f58..b603cf16 100644 --- a/server/inputs-channel-client.h +++ b/server/inputs-channel-client.h @@ -21,7 +21,7 @@ #include "red-channel-client.h" #include "inputs-channel.h" -G_BEGIN_DECLS +#include "push-visibility.h" class InputsChannelClient final: public RedChannelClient { @@ -65,7 +65,7 @@ RedChannelClient* inputs_channel_client_create(RedChannel *channel, RedStream *stream, RedChannelCapabilities *caps); -G_END_DECLS +#include "pop-visibility.h" enum { RED_PIPE_ITEM_INPUTS_INIT = RED_PIPE_ITEM_TYPE_CHANNEL_BASE, diff --git a/server/main-channel-client.h b/server/main-channel-client.h index da90036a..5d66b161 100644 --- a/server/main-channel-client.h +++ b/server/main-channel-client.h @@ -24,7 +24,7 @@ #include "main-channel.h" #include "utils.hpp" -G_BEGIN_DECLS +#include "push-visibility.h" struct MainChannelClientPrivate; @@ -123,6 +123,6 @@ RedPipeItem *main_multi_media_time_item_new(uint32_t mm_time); RedPipeItem *registered_channel_item_new(RedChannel *channel); -G_END_DECLS +#include "pop-visibility.h" #endif /* MAIN_CHANNEL_CLIENT_H_ */ diff --git a/server/pop-visibility.h b/server/pop-visibility.h new file mode 100644 index 00000000..7aceca1b --- /dev/null +++ b/server/pop-visibility.h @@ -0,0 +1,20 @@ +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + Copyright (C) 2020 Red Hat, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . +*/ +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__MINGW32__) +#pragma GCC visibility pop +#endif diff --git a/server/push-visibility.h b/server/push-visibility.h new file mode 100644 index 00000000..01cd7012 --- /dev/null +++ b/server/push-visibility.h @@ -0,0 +1,20 @@ +/* -*- Mode: C; c-basic-offset: 4; indent-tabs-mode: nil -*- */ +/* + Copyright (C) 2020 Red Hat, Inc. + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, see . +*/ +#if defined(__GNUC__) && __GNUC__ >= 4 && !defined(__MINGW32__) +#pragma GCC visibility push(hidden) +#endif diff --git a/server/red-channel-client.h b/server/red-channel-client.h index 8600b694..57913705 100644 --- a/server/red-channel-client.h +++ b/server/red-channel-client.h @@ -25,7 +25,7 @@ #include "red-channel.h" #include "utils.hpp" -G_BEGIN_DECLS +#include "push-visibility.h" struct RedChannelClientPrivate; @@ -224,6 +224,6 @@ enum { RED_PIPE_ITEM_TYPE_CHANNEL_BASE=101, }; -G_END_DECLS +#include "pop-visibility.h" #endif /* RED_CHANNEL_CLIENT_H_ */ diff --git a/server/red-channel.h b/server/red-channel.h index d6c33a4b..cfe53374 100644 --- a/server/red-channel.h +++ b/server/red-channel.h @@ -40,9 +40,11 @@ G_BEGIN_DECLS SPICE_DECLARE_TYPE(RedChannel, red_channel, CHANNEL); #define RED_TYPE_CHANNEL red_channel_get_type() +#include "push-visibility.h" struct RedChannelClient; struct RedClient; struct MainChannelClient; +#include "pop-visibility.h" typedef void (*channel_client_connect_proc)(RedChannel *channel, RedClient *client, RedStream *stream, int migration, RedChannelCapabilities *caps); diff --git a/server/smartcard-channel-client.h b/server/smartcard-channel-client.h index 21a4d31a..fdff5f0b 100644 --- a/server/smartcard-channel-client.h +++ b/server/smartcard-channel-client.h @@ -21,7 +21,7 @@ #include "smartcard.h" #include "utils.hpp" -G_BEGIN_DECLS +#include "push-visibility.h" struct SmartCardChannelClientPrivate; @@ -64,6 +64,6 @@ void smartcard_channel_client_set_char_device(SmartCardChannelClient *scc, RedCharDeviceSmartcard* smartcard_channel_client_get_char_device(SmartCardChannelClient *scc); -G_END_DECLS +#include "pop-visibility.h" #endif /* SMARTCARD_CHANNEL_CLIENT_H_ */ diff --git a/server/tests/test-channel.cpp b/server/tests/test-channel.cpp index 7723b085..b1a1a4ea 100644 --- a/server/tests/test-channel.cpp +++ b/server/tests/test-channel.cpp @@ -29,6 +29,7 @@ #include "cursor-channel.h" #include "net-utils.h" #include "win-alarm.h" +#include "push-visibility.h" /* * Declare a RedTestChannel to be used for the test diff --git a/server/utils.hpp b/server/utils.hpp index b5abf680..1712cbf1 100644 --- a/server/utils.hpp +++ b/server/utils.hpp @@ -21,6 +21,8 @@ #include +#include "push-visibility.h" + namespace red { @@ -93,3 +95,5 @@ constexpr size_t size(const T (&array)[N]) noexcept } // namespace red + +#include "pop-visibility.h"