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

Commit c52b303

Browse files
Fix custom FlValue API not being exported (#51154)
Would fail to link when using it in a Flutter app.
1 parent 024ea68 commit c52b303

File tree

6 files changed

+30
-21
lines changed

6 files changed

+30
-21
lines changed

shell/platform/linux/fl_standard_message_codec.cc

Lines changed: 20 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -639,9 +639,10 @@ G_MODULE_EXPORT FlStandardMessageCodec* fl_standard_message_codec_new() {
639639
g_object_new(fl_standard_message_codec_get_type(), nullptr));
640640
}
641641

642-
void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
643-
GByteArray* buffer,
644-
uint32_t size) {
642+
G_MODULE_EXPORT void fl_standard_message_codec_write_size(
643+
FlStandardMessageCodec* codec,
644+
GByteArray* buffer,
645+
uint32_t size) {
645646
if (size < 254) {
646647
write_uint8(buffer, size);
647648
} else if (size <= 0xffff) {
@@ -653,11 +654,12 @@ void fl_standard_message_codec_write_size(FlStandardMessageCodec* codec,
653654
}
654655
}
655656

656-
gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
657-
GBytes* buffer,
658-
size_t* offset,
659-
uint32_t* value,
660-
GError** error) {
657+
G_MODULE_EXPORT gboolean fl_standard_message_codec_read_size(
658+
FlStandardMessageCodec* codec,
659+
GBytes* buffer,
660+
size_t* offset,
661+
uint32_t* value,
662+
GError** error) {
661663
uint8_t value8;
662664
if (!read_uint8(buffer, offset, &value8, error)) {
663665
return FALSE;
@@ -680,18 +682,20 @@ gboolean fl_standard_message_codec_read_size(FlStandardMessageCodec* codec,
680682
return TRUE;
681683
}
682684

683-
gboolean fl_standard_message_codec_write_value(FlStandardMessageCodec* self,
684-
GByteArray* buffer,
685-
FlValue* value,
686-
GError** error) {
685+
G_MODULE_EXPORT gboolean fl_standard_message_codec_write_value(
686+
FlStandardMessageCodec* self,
687+
GByteArray* buffer,
688+
FlValue* value,
689+
GError** error) {
687690
return FL_STANDARD_MESSAGE_CODEC_GET_CLASS(self)->write_value(self, buffer,
688691
value, error);
689692
}
690693

691-
FlValue* fl_standard_message_codec_read_value(FlStandardMessageCodec* self,
692-
GBytes* buffer,
693-
size_t* offset,
694-
GError** error) {
694+
G_MODULE_EXPORT FlValue* fl_standard_message_codec_read_value(
695+
FlStandardMessageCodec* self,
696+
GBytes* buffer,
697+
size_t* offset,
698+
GError** error) {
695699
uint8_t type;
696700
if (!read_uint8(buffer, offset, &type, error)) {
697701
return nullptr;

shell/platform/linux/fl_value.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -371,9 +371,9 @@ G_MODULE_EXPORT FlValue* fl_value_new_map() {
371371
return reinterpret_cast<FlValue*>(self);
372372
}
373373

374-
FlValue* fl_value_new_custom(int type,
375-
gconstpointer value,
376-
GDestroyNotify destroy_notify) {
374+
G_MODULE_EXPORT FlValue* fl_value_new_custom(int type,
375+
gconstpointer value,
376+
GDestroyNotify destroy_notify) {
377377
FlValueCustom* self = reinterpret_cast<FlValueCustom*>(
378378
fl_value_new(FL_VALUE_TYPE_CUSTOM, sizeof(FlValueCustom)));
379379
self->type = type;
@@ -382,11 +382,12 @@ FlValue* fl_value_new_custom(int type,
382382
return reinterpret_cast<FlValue*>(self);
383383
}
384384

385-
FlValue* fl_value_new_custom_object(int type, GObject* object) {
385+
G_MODULE_EXPORT FlValue* fl_value_new_custom_object(int type, GObject* object) {
386386
return fl_value_new_custom(type, g_object_ref(object), g_object_unref);
387387
}
388388

389-
FlValue* fl_value_new_custom_object_take(int type, GObject* object) {
389+
G_MODULE_EXPORT FlValue* fl_value_new_custom_object_take(int type,
390+
GObject* object) {
390391
return fl_value_new_custom(type, object, g_object_unref);
391392
}
392393

shell/platform/linux/public/flutter_linux/fl_binary_messenger.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ typedef enum {
3232
FL_BINARY_MESSENGER_ERROR_ALREADY_RESPONDED,
3333
} FlBinaryMessengerError;
3434

35+
G_MODULE_EXPORT
3536
GQuark fl_binary_messenger_codec_error_quark(void) G_GNUC_CONST;
3637

3738
G_MODULE_EXPORT

shell/platform/linux/public/flutter_linux/fl_json_message_codec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ typedef enum {
3434
// NOLINTEND(readability-identifier-naming)
3535
} FlJsonMessageCodecError;
3636

37+
G_MODULE_EXPORT
3738
GQuark fl_json_message_codec_error_quark(void) G_GNUC_CONST;
3839

3940
G_MODULE_EXPORT

shell/platform/linux/public/flutter_linux/fl_message_codec.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ typedef enum {
3838
// NOLINTEND(readability-identifier-naming)
3939
} FlMessageCodecError;
4040

41+
G_MODULE_EXPORT
4142
GQuark fl_message_codec_error_quark(void) G_GNUC_CONST;
4243

4344
G_MODULE_EXPORT

shell/platform/linux/public/flutter_linux/fl_method_response.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ typedef enum {
3737
// NOLINTEND(readability-identifier-naming)
3838
} FlMethodResponseError;
3939

40+
G_MODULE_EXPORT
4041
GQuark fl_method_response_error_quark(void) G_GNUC_CONST;
4142

4243
G_MODULE_EXPORT

0 commit comments

Comments
 (0)