Update Gnulib to the latest git version
[deliverable/binutils-gdb.git] / gnulib / import / glob.in.h
index 77816bc0995f7909f82d2ee50ba2162c758d3a4d..597979b7de0ca6adeb68d8e97e859af89a239c4d 100644 (file)
@@ -1,6 +1,6 @@
 /* glob.h -- Find a path matching a pattern.
 
-   Copyright (C) 2005-2007, 2009-2016 Free Software Foundation, Inc.
+   Copyright (C) 2005-2007, 2009-2019 Free Software Foundation, Inc.
 
    Written by Derek Price <derek@ximbiot.com> & Paul Eggert <eggert@CS.UCLA.EDU>
 
    GNU General Public License for more details.
 
    You should have received a copy of the GNU General Public License
-   along with this program; if not, see <http://www.gnu.org/licenses/>.  */
+   along with this program; if not, see <https://www.gnu.org/licenses/>.  */
 
-#ifndef _GL_GLOB_H
-#define _GL_GLOB_H
+#ifndef _@GUARD_PREFIX@_GLOB_H
 
-#if @HAVE_SYS_CDEFS_H@
-# include <sys/cdefs.h>
+#if __GNUC__ >= 3
+@PRAGMA_SYSTEM_HEADER@
 #endif
+@PRAGMA_COLUMNS@
 
-#include <stddef.h>
+/* The include_next requires a split double-inclusion guard.  */
+#if @HAVE_GLOB_H@ && !@REPLACE_GLOB@
+# @INCLUDE_NEXT@ @NEXT_GLOB_H@
+#endif
 
-/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
-   Make sure this definition is seen before glob-libc.h defines types that
-   rely on 'struct stat'.  */
-#include <sys/stat.h>
+#ifndef _@GUARD_PREFIX@_GLOB_H
+#define _@GUARD_PREFIX@_GLOB_H
+
+/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
+
+/* The definition of _GL_ARG_NONNULL is copied here.  */
 
-#ifndef __BEGIN_DECLS
-# ifdef __cplusplus
-#  define __BEGIN_DECLS  extern "C" {
-#  define __END_DECLS    }
+/* The definition of _GL_WARN_ON_USE is copied here.  */
+
+/* GCC 2.95 and later have "__restrict"; C99 compilers have
+   "restrict", and "configure" may have defined "restrict".
+   Other compilers use __restrict, __restrict__, and _Restrict, and
+   'configure' might #define 'restrict' to those words, so pick a
+   different name.  */
+#ifndef _Restrict_
+# if 199901L <= __STDC_VERSION__
+#  define _Restrict_ restrict
+# elif 2 < __GNUC__ || (2 == __GNUC__ && 95 <= __GNUC_MINOR__)
+#  define _Restrict_ __restrict
 # else
-#  define __BEGIN_DECLS
-#  define __END_DECLS
+#  define _Restrict_
 # endif
 #endif
-#ifndef __THROW
-# define __THROW
+
+#ifdef __cplusplus
+extern "C" {
 #endif
-#ifndef __THROWNL
-# define __THROWNL
+typedef int (*_gl_glob_errfunc_fn) (const char *, int);
+#ifdef __cplusplus
+}
 #endif
 
-/* The definitions of _GL_FUNCDECL_RPL etc. are copied here.  */
 
-/* The definition of _GL_ARG_NONNULL is copied here.  */
+#if !@HAVE_GLOB_H@ || @REPLACE_GLOB@
 
-/* The definition of _GL_WARN_ON_USE is copied here.  */
 
-#ifndef __size_t
-# define __size_t       size_t
-#endif
-#ifndef __USE_GNU
-# define __USE_GNU    1
-#endif
+/* Preparations for including the standard GNU C Library header.  */
+
+# include <libc-config.h>
+
+# include <stddef.h>
+
+/* On some systems, such as AIX 5.1, <sys/stat.h> does a "#define stat stat64".
+   Make sure this definition is seen before glob-libc.h defines types that
+   rely on 'struct stat'.  */
+# include <sys/stat.h>
 
+# ifndef __USE_GNU
+#  define __USE_GNU    1
+# endif
 
