Fix custom FlValue API not being exported (flutter/engine#51154)

Would fail to link when using it in a Flutter app.
This commit is contained in:
Robert Ancell
2024-03-04 15:05:41 +13:00
committed by GitHub
parent 8c09cffb92
commit 614df9461d
6 changed files with 30 additions and 21 deletions

View File

@@ -639,9 +639,10 @@ G_MODULE_EXPORT FlStandardMessageCodec* fl_standard_message_codec_new() {
g_object_new(fl_standard_message_codec_get_type(), nullptr));
}
void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
GByteArray* buffer,
uint32_t size) {
G_MODULE_EXPORT void fl_standard_message_codec_write_size(
FlStandardMessageCodec* codec,
GByteArray* buffer,
uint32_t size) {
if (size < 254) {
write_uint8(buffer, size);
} else if (size <= 0xffff) {
@@ -653,11 +654,12 @@ void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
}
}
gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
GBytes* buffer,
size_t* offset,
uint32_t* value,
GError** error) {
G_MODULE_EXPORT gboolean fl_standard_message_codec_read_size(
FlStandardMessageCodec* codec,
GBytes* buffer,
size_t* offset,
uint32_t* value,
GError** error) {
uint8_t value8;
if (!read_uint8(buffer, offset, &value8, error)) {
return FALSE;
@@ -680,18 +682,20 @@ gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
return TRUE;
}
gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec* self,
GByteArray* buffer,
FlValue* value,
GError** error) {
G_MODULE_EXPORT gboolean fl_standard_message_codec_write_value(
FlStandardMessageCodec* self,
GByteArray* buffer,
FlValue* value,
GError** error) {
return FL_STANDARD_MESSAGE_CODEC_GET_CLASS(self)->write_value(self, buffer,
value, error);
}
FlValue* fl_standard_message_codec_read_value(FlStandardMessageCodec* self,
GBytes* buffer,
size_t* offset,
GError** error) {
G_MODULE_EXPORT FlValue* fl_standard_message_codec_read_value(
FlStandardMessageCodec* self,
GBytes* buffer,
size_t* offset,
GError** error) {
uint8_t type;
if (!read_uint8(buffer, offset, &type, error)) {
return nullptr;

View File

@@ -371,9 +371,9 @@ G_MODULE_EXPORT FlValue* fl_value_new_map() {
return reinterpret_cast<FlValue*>(self);
}
FlValue* fl_value_new_custom(int type,
gconstpointer value,
GDestroyNotify destroy_notify) {
G_MODULE_EXPORT FlValue* fl_value_new_custom(int type,
gconstpointer value,
GDestroyNotify destroy_notify) {
FlValueCustom* self = reinterpret_cast<FlValueCustom*>(
fl_value_new(FL_VALUE_TYPE_CUSTOM, sizeof(FlValueCustom)));
self->type = type;
@@ -382,11 +382,12 @@ FlValue* fl_value_new_custom(int type,
return reinterpret_cast<FlValue*>(self);
}
FlValue* fl_value_new_custom_object(int type, GObject* object) {
G_MODULE_EXPORT FlValue* fl_value_new_custom_object(int type, GObject* object) {
return fl_value_new_custom(type, g_object_ref(object), g_object_unref);
}
FlValue* fl_value_new_custom_object_take(int type, GObject* object) {
G_MODULE_EXPORT FlValue* fl_value_new_custom_object_take(int type,
GObject* object) {
return fl_value_new_custom(type, object, g_object_unref);
}

View File

@@ -32,6 +32,7 @@ typedef enum {
FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED,
} FlBinaryMessengerError;
G_MODULE_EXPORT
GQuark fl_binary_messenger_codec_error_quark(void) G_GNUC_CONST;
G_MODULE_EXPORT

View File

@@ -34,6 +34,7 @@ typedef enum {
// NOLINTEND(readability-identifier-naming)
} FlJsonMessageCodecError;
G_MODULE_EXPORT
GQuark fl_json_message_codec_error_quark(void) G_GNUC_CONST;
G_MODULE_EXPORT

View File

@@ -38,6 +38,7 @@ typedef enum {
// NOLINTEND(readability-identifier-naming)
} FlMessageCodecError;
G_MODULE_EXPORT
GQuark fl_message_codec_error_quark(void) G_GNUC_CONST;
G_MODULE_EXPORT

View File

@@ -37,6 +37,7 @@ typedef enum {
// NOLINTEND(readability-identifier-naming)
} FlMethodResponseError;
G_MODULE_EXPORT
GQuark fl_method_response_error_quark(void) G_GNUC_CONST;
G_MODULE_EXPORT