DisplayServer (Linux): don't try to inline functions with variable arguments

This commit is contained in:
Carter Li
2026-07-14 11:05:17 +08:00
parent 62fe9e1d11
commit 2299439873
4 changed files with 52 additions and 50 deletions
@@ -54,7 +54,7 @@ static void handleXdgLogicalSize(void* data, FF_A_UNUSED struct zxdg_output_v1*
static void* outputListener[] = {
waylandOutputGeometryListener, // geometry
waylandOutputModeListener, // mode
stubListener, // done
ffWaylandStubListener, // done
waylandOutputScaleListener, // scale
ffWaylandOutputNameListener, // name
ffWaylandOutputDescriptionListener, // description
@@ -64,9 +64,9 @@ static_assert(
"sizeof(outputListener) is too small. Please report it to fastfetch github issue");
static struct zxdg_output_v1_listener zxdgOutputListener = {
.logical_position = (void*) stubListener,
.logical_position = (void*) ffWaylandStubListener,
.logical_size = handleXdgLogicalSize,
.done = (void*) stubListener,
.done = (void*) ffWaylandStubListener,
.name = (void*) ffWaylandOutputNameListener,
.description = (void*) ffWaylandOutputDescriptionListener,
};
@@ -84,17 +84,17 @@ static void handleWpTfNamed(void *data, FF_A_UNUSED struct wp_image_description_
}
static const struct wp_image_description_info_v1_listener wpImageDescInfoListener = {
.done = (void*) stubListener,
.icc_file = (void*) stubListener,
.primaries = (void*) stubListener,
.primaries_named = (void*) stubListener,
.tf_power = (void*) stubListener,
.done = (void*) ffWaylandStubListener,
.icc_file = (void*) ffWaylandStubListener,
.primaries = (void*) ffWaylandStubListener,
.primaries_named = (void*) ffWaylandStubListener,
.tf_power = (void*) ffWaylandStubListener,
.tf_named = (void*) handleWpTfNamed,
.luminances = (void*) stubListener,
.target_primaries = (void*) stubListener,
.target_luminance = (void*) stubListener,
.target_max_cll = (void*) stubListener,
.target_max_fall = (void*) stubListener,
.luminances = (void*) ffWaylandStubListener,
.target_primaries = (void*) ffWaylandStubListener,
.target_luminance = (void*) ffWaylandStubListener,
.target_max_cll = (void*) ffWaylandStubListener,
.target_max_fall = (void*) ffWaylandStubListener,
};
const char* ffWaylandHandleGlobalOutput(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
@@ -33,8 +33,8 @@ static const struct kde_output_device_mode_v2_listener modeListener = {
.size = waylandKdeModeSizeListener,
.refresh = waylandKdeModeRefreshListener,
.preferred = waylandKdeModePreferredListener,
.removed = (void*) stubListener,
.flags = (void*) stubListener,
.removed = (void*) ffWaylandStubListener,
.flags = (void*) ffWaylandStubListener,
};
static void waylandKdeModeListener(void* data, FF_A_UNUSED struct kde_output_device_v2* _, struct kde_output_device_mode_v2* mode) {
@@ -151,43 +151,43 @@ static struct kde_output_device_v2_listener outputListener = {
.geometry = waylandKdeGeometryListener,
.current_mode = waylandKdeCurrentModeListener,
.mode = waylandKdeModeListener,
.done = (void*) stubListener,
.done = (void*) ffWaylandStubListener,
.scale = waylandKdeScaleListener,
.edid = waylandKdeEdidListener,
.enabled = waylandKdeEnabledListener,
.uuid = (void*) stubListener,
.serial_number = (void*) stubListener,
.eisa_id = (void*) stubListener,
.capabilities = (void*) stubListener,
.overscan = (void*) stubListener,
.vrr_policy = (void*) stubListener,
.rgb_range = (void*) stubListener,
.uuid = (void*) ffWaylandStubListener,
.serial_number = (void*) ffWaylandStubListener,
.eisa_id = (void*) ffWaylandStubListener,
.capabilities = (void*) ffWaylandStubListener,
.overscan = (void*) ffWaylandStubListener,
.vrr_policy = (void*) ffWaylandStubListener,
.rgb_range = (void*) ffWaylandStubListener,
.name = waylandKdeNameListener,
.high_dynamic_range = waylandKdeHdrListener,
.sdr_brightness = (void*) stubListener,
.wide_color_gamut = (void*) stubListener,
.auto_rotate_policy = (void*) stubListener,
.icc_profile_path = (void*) stubListener,
.brightness_metadata = (void*) stubListener,
.brightness_overrides = (void*) stubListener,
.sdr_gamut_wideness = (void*) stubListener,
.color_profile_source = (void*) stubListener,
.brightness = (void*) stubListener,
.color_power_tradeoff = (void*) stubListener,
.dimming = (void*) stubListener,
.replication_source = (void*) stubListener,
.ddc_ci_allowed = (void*) stubListener,
.sdr_brightness = (void*) ffWaylandStubListener,
.wide_color_gamut = (void*) ffWaylandStubListener,
.auto_rotate_policy = (void*) ffWaylandStubListener,
.icc_profile_path = (void*) ffWaylandStubListener,
.brightness_metadata = (void*) ffWaylandStubListener,
.brightness_overrides = (void*) ffWaylandStubListener,
.sdr_gamut_wideness = (void*) ffWaylandStubListener,
.color_profile_source = (void*) ffWaylandStubListener,
.brightness = (void*) ffWaylandStubListener,
.color_power_tradeoff = (void*) ffWaylandStubListener,
.dimming = (void*) ffWaylandStubListener,
.replication_source = (void*) ffWaylandStubListener,
.ddc_ci_allowed = (void*) ffWaylandStubListener,
.max_bits_per_color = (void*) waylandKdeMaxBitsPerColorListener,
.max_bits_per_color_range = (void*) stubListener,
.automatic_max_bits_per_color_limit = (void*) stubListener,
.edr_policy = (void*) stubListener,
.sharpness = (void*) stubListener,
.max_bits_per_color_range = (void*) ffWaylandStubListener,
.automatic_max_bits_per_color_limit = (void*) ffWaylandStubListener,
.edr_policy = (void*) ffWaylandStubListener,
.sharpness = (void*) ffWaylandStubListener,
.priority = waylandKdePriorityListener,
.auto_brightness = (void*) stubListener,
.removed = (void*) stubListener,
.hdr_icc_profile_path = (void*) stubListener,
.hdr_color_profile_source = (void*) stubListener,
.abm_level = (void*) stubListener,
.auto_brightness = (void*) ffWaylandStubListener,
.removed = (void*) ffWaylandStubListener,
.hdr_icc_profile_path = (void*) ffWaylandStubListener,
.hdr_color_profile_source = (void*) ffWaylandStubListener,
.abm_level = (void*) ffWaylandStubListener,
};
static const char* waylandKdeHandleOutput(WaylandData* wldata, struct wl_proxy* output) {
@@ -288,7 +288,7 @@ static void waylandKdeOutputListener(void* data, FF_A_UNUSED struct kde_output_d
static struct kde_output_device_registry_v2_listener registryListener = {
.output = waylandKdeOutputListener,
.finished = (void*) stubListener,
.finished = (void*) ffWaylandStubListener,
};
const char* ffWaylandHandleKdeOutputRegistry(WaylandData* wldata, struct wl_registry* registry, uint32_t name, uint32_t version) {
@@ -253,7 +253,7 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
struct wl_registry_listener registry_listener = {
.global = waylandGlobalAddListener,
.global_remove = (void*) stubListener
.global_remove = (void*) ffWaylandStubListener
};
data.ffwl_proxy_add_listener(registry, (void (**)(void)) &registry_listener, &data);
@@ -339,6 +339,10 @@ const char* ffdsConnectWayland(FFDisplayServerResult* result) {
return NULL;
}
void ffWaylandStubListener(void* data, ...) {
FF_UNUSED(data);
}
#else
const char* ffdsConnectWayland(FF_A_UNUSED FFDisplayServerResult* result) {
@@ -60,9 +60,7 @@ typedef struct WaylandDisplay {
bool primary;
} WaylandDisplay;
inline static void stubListener(void* data, ...) {
(void) data;
}
void ffWaylandStubListener(void* data, ...);
inline static uint64_t ffWaylandGenerateIdFromName(const char* name) {
uint64_t id = 0;