Use better method of ensuring that *_get_type() functions are exported (flutter/engine#43395)
As discovered in https://stackoverflow.com/a/63264068/1950237
This commit is contained in:
@@ -33,9 +33,6 @@ struct _FlBasicMessageChannelResponseHandle {
|
||||
FlBinaryMessengerResponseHandle* response_handle;
|
||||
};
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_basic_message_channel_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlBasicMessageChannel, fl_basic_message_channel, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE(FlBasicMessageChannelResponseHandle,
|
||||
fl_basic_message_channel_response_handle,
|
||||
|
||||
@@ -10,9 +10,6 @@
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_binary_messenger_get_type();
|
||||
|
||||
G_DEFINE_QUARK(fl_binary_messenger_codec_error_quark,
|
||||
fl_binary_messenger_codec_error)
|
||||
|
||||
|
||||
@@ -40,9 +40,6 @@ struct _FlEventChannelResponseHandle {
|
||||
FlBinaryMessengerResponseHandle* response_handle;
|
||||
};
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_event_channel_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlEventChannel, fl_event_channel, G_TYPE_OBJECT)
|
||||
|
||||
// Handle method calls from the Dart side of the channel.
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
|
||||
G_DEFINE_QUARK(fl_message_codec_error_quark, fl_message_codec_error)
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_message_codec_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlMessageCodec, fl_message_codec, G_TYPE_OBJECT)
|
||||
|
||||
static void fl_message_codec_class_init(FlMessageCodecClass* klass) {}
|
||||
|
||||
@@ -31,9 +31,6 @@ struct _FlMethodChannel {
|
||||
GDestroyNotify method_call_handler_destroy_notify;
|
||||
};
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_method_channel_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlMethodChannel, fl_method_channel, G_TYPE_OBJECT)
|
||||
|
||||
// Called when a binary message is received on this channel.
|
||||
|
||||
@@ -7,9 +7,6 @@
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_method_codec_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlMethodCodec, fl_method_codec, G_TYPE_OBJECT)
|
||||
|
||||
static void fl_method_codec_class_init(FlMethodCodecClass* klass) {}
|
||||
|
||||
@@ -26,12 +26,6 @@ struct _FlMethodNotImplementedResponse {
|
||||
FlMethodResponse parent_instance;
|
||||
};
|
||||
|
||||
// Added here to stop the compiler from optimizing these functions away.
|
||||
G_MODULE_EXPORT GType fl_method_response_get_type();
|
||||
G_MODULE_EXPORT GType fl_method_success_response_get_type();
|
||||
G_MODULE_EXPORT GType fl_method_error_response_get_type();
|
||||
G_MODULE_EXPORT GType fl_method_not_implemented_response_get_type();
|
||||
|
||||
G_DEFINE_TYPE(FlMethodResponse, fl_method_response, G_TYPE_OBJECT)
|
||||
G_DEFINE_TYPE(FlMethodSuccessResponse,
|
||||
fl_method_success_response,
|
||||
|
||||
@@ -16,9 +16,6 @@ typedef struct {
|
||||
|
||||
static void fl_pixel_buffer_texture_iface_init(FlTextureInterface* iface);
|
||||
|
||||
// Added here to stop the compiler from optimising this function away.
|
||||
G_MODULE_EXPORT GType fl_pixel_buffer_texture_get_type();
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE(
|
||||
FlPixelBufferTexture,
|
||||
fl_pixel_buffer_texture,
|
||||
|
||||
@@ -26,9 +26,6 @@ struct _FlPluginRegistrarImpl {
|
||||
FlTextureRegistrar* texture_registrar;
|
||||
};
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_plugin_registrar_get_type();
|
||||
|
||||
static void fl_plugin_registrar_impl_iface_init(
|
||||
FlPluginRegistrarInterface* iface);
|
||||
|
||||
|
||||
@@ -6,9 +6,6 @@
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
// Added here to stop the compiler from optimizing this function away.
|
||||
G_MODULE_EXPORT GType fl_plugin_registry_get_type();
|
||||
|
||||
G_DEFINE_INTERFACE(FlPluginRegistry, fl_plugin_registry, G_TYPE_OBJECT)
|
||||
|
||||
void fl_plugin_registry_default_init(FlPluginRegistryInterface* self) {}
|
||||
|
||||
@@ -8,9 +8,6 @@
|
||||
#include <gmodule.h>
|
||||
#include <cstdio>
|
||||
|
||||
// Added here to stop the compiler from optimising this function away.
|
||||
G_MODULE_EXPORT GType fl_texture_get_type();
|
||||
|
||||
G_DEFINE_INTERFACE(FlTexture, fl_texture, G_TYPE_OBJECT)
|
||||
|
||||
static void fl_texture_default_init(FlTextureInterface* self) {}
|
||||
|
||||
@@ -15,9 +15,6 @@ typedef struct {
|
||||
|
||||
static void fl_texture_gl_texture_iface_init(FlTextureInterface* iface);
|
||||
|
||||
// Added here to stop the compiler from optimising this function away.
|
||||
G_MODULE_EXPORT GType fl_texture_gl_get_type();
|
||||
|
||||
G_DEFINE_TYPE_WITH_CODE(FlTextureGL,
|
||||
fl_texture_gl,
|
||||
G_TYPE_OBJECT,
|
||||
|
||||
@@ -11,18 +11,21 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_binary_messenger.h"
|
||||
#include "fl_message_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlBasicMessageChannel,
|
||||
fl_basic_message_channel,
|
||||
FL,
|
||||
BASIC_MESSAGE_CHANNEL,
|
||||
GObject)
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlBasicMessageChannelResponseHandle,
|
||||
fl_basic_message_channel_response_handle,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_message_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlBinaryCodec,
|
||||
fl_binary_codec,
|
||||
FL,
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
@@ -29,12 +30,14 @@ typedef enum {
|
||||
|
||||
GQuark fl_binary_messenger_codec_error_quark(void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_INTERFACE(FlBinaryMessenger,
|
||||
fl_binary_messenger,
|
||||
FL,
|
||||
BINARY_MESSENGER,
|
||||
GObject)
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlBinaryMessengerResponseHandle,
|
||||
fl_binary_messenger_response_handle,
|
||||
FL,
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#define FLUTTER_SHELL_PLATFORM_LINUX_FL_DART_PROJECT_H_
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#if !defined(__FLUTTER_LINUX_INSIDE__) && !defined(FLUTTER_LINUX_COMPILATION)
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
@@ -13,6 +14,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlDartProject, fl_dart_project, FL, DART_PROJECT, GObject)
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_binary_messenger.h"
|
||||
#include "fl_dart_project.h"
|
||||
@@ -17,6 +18,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlEngine, fl_engine, FL, ENGINE, GObject)
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_binary_messenger.h"
|
||||
#include "fl_method_channel.h"
|
||||
@@ -18,6 +19,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlEventChannel,
|
||||
fl_event_channel,
|
||||
FL,
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_message_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
@@ -32,6 +34,7 @@ typedef enum {
|
||||
|
||||
GQuark fl_json_message_codec_error_quark(void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlJsonMessageCodec,
|
||||
fl_json_message_codec,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_method_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlJsonMethodCodec,
|
||||
fl_json_method_codec,
|
||||
FL,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_value.h"
|
||||
|
||||
@@ -37,6 +38,7 @@ typedef enum {
|
||||
|
||||
GQuark fl_message_codec_error_quark(void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlMessageCodec,
|
||||
fl_message_codec,
|
||||
FL,
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_method_response.h"
|
||||
#include "fl_value.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlMethodCall, fl_method_call, FL, METHOD_CALL, GObject)
|
||||
|
||||
/**
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
|
||||
#include <gio/gio.h>
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_binary_messenger.h"
|
||||
#include "fl_method_call.h"
|
||||
@@ -19,6 +20,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlMethodChannel,
|
||||
fl_method_channel,
|
||||
FL,
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_method_response.h"
|
||||
#include "fl_value.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlMethodCodec,
|
||||
fl_method_codec,
|
||||
FL,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_value.h"
|
||||
|
||||
@@ -36,6 +37,7 @@ typedef enum {
|
||||
|
||||
GQuark fl_method_response_error_quark(void) G_GNUC_CONST;
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlMethodResponse,
|
||||
fl_method_response,
|
||||
FL,
|
||||
@@ -46,18 +48,21 @@ struct _FlMethodResponseClass {
|
||||
GObjectClass parent_class;
|
||||
};
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlMethodSuccessResponse,
|
||||
fl_method_success_response,
|
||||
FL,
|
||||
METHOD_SUCCESS_RESPONSE,
|
||||
FlMethodResponse)
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlMethodErrorResponse,
|
||||
fl_method_error_response,
|
||||
FL,
|
||||
METHOD_ERROR_RESPONSE,
|
||||
FlMethodResponse)
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlMethodNotImplementedResponse,
|
||||
fl_method_not_implemented_response,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_texture.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlPixelBufferTexture,
|
||||
fl_pixel_buffer_texture,
|
||||
FL,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_binary_messenger.h"
|
||||
#include "fl_texture_registrar.h"
|
||||
@@ -17,6 +18,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_INTERFACE(FlPluginRegistrar,
|
||||
fl_plugin_registrar,
|
||||
FL,
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_plugin_registrar.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_INTERFACE(FlPluginRegistry,
|
||||
fl_plugin_registry,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_message_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlStandardMessageCodec,
|
||||
fl_standard_message_codec,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_method_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlStandardMethodCodec,
|
||||
fl_standard_method_codec,
|
||||
FL,
|
||||
|
||||
@@ -9,10 +9,13 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
|
||||
#include "fl_message_codec.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlStringCodec,
|
||||
fl_string_codec,
|
||||
FL,
|
||||
|
||||
@@ -10,10 +10,12 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include <stdint.h>
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_INTERFACE(FlTexture, fl_texture, FL, TEXTURE, GObject)
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,11 +10,13 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include <stdint.h>
|
||||
#include "fl_texture.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_DERIVABLE_TYPE(FlTextureGL, fl_texture_gl, FL, TEXTURE_GL, GObject)
|
||||
|
||||
/**
|
||||
|
||||
@@ -10,12 +10,14 @@
|
||||
#endif
|
||||
|
||||
#include <glib-object.h>
|
||||
#include <gmodule.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "fl_texture.h"
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_INTERFACE(FlTextureRegistrar,
|
||||
fl_texture_registrar,
|
||||
FL,
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
#error "Only <flutter_linux/flutter_linux.h> can be included directly."
|
||||
#endif
|
||||
|
||||
#include <gmodule.h>
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include "fl_dart_project.h"
|
||||
@@ -16,6 +17,7 @@
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
G_MODULE_EXPORT
|
||||
G_DECLARE_FINAL_TYPE(FlView, fl_view, FL, VIEW, GtkBox)
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user