Skip to content

Commit

Permalink
Include headers for ruby_qsort only if needed
Browse files Browse the repository at this point in the history
If GNU `qsort_r` is available, we use the function and these headers
are not used.
  • Loading branch information
nobu committed Jul 14, 2023
1 parent ed3d8f7 commit cfc564a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions util.c
Original file line number Diff line number Diff line change
Expand Up @@ -203,15 +203,15 @@ ruby_strtoul(const char *str, char **endptr, int base)
}
}

#if !defined HAVE_GNU_QSORT_R
#include <sys/types.h>
#include <sys/stat.h>
#include <stdint.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

typedef int (cmpfunc_t)(const void*, const void*, void*);

#if !defined HAVE_GNU_QSORT_R
#if defined HAVE_QSORT_S && defined RUBY_MSVCRT_VERSION
/* In contrast to its name, Visual Studio qsort_s is incompatible with
* C11 in the order of the comparison function's arguments, and same
Expand Down

0 comments on commit cfc564a

Please sign in to comment.