ayaports/user/zotero/nrappkit-qsort.patch

34 lines
1.1 KiB
Diff

missing include to use qsort()
https://bugzil.la/1906955
--- a/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registry_local.c 2024-07-09 18:11:39.207125821 +0200
+++ b/dom/media/webrtc/transport/third_party/nrappkit/src/registry/registry_local.c 2024-07-09 18:12:07.657013364 +0200
@@ -53,6 +53,7 @@
#include <openssl/ssl.h>
#endif
#include <ctype.h>
+#include <stdlib.h>
#include "registry.h"
#include "registry_int.h"
#include "registry_vtbl.h"
@@ -62,6 +63,10 @@
#include "r_errors.h"
#include "r_macros.h"
+static int nr_compare_string(const void *arg1, const void *arg2) {
+ return strcasecmp(*(const char **)arg1, *(const char **)arg2);
+}
+
/* if C were an object-oriented language, nr_scalar_registry_node and
* nr_array_registry_node would subclass nr_registry_node, but it isn't
* object-oriented language, so this is used in cases where the pointer
@@ -1067,7 +1072,7 @@
}
assert(sizeof(*arg.children) == sizeof(NR_registry));
- qsort(arg.children, arg.length, sizeof(*arg.children), (void*)strcasecmp);
+ qsort(arg.children, arg.length, sizeof(*arg.children), nr_compare_string);
*length = arg.length;