-#define glob rpl_glob
-#define globfree rpl_globfree
-#define glob_pattern_p rpl_glob_pattern_p
+# if @REPLACE_GLOB@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define glob rpl_glob
+#   define globfree rpl_globfree
+#  endif
+# endif
+# if @REPLACE_GLOB_PATTERN_P@
+#  if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+#   define glob_pattern_p rpl_glob_pattern_p
+#  endif
+# endif
+# define __glob_pattern_p glob_pattern_p
+
+# define __GLOB_GNULIB 1
 
-#define __GLOB_GNULIB 1
 
 /* Now the standard GNU C Library header should work.  */
-#include "glob-libc.h"
+# include "glob-libc.h"
 
-__BEGIN_DECLS
-typedef int (*_gl_glob_errfunc_fn) (const char *, int);
-__END_DECLS
 
-#if defined __cplusplus && defined GNULIB_NAMESPACE
-# undef glob
-# undef globfree
-# undef glob_pattern_p
+#endif
+
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB@
+_GL_FUNCDECL_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
+                              _gl_glob_errfunc_fn __errfunc,
+                              glob_t *_Restrict_ __pglob)
+                              _GL_ARG_NONNULL ((1)));
 _GL_CXXALIAS_RPL (glob, int, (const char *_Restrict_ __pattern, int __flags,
                               _gl_glob_errfunc_fn __errfunc,
                               glob_t *_Restrict_ __pglob));
-_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
-_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
-# if 0  /* The C function name is rpl_glob, not glob.  */
+# else
+#  if !@HAVE_GLOB@
+_GL_FUNCDECL_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
+                              _gl_glob_errfunc_fn __errfunc,
+                              glob_t *_Restrict_ __pglob)
+                              _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (glob, int, (const char *_Restrict_ __pattern, int __flags,
+                              _gl_glob_errfunc_fn __errfunc,
+                              glob_t *_Restrict_ __pglob));
+# endif
 _GL_CXXALIASWARN (glob);
+#elif defined GNULIB_POSIXCHECK
+# undef glob
+# if HAVE_RAW_DECL_GLOB
+_GL_WARN_ON_USE (glob,
+                 "glob is unportable - "
+                 "use gnulib module glob for portability");
+# endif
+#endif
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB@
+_GL_FUNCDECL_RPL (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (globfree, void, (glob_t *__pglob));
+# else
+#  if !@HAVE_GLOB@
+_GL_FUNCDECL_SYS (globfree, void, (glob_t *__pglob) _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (globfree, void, (glob_t *__pglob));
+# endif
 _GL_CXXALIASWARN (globfree);
+#elif defined GNULIB_POSIXCHECK
+# undef globfree
+# if HAVE_RAW_DECL_GLOBFREE
+_GL_WARN_ON_USE (globfree,
+                 "globfree is unportable - "
+                 "use gnulib module glob for portability");
+# endif
+#endif
+
+#if @GNULIB_GLOB@
+# if @REPLACE_GLOB_PATTERN_P@
+_GL_FUNCDECL_RPL (glob_pattern_p, int, (const char *__pattern, int __quote)
+                                       _GL_ARG_NONNULL ((1)));
+_GL_CXXALIAS_RPL (glob_pattern_p, int, (const char *__pattern, int __quote));
+# else
+#  if !@HAVE_GLOB_PATTERN_P@
+_GL_FUNCDECL_SYS (glob_pattern_p, int, (const char *__pattern, int __quote)
+                                       _GL_ARG_NONNULL ((1)));
+#  endif
+_GL_CXXALIAS_SYS (glob_pattern_p, int, (const char *__pattern, int __quote));
+# endif
 _GL_CXXALIASWARN (glob_pattern_p);
+#elif defined GNULIB_POSIXCHECK
+# undef glob_pattern_p
+# if HAVE_RAW_DECL_GLOB_PATTERN_P
+_GL_WARN_ON_USE (glob_pattern_p,
+                 "glob_pattern_p is unportable - "
+                 "use gnulib module glob for portability");
 # endif
 #endif
 
-#endif /* _GL_GLOB_H */
+
+#endif /* _@GUARD_PREFIX@_GLOB_H */
+#endif /* _@GUARD_PREFIX@_GLOB_H */
This page took 0.027385 seconds and 4 git commands to generate.