Skip to content

Commit 68f678e

Browse files
committed
Check for build environment instead of just _GNU_SOURCE
Fixes the build on OpenBSD and NetBSD. It is too easy for _GNU_SOURCE to be defined even on non-Linux systems. Found via py-zstandard with the embedded copy of zstandard and Python defines _GNU_SOURCE. Also simplify the Linux checking, there is no need to check the rest of the symbol names.
1 parent cfeb29e commit 68f678e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

lib/dictBuilder/cover.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@
7777
#ifndef ZDICT_QSORT
7878
# if defined(__APPLE__)
7979
# define ZDICT_QSORT ZDICT_QSORT_APPLE /* uses qsort_r() with a different order for parameters */
80-
# elif defined(_GNU_SOURCE)
80+
# elif defined(__linux__) || defined(__CYGWIN__) || defined(__MSYS__)
8181
# define ZDICT_QSORT ZDICT_QSORT_GNU /* uses qsort_r() */
8282
# elif defined(_WIN32) && defined(_MSC_VER)
8383
# define ZDICT_QSORT ZDICT_QSORT_MSVC /* uses qsort_s() with a different order for parameters */

0 commit comments

Comments
 (0)