X-Git-Url: https://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Ffnmatch.c;h=df1706cc0ce61d3d96497c64972f34b96d722397;hb=9d6849241fce59b8c781e0d22de2f1518355af77;hp=20e2b50502dcb0e7700f308794450ffd28e06e33;hpb=23307fb22e4b7a3d7b6efd2523b1929ba8db97d4;p=gnulib.git diff --git a/lib/fnmatch.c b/lib/fnmatch.c index 20e2b5050..df1706cc0 100644 --- a/lib/fnmatch.c +++ b/lib/fnmatch.c @@ -15,10 +15,33 @@ 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 +#if defined (CONFIG_BROKETS) +/* We use instead of "config.h" so that a compilation + using -I. -I$srcdir will use ./config.h rather than $srcdir/config.h + (which it would do because it found this file in $srcdir). */ +#include +#else +#include "config.h" +#endif +#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 +203,5 @@ fnmatch (pattern, string, flags) return FNM_NOMATCH; } + +#endif /* _LIBC or not __GNU_LIBRARY__. */