Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

Commit 1d2f3d6

Browse files
Use better method of ensuring that *_get_type() functions are exported (#43395)
As discovered in https://stackoverflow.com/a/63264068/1950237
1 parent b328b03 commit 1d2f3d6

35 files changed

+58
-39
lines changed

shell/platform/linux/fl_basic_message_channel.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,6 @@ struct _FlBasicMessageChannelResponseHandle {
3333
FlBinaryMessengerResponseHandle* response_handle;
3434
};
3535

36-
// Added here to stop the compiler from optimizing this function away.
37-
G_MODULE_EXPORT GType fl_basic_message_channel_get_type();
38-
3936
G_DEFINE_TYPE(FlBasicMessageChannel, fl_basic_message_channel, G_TYPE_OBJECT)
4037
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle,
4138
fl_basic_message_channel_response_handle,

shell/platform/linux/fl_binary_messenger.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,6 @@
1010

1111
#include <gmodule.h>
1212

13-
// Added here to stop the compiler from optimizing this function away.
14-
G_MODULE_EXPORT GType fl_binary_messenger_get_type();
15-
1613
G_DEFINE_QUARK(fl_binary_messenger_codec_error_quark,
1714
fl_binary_messenger_codec_error)
1815

shell/platform/linux/fl_event_channel.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ struct _FlEventChannelResponseHandle {
4040
FlBinaryMessengerResponseHandle* response_handle;
4141
};
4242

43-
// Added here to stop the compiler from optimizing this function away.
44-
G_MODULE_EXPORT GType fl_event_channel_get_type();
45-
4643
G_DEFINE_TYPE(FlEventChannel, fl_event_channel, G_TYPE_OBJECT)
4744

4845
// Handle method calls from the Dart side of the channel.

shell/platform/linux/fl_message_codec.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@
88

99
G_DEFINE_QUARK(fl_message_codec_error_quark, fl_message_codec_error)
1010

11-
// Added here to stop the compiler from optimizing this function away.
12-
G_MODULE_EXPORT GType fl_message_codec_get_type();
13-
1411
G_DEFINE_TYPE(FlMessageCodec, fl_message_codec, G_TYPE_OBJECT)
1512

1613
static void fl_message_codec_class_init(FlMessageCodecClass* klass) {}

shell/platform/linux/fl_method_channel.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,6 @@ struct _FlMethodChannel {
3131
GDestroyNotify method_call_handler_destroy_notify;
3232
};
3333

34-
// Added here to stop the compiler from optimizing this function away.
35-
G_MODULE_EXPORT GType fl_method_channel_get_type();
36-
3734
G_DEFINE_TYPE(FlMethodChannel, fl_method_channel, G_TYPE_OBJECT)
3835

3936
// Called when a binary message is received on this channel.

shell/platform/linux/fl_method_codec.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77

88
#include <gmodule.h>
99

10-
// Added here to stop the compiler from optimizing this function away.
11-
G_MODULE_EXPORT GType fl_method_codec_get_type();
12-
1310
G_DEFINE_TYPE(FlMethodCodec, fl_method_codec, G_TYPE_OBJECT)
1411

1512
static void fl_method_codec_class_init(FlMethodCodecClass* klass) {}

shell/platform/linux/fl_method_response.cc

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,6 @@ struct _FlMethodNotImplementedResponse {
2626
FlMethodResponse parent_instance;
2727
};
2828

29-
// Added here to stop the compiler from optimizing these functions away.
30-
G_MODULE_EXPORT GType fl_method_response_get_type();
31-
G_MODULE_EXPORT GType fl_method_success_response_get_type();
32-
G_MODULE_EXPORT GType fl_method_error_response_get_type();
33-
G_MODULE_EXPORT GType fl_method_not_implemented_response_get_type();
34-
3529
G_DEFINE_TYPE(FlMethodResponse, fl_method_response, G_TYPE_OBJECT)
3630
G_DEFINE_TYPE(FlMethodSuccessResponse,
3731
fl_method_success_response,

shell/platform/linux/fl_pixel_buffer_texture.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@ typedef struct {
1616

1717
static void fl_pixel_buffer_texture_iface_init(FlTextureInterface* iface);
1818

19-
// Added here to stop the compiler from optimising this function away.
20-
G_MODULE_EXPORT GType fl_pixel_buffer_texture_get_type();
21-
2219
G_DEFINE_TYPE_WITH_CODE(
2320
FlPixelBufferTexture,
2421
fl_pixel_buffer_texture,

shell/platform/linux/fl_plugin_registrar.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,6 @@ struct _FlPluginRegistrarImpl {
2626
FlTextureRegistrar* texture_registrar;
2727
};
2828

29-
// Added here to stop the compiler from optimizing this function away.
30-
G_MODULE_EXPORT GType fl_plugin_registrar_get_type();
31-
3229
static void fl_plugin_registrar_impl_iface_init(
3330
FlPluginRegistrarInterface* iface);
3431

shell/platform/linux/fl_plugin_registry.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@
66

77
#include <gmodule.h>
88

9-
// Added here to stop the compiler from optimizing this function away.
10-
G_MODULE_EXPORT GType fl_plugin_registry_get_type();
11-
129
G_DEFINE_INTERFACE(FlPluginRegistry, fl_plugin_registry, G_TYPE_OBJECT)
1310

1411
void fl_plugin_registry_default_init(FlPluginRegistryInterface* self) {}

0 commit comments

Comments
 (0)