void-packages/srcpkgs/pipewire/patches/fix-glibc-error_h-usage.patch

280 lines
7.8 KiB
Diff

--- spa/tests/test-bluez5.c
+++ spa/tests/test-bluez5.c
@@ -18,7 +18,9 @@
*/
#include <math.h>
+#ifdef __GLIBC__
#include <error.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -209,6 +211,8 @@ int main(int argc, char *argv[])
void *iface;
spa_zero(data);
+
+#ifdef __GLIBC__
if ((res = get_handle(&data, &handle,
"build/spa/plugins/support/libspa-support.so",
"mapper")) < 0) {
@@ -216,6 +220,7 @@ int main(int argc, char *argv[])
}
if ((res = spa_handle_get_interface(handle, 0, &iface)) < 0)
error(-1, res, "can't get mapper interface");
+#endif
data.map = iface;
data.support[0].type = SPA_TYPE__TypeMap;
@@ -224,6 +229,7 @@ int main(int argc, char *argv[])
init_type(&data.type, data.map);
spa_debug_set_type_map(data.map);
+#ifdef __GLIBC__
if ((res = get_handle(&data, &handle,
"build/spa/plugins/support/libspa-support.so",
"logger")) < 0) {
@@ -234,6 +240,7 @@ int main(int argc, char *argv[])
spa_type_map_get_id(data.map, SPA_TYPE__Log),
&iface)) < 0)
error(-1, res, "can't get log interface");
+#endif
data.log = iface;
data.support[1].type = SPA_TYPE__Log;
@@ -243,6 +250,7 @@ int main(int argc, char *argv[])
if ((str = getenv("SPA_DEBUG")))
data.log->level = atoi(str);
+#ifdef __GLIBC__
if ((res = get_handle(&data, &handle,
"build/spa/plugins/support/libspa-support.so",
"loop")) < 0) {
@@ -252,8 +260,11 @@ int main(int argc, char *argv[])
spa_type_map_get_id(data.map, SPA_TYPE__Loop),
&iface)) < 0)
error(-1, res, "can't get loop interface");
+#endif
+
data.loop = iface;
+#ifdef __GLIBC__
if ((res = spa_handle_get_interface(handle,
spa_type_map_get_id(data.map, SPA_TYPE__LoopControl),
&iface)) < 0)
@@ -265,6 +276,7 @@ int main(int argc, char *argv[])
&iface)) < 0)
error(-1, res, "can't get looputils interface");
data.loop_utils = iface;
+#endif
data.support[2].type = SPA_TYPE_LOOP__DataLoop;
data.support[2].data = data.loop;
@@ -276,6 +288,7 @@ int main(int argc, char *argv[])
data.support[5].data = data.loop_utils;
data.n_support = 6;
+#ifdef __GLIBC__
if ((res = get_handle(&data, &handle,
"build/spa/plugins/support/libspa-dbus.so",
"dbus")) < 0) {
@@ -286,12 +299,14 @@ int main(int argc, char *argv[])
spa_type_map_get_id(data.map, SPA_TYPE__DBus),
&iface)) < 0)
error(-1, res, "can't get dbus interface");
+#endif
data.dbus = iface;
data.support[6].type = SPA_TYPE__DBus;
data.support[6].data = data.dbus;
data.n_support = 7;
+#ifdef __GLIBC__
if ((res = get_handle(&data, &handle,
"build/spa/plugins/bluez5/libspa-bluez5.so",
"bluez5-monitor")) < 0) {
@@ -302,6 +317,7 @@ int main(int argc, char *argv[])
spa_type_map_get_id(data.map, SPA_TYPE__Monitor),
&iface)) < 0)
error(-1, res, "can't get monitor interface");
+#endif
data.monitor = iface;
--- spa/tests/test-control.c
+++ spa/tests/test-control.c
@@ -18,7 +18,9 @@
*/
#include <math.h>
+#ifdef __GLIBC__
#include <error.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -358,8 +360,10 @@ static int make_nodes(struct data *data, const char *device)
spa_pod_builder_init(&b, buffer, sizeof(buffer));
if ((res = spa_node_port_enum_params(data->source, SPA_DIRECTION_OUTPUT, 0,
data->type.param_io.idPropsIn, &idx, NULL, &param, &b)) < 1) {
+#ifdef __GLIBC__
if (res < 0)
error(0, -res, "port_enum_params");
+#endif
break;
}
@@ -369,19 +373,23 @@ static int make_nodes(struct data *data, const char *device)
NULL);
if (propId == data->type.props_freq) {
+#ifdef __GLIBC__
if ((res = spa_node_port_set_io(data->source,
SPA_DIRECTION_OUTPUT, 0,
id,
&data->ctrl_source_freq, sizeof(data->ctrl_source_freq))) < 0)
error(0, -res, "set_io freq");
+#endif
}
else if (propId == data->type.props_volume) {
+#ifdef __GLIBC__
if ((res = spa_node_port_set_io(data->source,
SPA_DIRECTION_OUTPUT, 0,
id,
&data->ctrl_source_volume, sizeof(data->ctrl_source_volume))) < 0)
error(0, -res, "set_io volume");
+#endif
}
}
--- spa/tests/test-mixer.c
+++ spa/tests/test-mixer.c
@@ -18,7 +18,9 @@
*/
#include <math.h>
+#ifdef __GLIBC__
#include <error.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -369,8 +371,10 @@ static int make_nodes(struct data *data, const char *device)
":", data->type.props_device, "s", device ? device : "hw:0",
":", data->type.props_min_latency, "i", MIN_LATENCY);
+#ifdef __GLIBC__
if ((res = spa_node_set_param(data->sink, data->type.param.idProps, 0, props)) < 0)
error(0, -res, "set_param props");
+#endif
if ((res = make_node(data, &data->mix,
"build/spa/plugins/audiomixer/libspa-audiomixer.so",
@@ -453,6 +457,7 @@ static int make_nodes(struct data *data, const char *device)
data->ctrl_volume[0] = SPA_POD_DOUBLE_INIT(0.5);
data->ctrl_volume[1] = SPA_POD_DOUBLE_INIT(0.5);
+#ifdef __GLIBC__
if ((res = spa_node_port_set_io(data->mix,
SPA_DIRECTION_INPUT, data->mix_ports[0],
data->type.io_inprop_volume,
@@ -464,6 +469,7 @@ static int make_nodes(struct data *data, const char *device)
data->type.io_inprop_volume,
&data->ctrl_volume[1], sizeof(data->ctrl_volume[1]))) < 0)
error(0, -res, "set_io volume 1");
+#endif
#ifdef USE_GRAPH
--- spa/tools/spa-inspect.c
+++ spa/tools/spa-inspect.c
@@ -17,7 +17,9 @@
* Boston, MA 02110-1301, USA.
*/
+#ifdef __GLIBC__
#include <error.h>
+#endif
#include <string.h>
#include <stdio.h>
#include <stdlib.h>
@@ -71,8 +73,10 @@ inspect_node_params(struct data *data, struct spa_node *node)
if ((res = spa_node_enum_params(node,
data->type.param.idList, &idx1,
NULL, &param, &b)) <= 0) {
+#ifdef __GLIBC__
if (res != 0)
error(0, -res, "enum_params");
+#endif
break;
}
@@ -88,8 +92,10 @@ inspect_node_params(struct data *data, struct spa_node *node)
if ((res = spa_node_enum_params(node,
id, &idx2,
NULL, &param, &b)) <= 0) {
+#ifdef __GLIBC__
if (res != 0)
error(0, -res, "enum_params %d", id);
+#endif
break;
}
spa_debug_pod(param, flags);
@@ -115,8 +121,10 @@ inspect_port_params(struct data *data, struct spa_node *node,
direction, port_id,
data->type.param.idList, &idx1,
NULL, &param, &b)) <= 0) {
+#ifdef __GLIBC__
if (res != 0)
error(0, -res, "port_enum_params");
+#endif
break;
}
spa_pod_object_parse(param,
@@ -132,8 +140,10 @@ inspect_port_params(struct data *data, struct spa_node *node,
direction, port_id,
id, &idx2,
NULL, &param, &b)) <= 0) {
+#ifdef __GLIBC__
if (res != 0)
error(0, -res, "port_enum_params");
+#endif
break;
}
@@ -204,8 +214,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory *
if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) {
if (res == 0)
break;
+#ifdef __GLIBC__
else
error(0, -res, "spa_handle_factory_enum_interface_info");
+#endif
}
printf(" interface: '%s'\n", info->type);
}
@@ -225,8 +237,10 @@ static void inspect_factory(struct data *data, const struct spa_handle_factory *
if ((res = spa_handle_factory_enum_interface_info(factory, &info, &index)) <= 0) {
if (res == 0)
break;
+#ifdef __GLIBC__
else
error(0, -res, "spa_handle_factory_enum_interface_info");
+#endif
}
printf(" interface: '%s'\n", info->type);
@@ -315,8 +329,10 @@ int main(int argc, char *argv[])
const struct spa_handle_factory *factory;
if ((res = enum_func(&factory, &index)) <= 0) {
+#ifdef __GLIBC__
if (res != 0)
error(0, -res, "enum_func");
+#endif
break;
}
inspect_factory(&data, factory);