Skip to content

Commit a0fd59d

Browse files
committed
DisplayServer (Linux): don't try to inline functions with variable arguments
1 parent 1c352bb commit a0fd59d

4 files changed

Lines changed: 50 additions & 48 deletions

File tree

src/detection/displayserver/linux/wayland/global-output.c

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ static struct wl_output_listener outputListener = {
6464
};
6565

6666
static struct zxdg_output_v1_listener zxdgOutputListener = {
67-
.logical_position = (void*) stubListener,
67+
.logical_position = (void*) ffWaylandStubListener,
6868
.logical_size = handleXdgLogicalSize,
69-
.done = (void*) stubListener,
69+
.done = (void*) ffWaylandStubListener,
7070
.name = (void*) ffWaylandOutputNameListener,
7171
.description = (void*) ffWaylandOutputDescriptionListener,
7272
};
@@ -84,17 +84,17 @@ static void handleWpTfNamed(void *data, [[maybe_unused]] struct wp_image_descrip
8484
}
8585

8686
static const struct wp_image_description_info_v1_listener wpImageDescInfoListener = {
87-
.done = (void*) stubListener,
88-
.icc_file = (void*) stubListener,
89-
.primaries = (void*) stubListener,
90-
.primaries_named = (void*) stubListener,
91-
.tf_power = (void*) stubListener,
87+
.done = (void*) ffWaylandStubListener,
88+
.icc_file = (void*) ffWaylandStubListener,
89+
.primaries = (void*) ffWaylandStubListener,
90+
.primaries_named = (void*) ffWaylandStubListener,
91+
.tf_power = (void*) ffWaylandStubListener,
9292
.tf_named = (void*) handleWpTfNamed,
93-
.luminances = (void*) stubListener,
94-
.target_primaries = (void*) stubListener,
95-
.target_luminance = (void*) stubListener,
96-
.target_max_cll = (void*) stubListener,
97-
.target_max_fall = (void*) stubListener,
93+
.luminances = (void*) ffWaylandStubListener,
94+
.target_primaries = (void*) ffWaylandStubListener,
95+
.target_luminance = (void*) ffWaylandStubListener,
96+
.target_max_cll = (void*) ffWaylandStubListener,
97+
.target_max_fall = (void*) ffWaylandStubListener,
9898
};
9999

