aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXin LI <delphij@FreeBSD.org>2022-09-30 20:34:40 +0000
committerXin LI <delphij@FreeBSD.org>2022-09-30 22:28:04 +0000
commita7c48b30a0ac7dac2ecf8d4dc3acdf5c5c02c452 (patch)
tree14689ca0140ec3b1394f6fd55ad8f6005c92ce80
parent82665ce295c0cdd2494bf09356d169ef28442a0a (diff)
security/hashcat: unbreak on -CURRENT after GNU qsort_r
PR: ports/266227 Exp-run by: antoine Approved by: portmgr
-rw-r--r--security/hashcat/files/patch-include_sort__r.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/security/hashcat/files/patch-include_sort__r.h b/security/hashcat/files/patch-include_sort__r.h
new file mode 100644
index 000000000000..3e1d0e0d9d33
--- /dev/null
+++ b/security/hashcat/files/patch-include_sort__r.h
@@ -0,0 +1,33 @@
+--- include/sort_r.h.orig 2022-09-02 14:58:13 UTC
++++ include/sort_r.h
+@@ -25,10 +25,10 @@ Slightly modified to work with hashcat to no falsly de
+ */
+
+ #if (defined __APPLE__ || defined __MACH__ || defined __DARWIN__ || \
+- defined __FreeBSD__ || defined __DragonFly__ || defined __NetBSD__)
++ (defined __FreeBSD__ && !defined(qsort_r)) || defined __DragonFly__ || defined __NetBSD__)
+ # define _SORT_R_BSD
+ # define _SORT_R_INLINE inline
+-#elif (defined __linux__) || defined (__CYGWIN__)
++#elif (defined __linux__) || defined (__CYGWIN__) || (defined (__FreeBSD__) && defined(qsort_r))
+ # define _SORT_R_LINUX
+ # define _SORT_R_INLINE inline
+ #elif (defined _WIN32 || defined _WIN64 || defined __WINDOWS__)
+@@ -167,7 +167,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, s
+ #if defined _SORT_R_LINUX
+
+ typedef int(* __compar_d_fn_t)(const void *, const void *, void *);
+- extern void qsort_r(void *base, size_t nel, size_t width,
++ extern void (qsort_r)(void *base, size_t nel, size_t width,
+ __compar_d_fn_t __compar, void *arg)
+ __attribute__((nonnull (1, 4)));
+
+@@ -186,7 +186,7 @@ static _SORT_R_INLINE void sort_r_simple(void *base, s
+ /* no qsort_r in glibc before 2.8, need to use nested qsort */
+ sort_r_simple(base, nel, width, compar, arg);
+
+- #elif defined __GLIBC__
++ #elif defined __GLIBC__ || (defined(__FreeBSD__) && defined(qsort_r))
+
+ qsort_r(base, nel, width, compar, arg);
+