X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffnmatch.c;h=2fb65b521604bf4306e494cdcfd1d31755bbc941;hb=d49260b109750904af0f17a1b44530a56eeed71d;hp=20e2b50502dcb0e7700f308794450ffd28e06e33;hpb=00c3a8127a329b1e56c702e147d9a1d6c3351f0e;p=gnulib.git diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 20e2b5050..2fb65b521 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -15,10 +15,26 @@ License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ +#ifdef HAVE_CONFIG_H +#include +#endif + #include #include #include + +/* Comment out all this code if we are using the GNU C Library, and are not + actually compiling the library itself. This code is part of the GNU C + Library, but also included in many other GNU distributions. Compiling + and linking in this code is a waste when using the GNU C library + (especially if it is a shared library). Rather than having every GNU + program understand `configure --with-gnu-libc' and omit the object files, + it is simpler to just do this in the source for each such file. */ + +#if defined (_LIBC) || !defined (__GNU_LIBRARY__) + + #if !defined(__GNU_LIBRARY__) && !defined(STDC_HEADERS) extern int errno; #endif @@ -180,3 +196,5 @@ fnmatch (pattern, string, flags) return FNM_NOMATCH; } + +#endif /* _LIBC or not __GNU_LIBRARY__. */