100100
const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {

src/detection/displayserver/linux/wayland/kde-output.c

Lines changed: 32 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ static const struct kde_output_device_mode_v2_listener modeListener = {
3333
.size = waylandKdeModeSizeListener,
3434
.refresh = waylandKdeModeRefreshListener,
3535
.preferred = waylandKdeModePreferredListener,
36-
.removed = (void*) stubListener,
37-
.flags = (void*) stubListener,
36+
.removed = (void*) ffWaylandStubListener,
37+
.flags = (void*) ffWaylandStubListener,
3838
};
3939

4040
static void waylandKdeModeListener(void* data, [[maybe_unused]] struct kde_output_device_v2* _, struct kde_output_device_mode_v2* mode) {
@@ -160,39 +160,39 @@ static struct kde_output_device_v2_listener outputListener = {
160160
.scale = waylandKdeScaleListener,
161161
.edid = waylandKdeEdidListener,
162162
.enabled = waylandKdeEnabledListener,
163-
.uuid = (void*) stubListener,
164-
.serial_number = (void*) stubListener,
165-
.eisa_id = (void*) stubListener,
166-
.capabilities = (void*) stubListener,
167-
.overscan = (void*) stubListener,
168-
.vrr_policy = (void*) stubListener,
169-
.rgb_range = (void*) stubListener,
163+
.uuid = (void*) ffWaylandStubListener,
164+
.serial_number = (void*) ffWaylandStubListener,
165+
.eisa_id = (void*) ffWaylandStubListener,
166+
.capabilities = (void*) ffWaylandStubListener,
167+
.overscan = (void*) ffWaylandStubListener,
168+
.vrr_policy = (void*) ffWaylandStubListener,
169+
.rgb_range = (void*) ffWaylandStubListener,
170170
.name = waylandKdeNameListener,
171171
.high_dynamic_range = waylandKdeHdrListener,
172-
.sdr_brightness = (void*) stubListener,
173-
.wide_color_gamut = (void*) stubListener,
174-
.auto_rotate_policy = (void*) stubListener,
175-
.icc_profile_path = (void*) stubListener,
176-
.brightness_metadata = (void*) stubListener,
177-
.brightness_overrides = (void*) stubListener,
178-
.sdr_gamut_wideness = (void*) stubListener,
179-
.color_profile_source = (void*) stubListener,
180-
.brightness = (void*) stubListener,
181-
.color_power_tradeoff = (void*) stubListener,
182-
.dimming = (void*) stubListener,
183-
.replication_source = (void*) stubListener,
184-
.ddc_ci_allowed = (void*) stubListener,
172+
.sdr_brightness = (void*) ffWaylandStubListener,
173+
.wide_color_gamut = (void*) ffWaylandStubListener,
174+
.auto_rotate_policy = (void*) ffWaylandStubListener,
175+
.icc_profile_path = (void*) ffWaylandStubListener,
176+
.brightness_metadata = (void*) ffWaylandStubListener,
177+
.brightness_overrides = (void*) ffWaylandStubListener,
178+
.sdr_gamut_wideness = (void*) ffWaylandStubListener,
179+
.color_profile_source = (void*) ffWaylandStubListener,
180+
.brightness = (void*) ffWaylandStubListener,
181+
.color_power_tradeoff = (void*) ffWaylandStubListener,
182+
.dimming = (void*) ffWaylandStubListener,
183+
.replication_source = (void*) ffWaylandStubListener,
184+
.ddc_ci_allowed = (void*) ffWaylandStubListener,
185185
.max_bits_per_color = (void*) waylandKdeMaxBitsPerColorListener,
186-
.max_bits_per_color_range = (void*) stubListener,
187-
.automatic_max_bits_per_color_limit = (void*) stubListener,
188-
.edr_policy = (void*) stubListener,
189-
.sharpness = (void*) stubListener,
186+
.max_bits_per_color_range = (void*) ffWaylandStubListener,
187+
.automatic_max_bits_per_color_limit = (void*) ffWaylandStubListener,
188+
.edr_policy = (void*) ffWaylandStubListener,
189+
.sharpness = (void*) ffWaylandStubListener,
190190
.priority = waylandKdePriorityListener,
191-
.auto_brightness = (void*) stubListener,
192-
.removed = (void*) stubListener,
193-
.hdr_icc_profile_path = (void*) stubListener,
194-
.hdr_color_profile_source = (void*) stubListener,
195-
.abm_level = (void*) stubListener,
191+
.auto_brightness = (void*) ffWaylandStubListener,
192+
.removed = (void*) ffWaylandStubListener,
193+
.hdr_icc_profile_path = (void*) ffWaylandStubListener,
194+
.hdr_color_profile_source = (void*) ffWaylandStubListener,
195+
.abm_level = (void*) ffWaylandStubListener,
196196
};
197197

198198
static const char* waylandKdeHandleOutput(WaylandData* wldata, struct wl_proxy* output) {
@@ -300,7 +300,7 @@ static void waylandKdeOutputListener(void* data, [[maybe_unused]] struct kde_out
300300

301301
static struct kde_output_device_registry_v2_listener registryListener = {
302302
.output = waylandKdeOutputListener,
303-
.finished = (void*) stubListener,
303+
.finished = (void*) ffWaylandStubListener,
304304
};
305305

306306
const char* ffWaylandHandleKdeOutputRegistry(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {

src/detection/displayserver/linux/wayland/wayland.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
292292

293293
struct wl_registry_listener registry_listener = {
294294
.global = waylandGlobalAddListener,
295-
.global_remove = (void*) stubListener
295+
.global_remove = (void*) ffWaylandStubListener
296296
};
297297

298298
data.ffwl_proxy_add_listener(registry, (void (**)(void)) &registry_listener, &data);
@@ -378,6 +378,10 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
378378
return nullptr;
379379
}
380380

381+
void ffWaylandStubListener(...) {
382+
// no-op
383+
}
384+
381385
#else
382386

383387
const char* ffdsConnectWayland([[maybe_unused]] FFDisplayServerResult* result) {

src/detection/displayserver/linux/wayland/wayland.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,7 @@ typedef struct WaylandDisplay {
6868
bool done;
6969
} WaylandDisplay;
7070

71-
inline static void stubListener(void* data, ...) {
72-
(void) data;
73-
}
71+
void ffWaylandStubListener(...);
7472

7573
inline static uint64_t ffWaylandGenerateIdFromName(const char* name) {
7674
uint64_t id = 0;

0 commit comments

Comments
 (0)