Changeset View
Changeset View
Standalone View
Standalone View
graphics/mesa-dri/files/patch-meson.build
- This file was added.
--- meson.build.orig 2022-03-18 19:26:47 UTC | |||||
+++ meson.build | |||||
@@ -1414,11 +1414,42 @@ foreach f : ['strtof', 'mkostemp', 'timespec_get', 'me | |||||
endforeach | |||||
foreach f : ['strtof', 'mkostemp', 'timespec_get', 'memfd_create', 'random_r', | |||||
- 'flock', 'strtok_r', 'getrandom', 'qsort_r', 'qsort_s'] | |||||
+ 'flock', 'strtok_r', 'getrandom', 'qsort_s'] | |||||
if cc.has_function(f) | |||||
pre_args += '-DHAVE_@0@'.format(f.to_upper()) | |||||
endif | |||||
endforeach | |||||
+ | |||||
+if cpp.links(''' | |||||
+ #define _GNU_SOURCE | |||||
+ #include <stdlib.h> | |||||
+ | |||||
+ static int dcomp(const void *l, const void *r, void *t) { return 0; } | |||||
+ | |||||
+ int main(int ac, char **av) { | |||||
+ int arr[] = { 1 }; | |||||
+ void *t = NULL; | |||||
+ qsort_r((void*)&arr[0], 1, 1, dcomp, t); | |||||
+ return (0); | |||||
+ }''', | |||||
+ args : pre_args, | |||||
+ name : 'GNU qsort_r') | |||||
+ pre_args += '-DHAVE_GNU_QSORT_R' | |||||
+elif cpp.links(''' | |||||
+ #include <stdlib.h> | |||||
+ | |||||
+ static int dcomp(void *t, const void *l, const void *r) { return 0; } | |||||
+ | |||||
+ int main(int ac, char **av) { | |||||
+ int arr[] = { 1 }; | |||||
+ void *t = NULL; | |||||
+ qsort_r((void*)&arr[0], 1, 1, t, dcomp); | |||||
+ return (0); | |||||
+ }''', | |||||
+ args : pre_args, | |||||
+ name : 'BSD qsort_r') | |||||
+ pre_args += '-DHAVE_BSD_QSORT_R' | |||||
+endif | |||||
if cc.has_header_symbol('errno.h', 'program_invocation_name', | |||||
args : '-D_GNU_SOURCE') |