From aa0c2b9e7aaa672785ff8e9edb1a4e2a1e763b6d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Tue, 16 Sep 2014 12:26:48 -0700
Subject: [PATCH] qsort_r: include <config.h>

Problem reported by Tom G. Christensen in:
http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00071.html
* lib/qsort.c [!_LIBC]: Include <config.h> first.
---
 ChangeLog   | 7 +++++++
 lib/qsort.c | 4 ++++
 2 files changed, 11 insertions(+)

diff --git a/ChangeLog b/ChangeLog
index fbdc903046..58a6511784 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2014-09-16  Paul Eggert  <eggert@cs.ucla.edu>
+
+	qsort_r: include <config.h>
+	Problem reported by Tom G. Christensen in:
+	http://lists.gnu.org/archive/html/bug-gnulib/2014-09/msg00071.html
+	* lib/qsort.c [!_LIBC]: Include <config.h> first.
+
 2014-09-16  Dylan Cali  <calid1984@gmail.com>
 
 	avltree-list: avoid compiler warnings (trivial)
diff --git a/lib/qsort.c b/lib/qsort.c
index a6c33eba7d..8dd4ff1d71 100644
--- a/lib/qsort.c
+++ b/lib/qsort.c
@@ -20,6 +20,10 @@
    Engineering a sort function; Jon Bentley and M. Douglas McIlroy;
    Software - Practice and Experience; Vol. 23 (11), 1249-1265, 1993.  */
 
+#ifndef _LIBC
+# include <config.h>
+#endif
+
 #include <limits.h>
 #include <stdlib.h>
 #include <string.h>
-- 
2.39.5