#ifndef _GLOB_H
#define _GLOB_H 1
-#include <sys/cdefs.h>
+#include <features.h>
__BEGIN_DECLS
-/* We need `size_t' for the following definitions. */
-#ifndef __size_t
-typedef __SIZE_TYPE__ __size_t;
-# if defined __USE_XOPEN || defined __USE_XOPEN2K8
-typedef __SIZE_TYPE__ size_t;
-# endif
+/* Structures below have size_t fields, but this header is not supposed to
+ define size_t itself, unless XSI or POSIX.1-2008 features are active.
+ We can't use __size_t as an alternative name, as we do for most types
+ with this kind of constraint, because GCC's stddef.h uses __size_t for
+ a different purpose. */
+
+#if defined __USE_XOPEN || defined __USE_XOPEN2K8
+# define __need_size_t
+# include <stddef.h>
+typedef size_t __gsize_t;
+#elif defined __SIZE_TYPE__
+typedef __SIZE_TYPE__ __gsize_t;
#else
-/* The GNU CC stddef.h version defines __size_t as empty. We need a real
- definition. */
-# undef __size_t
-# define __size_t size_t
+# error "Don't know how to define __gsize_t"
#endif
/* Bits set in the FLAGS argument to `glob'. */
#endif
typedef struct
{
- __size_t gl_pathc; /* Count of paths matched by the pattern. */
+ __gsize_t gl_pathc; /* Count of paths matched by the pattern. */
char **gl_pathv; /* List of matched pathnames. */
- __size_t gl_offs; /* Slots to reserve in `gl_pathv'. */
+ __gsize_t gl_offs; /* Slots to reserve in `gl_pathv'. */
int gl_flags; /* Set to FLAGS, maybe | GLOB_MAGCHAR. */
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
# endif
typedef struct
{
- __size_t gl_pathc;
+ __gsize_t gl_pathc;
char **gl_pathv;
- __size_t gl_offs;
+ __gsize_t gl_offs;
int gl_flags;
/* If the GLOB_ALTDIRFUNC flag is set, the following functions
# spawn.h -> sched.h
"aio.h": [ "sys/types.h" ],
"ftw.h": [ "sys/stat.h", "sys/types.h" ],
- "glob.h": [ "sys/cdefs.h" ],
"langinfo.h": [ "nl_types.h" ],
"mqueue.h": [ "fcntl.h", "sys/types.h" ],
- "pthread.h": [ "endian.h", "sched.h", "time.h",
- "sys/cdefs.h" ],
+ "pthread.h": [ "sched.h", "time.h" ],
"regex.h": [ "limits.h", "sys/types.h" ],
"sched.h": [ "time.h" ],
"semaphore.h": [ "sys/types.h" ],
"sys/time.h": [ "sys/select.h" ],
"sys/types.h": [ "endian.h", "sys/select.h" ],
"sys/uio.h": [ "sys/types.h" ],
- "sys/un.h": [ "string.h", "sys/cdefs.h" ],
+ "sys/un.h": [ "string.h" ],
"sys/wait.h": [ "signal.h" ],
# POSIX networking headers
# Nonstandardized top-level headers
"aliases.h": [ "sys/types.h" ],
- "ar.h": [ "sys/cdefs.h" ],
"argp.h": [ "ctype.h", "errno.h", "getopt.h",
"limits.h", "stdio.h" ],
"argz.h": [ "errno.h", "string.h" ],
# Nonstandardized sys/ headers
"sys/acct.h": [ "endian.h", "stdint.h", "sys/types.h" ],
- "sys/auxv.h": [ "elf.h", "sys/cdefs.h" ],
+ "sys/auxv.h": [ "elf.h" ],
"sys/elf.h": [ "sys/procfs.h" ],
"sys/epoll.h": [ "stdint.h", "sys/types.h" ],
"sys/eventfd.h": [ "stdint.h" ],
# Nonstandardized networking headers
"ifaddrs.h": [ "sys/socket.h" ],
"resolv.h": [ "arpa/nameser.h", "netinet/in.h",
- "stdio.h", "sys/cdefs.h", "sys/param.h",\
+ "stdio.h", "sys/param.h",
"sys/types.h" ],
"arpa/nameser.h": [ "arpa/nameser_compat.h", "stdint.h",
"sys/param.h", "sys/types.h" ],
"arpa/nameser_compat.h": [ "endian.h" ],
- "net/ethernet.h": [ "stdint.h", "sys/types.h", "sys/cdefs.h",
+ "net/ethernet.h": [ "stdint.h", "sys/types.h",
"net/if_ether.h" ],
"net/if_arp.h": [ "stdint.h", "sys/socket.h",
- "sys/types.h", "sys/cdefs.h" ],
+ "sys/types.h" ],
"net/if_ppp.h": [ "net/if.h", "net/ppp_defs.h", "stdint.h",
"sys/ioctl.h", "sys/types.h" ],
"net/if_shaper.h": [ "net/if.h", "stdint.h", "sys/ioctl.h",
"sys/types.h", "stdint.h" ],
"netinet/if_fddi.h": [ "stdint.h", "sys/types.h" ],
"netinet/if_tr.h": [ "stdint.h", "sys/types.h" ],
- "netinet/igmp.h": [ "netinet/in.h", "sys/cdefs.h",
- "sys/types.h" ],
+ "netinet/igmp.h": [ "netinet/in.h", "sys/types.h" ],
"netinet/in_systm.h": [ "stdint.h", "sys/types.h" ],
"netinet/ip.h": [ "netinet/in.h", "sys/types.h" ],
"netinet/ip6.h": [ "inttypes.h", "netinet/in.h" ],