* lib/getopt.in.h (struct option): Avoid identical redefinition.
* lib/inttypes.in.h (imaxdiv_t): Likewise.
* lib/langinfo.in.h (nl_item): Likewise.
* lib/math.in.h (_NaN, NAN): Likewise.
* lib/netdb.in.h (struct addrinfo): Likewise.
* lib/poll.in.h (struct pollfd, nfds_t): Likewise.
* lib/pthread.in.h (pthread_t, pthread_attr_t, pthread_barrier_t,
pthread_barrierattr_t, pthread_cond_t, pthread_condattr_t,
pthread_key_t, pthread_mutex_t, pthread_mutexattr_t, pthread_once_t,
pthread_rwlock_t, pthread_rwlockattr_t, pthread_cond_destroy,
pthread_cond_init, pthread_cond_signal, pthread_cond_wait,
pthread_create, pthread_exit, pthread_join, pthread_mutexattr_destroy,
pthread_mutexattr_init, pthread_mutexattr_settype,
pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
pthread_mutex_trylock, pthread_mutex_unlock, pthread_spinlock_t,
pthread_spin_init, pthread_spin_destroy, pthread_spin_lock,
pthread_spin_trylock, pthread_spin_unlock): Likewise.
* lib/sched.in.h (struct sched_param): Likewise.
* lib/se-selinux.in.h (security_class_t, security_context_t,
is_selinux_enabled, getcon, freecon, getfscreatecon, setfscreatecon,
matchpathcon, getfilecon, lgetfilecon, fgetfilecon, setfilecon,
lsetfilecon, fsetfilecon, security_check_context,
security_check_context_raw, setexeccon, matchpathcon_init_prefix):
Likewise.
* lib/search.in.h (VISIT, _gl_search_compar_fn, _gl_search_action_fn):
Likewise.
* lib/signal.in.h (sig_atomic_t, sigset_t, verify_NSIG_constraint,
_gl_function_taking_int_returning_void_t, union sigval,
struct siginfo_t, siginfo_t, struct sigaction): Likewise.
* lib/spawn.in.h (posix_spawnattr_t, posix_spawn_file_actions_t,
verify_POSIX_SPAWN_USEVFORK_no_overlap): Likewise.
* lib/stdint.in.h (gl_int8_t, gl_uint8_t, gl_int16_t, gl_uint16_t,
gl_int32_t, gl_uint32_t, gl_int64_t, gl_uint64_t, int_least8_t,
uint_least8_t, int_least16_t, uint_least16_t, int_least32_t,
uint_least32_t, int_least64_t, uint_least64_t, gl_int_fast8_t,
gl_uint_fast8_t, gl_int_fast16_t, gl_uint_fast16_t, gl_int_fast32_t,
gl_uint_fast32_t, int_fast64_t, uint_fast64_t, gl_intptr_t,
gl_uintptr_t, intmax_t, uintmax_t, _verify_intmax_size): Likewise.
* lib/stdio.in.h (rpl_fseek, rpl_ftell): Likewise.
* lib/sys_socket.in.h (sa_family_t, struct sockaddr_storage,
socklen_t, rpl_fd_isset): Likewise.
* lib/sys_stat.in.h (rpl_mkdir): Likewise.
* lib/sys_time.in.h (struct timeval): Likewise.
* lib/sys_times.in.h (struct tms): Likewise.
* lib/sys_utsname.in.h (struct utsname):
* lib/time.in.h (struct timespec, __time_t_must_be_integral): Likewise.
* lib/unistd.in.h (getpagesize): Likewise.
* lib/wchar.in.h (mbstate_t): Likewise.
* lib/wctype.in.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit,
iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit,
towlower, towupper): Likewise.
Reported by Sam Steingold <sds@gnu.org>.
+2010-11-14 Bruno Haible <bruno@clisp.org>
+
+ Allow multiple gnulib generated replacements to coexist.
+ * lib/getopt.in.h (struct option): Avoid identical redefinition.
+ * lib/inttypes.in.h (imaxdiv_t): Likewise.
+ * lib/langinfo.in.h (nl_item): Likewise.
+ * lib/math.in.h (_NaN, NAN): Likewise.
+ * lib/netdb.in.h (struct addrinfo): Likewise.
+ * lib/poll.in.h (struct pollfd, nfds_t): Likewise.
+ * lib/pthread.in.h (pthread_t, pthread_attr_t, pthread_barrier_t,
+ pthread_barrierattr_t, pthread_cond_t, pthread_condattr_t,
+ pthread_key_t, pthread_mutex_t, pthread_mutexattr_t, pthread_once_t,
+ pthread_rwlock_t, pthread_rwlockattr_t, pthread_cond_destroy,
+ pthread_cond_init, pthread_cond_signal, pthread_cond_wait,
+ pthread_create, pthread_exit, pthread_join, pthread_mutexattr_destroy,
+ pthread_mutexattr_init, pthread_mutexattr_settype,
+ pthread_mutex_destroy, pthread_mutex_init, pthread_mutex_lock,
+ pthread_mutex_trylock, pthread_mutex_unlock, pthread_spinlock_t,
+ pthread_spin_init, pthread_spin_destroy, pthread_spin_lock,
+ pthread_spin_trylock, pthread_spin_unlock): Likewise.
+ * lib/sched.in.h (struct sched_param): Likewise.
+ * lib/se-selinux.in.h (security_class_t, security_context_t,
+ is_selinux_enabled, getcon, freecon, getfscreatecon, setfscreatecon,
+ matchpathcon, getfilecon, lgetfilecon, fgetfilecon, setfilecon,
+ lsetfilecon, fsetfilecon, security_check_context,
+ security_check_context_raw, setexeccon, matchpathcon_init_prefix):
+ Likewise.
+ * lib/search.in.h (VISIT, _gl_search_compar_fn, _gl_search_action_fn):
+ Likewise.
+ * lib/signal.in.h (sig_atomic_t, sigset_t, verify_NSIG_constraint,
+ _gl_function_taking_int_returning_void_t, union sigval,
+ struct siginfo_t, siginfo_t, struct sigaction): Likewise.
+ * lib/spawn.in.h (posix_spawnattr_t, posix_spawn_file_actions_t,
+ verify_POSIX_SPAWN_USEVFORK_no_overlap): Likewise.
+ * lib/stdint.in.h (gl_int8_t, gl_uint8_t, gl_int16_t, gl_uint16_t,
+ gl_int32_t, gl_uint32_t, gl_int64_t, gl_uint64_t, int_least8_t,
+ uint_least8_t, int_least16_t, uint_least16_t, int_least32_t,
+ uint_least32_t, int_least64_t, uint_least64_t, gl_int_fast8_t,
+ gl_uint_fast8_t, gl_int_fast16_t, gl_uint_fast16_t, gl_int_fast32_t,
+ gl_uint_fast32_t, int_fast64_t, uint_fast64_t, gl_intptr_t,
+ gl_uintptr_t, intmax_t, uintmax_t, _verify_intmax_size): Likewise.
+ * lib/stdio.in.h (rpl_fseek, rpl_ftell): Likewise.
+ * lib/sys_socket.in.h (sa_family_t, struct sockaddr_storage,
+ socklen_t, rpl_fd_isset): Likewise.
+ * lib/sys_stat.in.h (rpl_mkdir): Likewise.
+ * lib/sys_time.in.h (struct timeval): Likewise.
+ * lib/sys_times.in.h (struct tms): Likewise.
+ * lib/sys_utsname.in.h (struct utsname):
+ * lib/time.in.h (struct timespec, __time_t_must_be_integral): Likewise.
+ * lib/unistd.in.h (getpagesize): Likewise.
+ * lib/wchar.in.h (mbstate_t): Likewise.
+ * lib/wctype.in.h (iswalnum, iswalpha, iswblank, iswcntrl, iswdigit,
+ iswgraph, iswlower, iswprint, iswpunct, iswspace, iswupper, iswxdigit,
+ towlower, towupper): Likewise.
+ Reported by Sam Steingold <sds@gnu.org>.
+
2011-02-05 Eric Blake <eblake@redhat.com>
unsetenv: work around Haiku issues
one). For long options that have a zero `flag' field, `getopt'
returns the contents of the `val' field. */
+# if !GNULIB_defined_struct_option
struct option
{
const char *name;
int *flag;
int val;
};
+# define GNULIB_defined_struct_option 1
+# endif
/* Names for the values of the `has_arg' field of `struct option'. */
#if @GNULIB_IMAXDIV@
# if !@HAVE_DECL_IMAXDIV@
+# if !GNULIB_defined_imaxdiv_t
typedef struct { intmax_t quot; intmax_t rem; } imaxdiv_t;
+# define GNULIB_defined_imaxdiv_t 1
+# endif
extern imaxdiv_t imaxdiv (intmax_t, intmax_t);
# endif
#elif defined GNULIB_POSIXCHECK
/* A platform that lacks <langinfo.h>. */
/* Assume that it also lacks <nl_types.h> and the nl_item type. */
+# if !GNULIB_defined_nl_item
typedef int nl_item;
+# define GNULIB_defined_nl_item 1
+# endif
/* nl_langinfo items of the LC_CTYPE category */
# define CODESET 10000
it on platforms like Solaris 10, where NAN is present but defined
as a function pointer rather than a floating point constant. */
#if !defined NAN || @REPLACE_NAN@
-# undef NAN
+# if !GNULIB_defined_NAN
+# undef NAN
/* The Compaq (ex-DEC) C 6.4 compiler chokes on the expression 0.0 / 0.0. */
-# ifdef __DECC
+# ifdef __DECC
static float
_NaN ()
{
static float zero = 0.0f;
return zero / zero;
}
-# define NAN (_NaN())
-# else
-# define NAN (0.0f / 0.0f)
+# define NAN (_NaN())
+# else
+# define NAN (0.0f / 0.0f)
+# endif
+# define GNULIB_defined_NAN 1
# endif
#endif
# if !@HAVE_STRUCT_ADDRINFO@
+# if !GNULIB_defined_struct_addrinfo
/* Structure to contain information about address of a service provider. */
struct addrinfo
{
char *ai_canonname; /* Canonical name for service location. */
struct addrinfo *ai_next; /* Pointer to next in list. */
};
+# define GNULIB_defined_struct_addrinfo 1
+# endif
# endif
/* Possible values for `ai_flags' field in `addrinfo' structure. */
# define POLLWRNORM 0x0100
# define POLLWRBAND 0x0200
+# if !GNULIB_defined_poll_types
+
struct pollfd
{
int fd; /* which file descriptor to poll */
typedef unsigned long nfds_t;
+# define GNULIB_defined_poll_types 1
+# endif
+
/* Define INFTIM only if doing so conforms to POSIX. */
# if !defined (_POSIX_C_SOURCE) && !defined (_XOPEN_SOURCE)
# define INFTIM (-1)
#include <time.h>
#if ! @HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_types
typedef int pthread_t;
typedef int pthread_attr_t;
typedef int pthread_barrier_t;
typedef int pthread_once_t;
typedef int pthread_rwlock_t;
typedef int pthread_rwlockattr_t;
+# define GNULIB_defined_pthread_types 1
+# endif
#endif
#ifndef PTHREAD_COND_INITIALIZER
#if ! @HAVE_PTHREAD_T@
+# if !GNULIB_defined_pthread_functions
+
/* Provide substitutes for the thread functions that should work
adequately on a single-threaded implementation, where
pthread_create always fails. The goal is to let programs compile
return 0;
}
+# define GNULIB_defined_pthread_functions 1
+# endif
+
#endif
#if ! @HAVE_PTHREAD_SPINLOCK_T@
+# if !GNULIB_defined_pthread_spinlock_t
+
/* Approximate spinlocks with mutexes. */
typedef pthread_mutex_t pthread_spinlock_t;
{
return pthread_mutex_unlock (lock);
}
+
+# define GNULIB_defined_pthread_spinlock_t 1
+# endif
+
#endif
#endif /* _GL_PTHREAD_H_ */
#if !@HAVE_STRUCT_SCHED_PARAM@
+# if !GNULIB_defined_struct_sched_param
struct sched_param
{
int sched_priority;
};
+# define GNULIB_defined_struct_sched_param 1
+# endif
#endif
/* The definition of _GL_UNUSED_PARAMETER is copied here. */
+# if !GNULIB_defined_security_types
+
typedef unsigned short security_class_t;
-# define security_context_t char*
-# define is_selinux_enabled() 0
+# define security_context_t char*
+# define is_selinux_enabled() 0
static inline int getcon (security_context_t *con _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
char const *prefix _GL_UNUSED_PARAMETER)
{ errno = ENOTSUP; return -1; }
+# define GNULIB_defined_security_types 1
+# endif
+
# endif
#endif /* _GL_SELINUX_SELINUX_H */
for details. */
# if !@HAVE_TSEARCH@
+# if !GNULIB_defined_search_types
typedef enum
{
preorder,
leaf
}
VISIT;
+# define GNULIB_defined_search_types 1
+# endif
# endif
# ifdef __cplusplus
extern "C" {
# endif
+# if !GNULIB_defined_search_fn_types
typedef int (*_gl_search_compar_fn) (const void *, const void *);
typedef void (*_gl_search_action_fn) (const void *, VISIT, int);
+# define GNULIB_defined_search_fn_types 1
+# endif
# ifdef __cplusplus
}
# endif
'volatile sig_atomic_t' ignore the extra modifier, but C89 did not.
Hence, redefine this to a non-volatile type as needed. */
#if ! @HAVE_TYPE_VOLATILE_SIG_ATOMIC_T@
+# if !GNULIB_defined_sig_atomic_t
typedef int rpl_sig_atomic_t;
-# undef sig_atomic_t
-# define sig_atomic_t rpl_sig_atomic_t
+# undef sig_atomic_t
+# define sig_atomic_t rpl_sig_atomic_t
+# define GNULIB_defined_sig_atomic_t 1
+# endif
#endif
/* A set or mask of signals. */
#if !@HAVE_SIGSET_T@
+# if !GNULIB_defined_sigset_t
typedef unsigned int sigset_t;
+# define GNULIB_defined_sigset_t 1
+# endif
#endif
# endif
/* This code supports only 32 signals. */
+# if !GNULIB_defined_verify_NSIG_constraint
typedef int verify_NSIG_constraint[NSIG <= 32 ? 1 : -1];
+# define GNULIB_defined_verify_NSIG_constraint 1
+# endif
# endif
# ifdef __cplusplus
extern "C" {
# endif
+# if !GNULIB_defined_function_taking_int_returning_void_t
typedef void (*_gl_function_taking_int_returning_void_t) (int);
+# define GNULIB_defined_function_taking_int_returning_void_t 1
+# endif
# ifdef __cplusplus
}
# endif
# if !@HAVE_SIGACTION@
# if !@HAVE_SIGINFO_T@
+
+# if !GNULIB_defined_siginfo_types
+
/* Present to allow compilation, but unsupported by gnulib. */
union sigval
{
union sigval si_value;
};
typedef struct siginfo_t siginfo_t;
+
+# define GNULIB_defined_siginfo_types 1
+# endif
+
# endif /* !@HAVE_SIGINFO_T@ */
/* We assume that platforms which lack the sigaction() function also lack
the 'struct sigaction' type, and vice versa. */
+# if !GNULIB_defined_struct_sigaction
+
struct sigaction
{
union
/* Not all POSIX flags are supported. */
int sa_flags;
};
-# define sa_handler _sa_func._sa_handler
-# define sa_sigaction _sa_func._sa_sigaction
+# define sa_handler _sa_func._sa_handler
+# define sa_sigaction _sa_func._sa_sigaction
/* Unsupported flags are not present. */
-# define SA_RESETHAND 1
-# define SA_NODEFER 2
-# define SA_RESTART 4
+# define SA_RESETHAND 1
+# define SA_NODEFER 2
+# define SA_RESTART 4
+
+# define GNULIB_defined_struct_sigaction 1
+# endif
_GL_FUNCDECL_SYS (sigaction, int, (int, const struct sigaction *restrict,
struct sigaction *restrict));
# define posix_spawnattr_t rpl_posix_spawnattr_t
#endif
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWNATTR_T@
+# if !GNULIB_defined_posix_spawnattr_t
typedef struct
{
short int _flags;
int _policy;
int __pad[16];
} posix_spawnattr_t;
+# define GNULIB_defined_posix_spawnattr_t 1
+# endif
#endif
# define posix_spawn_file_actions_t rpl_posix_spawn_file_actions_t
#endif
#if @REPLACE_POSIX_SPAWN@ || !@HAVE_POSIX_SPAWN_FILE_ACTIONS_T@
+# if !GNULIB_defined_posix_spawn_file_actions_t
typedef struct
{
int _allocated;
struct __spawn_action *_actions;
int __pad[16];
} posix_spawn_file_actions_t;
+# define GNULIB_defined_posix_spawn_file_actions_t 1
+# endif
#endif
| POSIX_SPAWN_SETSCHEDULER \
| (POSIX_SPAWN_SETSCHEDULER > 0 ? POSIX_SPAWN_SETSCHEDULER - 1 : 0)) \
+ 1)
+#if !GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap
typedef int verify_POSIX_SPAWN_USEVFORK_no_overlap
[(((POSIX_SPAWN_RESETIDS | POSIX_SPAWN_SETPGROUP
| POSIX_SPAWN_SETSIGDEF | POSIX_SPAWN_SETSIGMASK
& POSIX_SPAWN_USEVFORK)
== 0)
? 1 : -1];
+# define GNULIB_defined_verify_POSIX_SPAWN_USEVFORK_no_overlap 1
+#endif
#if @GNULIB_POSIX_SPAWN@
warnings in the signed case. */ \
((((zero) + 1) << ((bits) ? (bits) - 1 - (signed) : 0)) - 1) * 2 + 1)
+#if !GNULIB_defined_stdint_types
+
/* 7.18.1.1. Exact-width integer types */
/* Here we assume a standard architecture where the hardware integer
typedef int _verify_intmax_size[sizeof (intmax_t) == sizeof (uintmax_t)
? 1 : -1];
+#define GNULIB_defined_stdint_types 1
+#endif /* !GNULIB_defined_stdint_types */
+
/* 7.18.2. Limits of specified-width integer types */
#if ! defined __cplusplus || defined __STDC_LIMIT_MACROS
/* Provide an fseek function that is consistent with fseeko. */
/* In order to avoid that fseek gets defined as a macro here, the
developer can request the 'fseek' module. */
-# undef fseek
-# define fseek rpl_fseek
+# if !GNULIB_defined_fseek_function
+# undef fseek
+# define fseek rpl_fseek
static inline int _GL_ARG_NONNULL ((1))
rpl_fseek (FILE *fp, long offset, int whence)
{
-# if @REPLACE_FSEEKO@
+# if @REPLACE_FSEEKO@
return rpl_fseeko (fp, offset, whence);
-# else
+# else
return fseeko (fp, offset, whence);
-# endif
+# endif
}
+# define GNULIB_defined_fseek_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FSEEK_WARN /* Category 1, above. */
/* Provide an ftell function that is consistent with ftello. */
/* In order to avoid that ftell gets defined as a macro here, the
developer can request the 'ftell' module. */
-# undef ftell
-# define ftell rpl_ftell
+# if !GNULIB_defined_ftell_function
+# undef ftell
+# define ftell rpl_ftell
static inline long _GL_ARG_NONNULL ((1))
rpl_ftell (FILE *f)
{
-# if @REPLACE_FTELLO@
+# if @REPLACE_FTELLO@
return rpl_ftello (f);
-# else
+# else
return ftello (f);
-# endif
+# endif
}
+# define GNULIB_defined_ftell_function 1
+# endif
# endif
#elif defined GNULIB_POSIXCHECK
# define _GL_FTELL_WARN /* Category 1, above. */
/* The definition of _GL_WARN_ON_USE is copied here. */
#if !@HAVE_SA_FAMILY_T@
+# if !GNULIB_defined_sa_family_t
typedef unsigned short sa_family_t;
+# define GNULIB_defined_sa_family_t 1
+# endif
#endif
#if @HAVE_STRUCT_SOCKADDR_STORAGE@
: alignof (__ss_aligntype)) \
+ sizeof (__ss_aligntype)))
+# if !GNULIB_defined_struct_sockaddr_storage
struct sockaddr_storage
{
sa_family_t ss_family; /* Address family, etc. */
__ss_aligntype __ss_align; /* Force desired alignment. */
char __ss_padding[_SS_PADSIZE];
};
+# define GNULIB_defined_struct_sockaddr_storage 1
+# endif
+
#endif
#if @HAVE_SYS_SOCKET_H@
# include <sys/types.h>
# include <io.h>
+# if !GNULIB_defined_socklen_t
typedef int socklen_t;
+# define GNULIB_defined_socklen_t 1
+# endif
# endif
#if @HAVE_WINSOCK2_H@
+# if !GNULIB_defined_rpl_fd_isset
+
/* Re-define FD_ISSET to avoid a WSA call while we are not using
network sockets. */
static inline int
return 0;
}
+# define GNULIB_defined_rpl_fd_isset 1
+# endif
+
# undef FD_ISSET
# define FD_ISSET(fd, set) rpl_fd_isset(fd, set)
which are included above. */
# if (defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__
+# if !GNULIB_defined_rpl_mkdir
static inline int
rpl_mkdir (char const *name, mode_t mode)
{
return _mkdir (name);
}
+# define GNULIB_defined_rpl_mkdir 1
+# endif
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define mkdir rpl_mkdir
# endif
# if ! @HAVE_STRUCT_TIMEVAL@
+
+# if !GNULIB_defined_struct_timeval
struct timeval
{
time_t tv_sec;
long int tv_usec;
};
+# define GNULIB_defined_struct_timeval 1
+# endif
+
# endif
# ifdef __cplusplus
# endif
# if !@HAVE_STRUCT_TMS@
+# if !GNULIB_defined_struct_tms
/* Structure describing CPU time used by a process and its children. */
struct tms
{
clock_t tms_cutime; /* User CPU time of dead children. */
clock_t tms_cstime; /* System CPU time of dead children. */
};
+# define GNULIB_defined_struct_tms 1
+# endif
# endif
# if @GNULIB_TIMES@
# define _UTSNAME_MACHINE_LENGTH _UTSNAME_LENGTH
# endif
+# if !GNULIB_defined_struct_utsname
/* Structure describing the system and machine. */
struct utsname
{
/* Name of the hardware type the system is running on. */
char machine[_UTSNAME_MACHINE_LENGTH];
};
+# define GNULIB_defined_struct_utsname 1
+# endif
+
#endif /* !@HAVE_STRUCT_UTSNAME@ */
extern "C" {
# endif
-# undef timespec
-# define timespec rpl_timespec
+# if !GNULIB_defined_struct_timespec
+# undef timespec
+# define timespec rpl_timespec
struct timespec
{
time_t tv_sec;
long int tv_nsec;
};
+# define GNULIB_defined_struct_timespec 1
+# endif
# ifdef __cplusplus
}
# endif
# endif
+# if !GNULIB_defined_struct_time_t_must_be_integral
/* Per http://austingroupbugs.net/view.php?id=327, POSIX requires
time_t to be an integer type, even though C99 permits floating
point. We don't know of any implementation that uses floating
struct __time_t_must_be_integral {
unsigned int __floating_time_t_unsupported : (time_t) 1;
};
+# define GNULIB_defined_struct_time_t_must_be_integral 1
+# endif
/* Sleep for at least RQTP seconds unless interrupted, If interrupted,
return -1 and store the remaining time into RMTP. See
# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
# define getpagesize() _gl_getpagesize ()
# else
+# if !GNULIB_defined_getpagesize_function
static inline int
getpagesize ()
{
return _gl_getpagesize ();
}
+# define GNULIB_defined_getpagesize_function 1
+# endif
# endif
# endif
# endif
On IRIX 6.5, sizeof (mbstate_t) == 1, which is not sufficient for
implementing mbrtowc for encodings like UTF-8. */
#if !(@HAVE_MBSINIT@ && @HAVE_MBRTOWC@) || @REPLACE_MBSTATE_T@
+# if !GNULIB_defined_mbstate_t
typedef int rpl_mbstate_t;
-# undef mbstate_t
-# define mbstate_t rpl_mbstate_t
-# define GNULIB_defined_mbstate_t 1
+# undef mbstate_t
+# define mbstate_t rpl_mbstate_t
+# define GNULIB_defined_mbstate_t 1
+# endif
#endif
#endif
+#if !GNULIB_defined_wctype_functions
+
/* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
Linux libc5 has <wctype.h> and the functions but they are broken.
Assume all 11 functions (all isw* except iswblank) are implemented the
same way, or not at all. */
-#if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
+# if ! @HAVE_ISWCNTRL@ || @REPLACE_ISWCNTRL@
/* IRIX 5.3 has macros but no functions, its isw* macros refer to an
undefined variable _ctmp_ and to <ctype.h> macros like _P, and they
refer to system functions like _iswctype that are not in the
standard C library. Rather than try to get ancient buggy
implementations like this to work, just disable them. */
-# undef iswalnum
-# undef iswalpha
-# undef iswblank
-# undef iswcntrl
-# undef iswdigit
-# undef iswgraph
-# undef iswlower
-# undef iswprint
-# undef iswpunct
-# undef iswspace
-# undef iswupper
-# undef iswxdigit
-# undef towlower
-# undef towupper
+# undef iswalnum
+# undef iswalpha
+# undef iswblank
+# undef iswcntrl
+# undef iswdigit
+# undef iswgraph
+# undef iswlower
+# undef iswprint
+# undef iswpunct
+# undef iswspace
+# undef iswupper
+# undef iswxdigit
+# undef towlower
+# undef towupper
/* Linux libc5 has <wctype.h> and the functions but they are broken. */
-# if @REPLACE_ISWCNTRL@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iswalnum rpl_iswalnum
-# define iswalpha rpl_iswalpha
-# define iswblank rpl_iswblank
-# define iswcntrl rpl_iswcntrl
-# define iswdigit rpl_iswdigit
-# define iswgraph rpl_iswgraph
-# define iswlower rpl_iswlower
-# define iswprint rpl_iswprint
-# define iswpunct rpl_iswpunct
-# define iswspace rpl_iswspace
-# define iswupper rpl_iswupper
-# define iswxdigit rpl_iswxdigit
-# define towlower rpl_towlower
-# define towupper rpl_towupper
+# if @REPLACE_ISWCNTRL@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswalnum rpl_iswalnum
+# define iswalpha rpl_iswalpha
+# define iswblank rpl_iswblank
+# define iswcntrl rpl_iswcntrl
+# define iswdigit rpl_iswdigit
+# define iswgraph rpl_iswgraph
+# define iswlower rpl_iswlower
+# define iswprint rpl_iswprint
+# define iswpunct rpl_iswpunct
+# define iswspace rpl_iswspace
+# define iswupper rpl_iswupper
+# define iswxdigit rpl_iswxdigit
+# define towlower rpl_towlower
+# define towupper rpl_towupper
+# endif
# endif
-# endif
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswalnum
-# else
+# else
iswalnum
-# endif
+# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswalpha
-# else
+# else
iswalpha
-# endif
+# endif
(wint_t wc)
{
return (wc & ~0x20) >= 'A' && (wc & ~0x20) <= 'Z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswblank
-# else
+# else
iswblank
-# endif
+# endif
(wint_t wc)
{
return wc == ' ' || wc == '\t';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswcntrl
-# else
+# else
iswcntrl
-# endif
+# endif
(wint_t wc)
{
return (wc & ~0x1f) == 0 || wc == 0x7f;
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswdigit
-# else
+# else
iswdigit
-# endif
+# endif
(wint_t wc)
{
return wc >= '0' && wc <= '9';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswgraph
-# else
+# else
iswgraph
-# endif
+# endif
(wint_t wc)
{
return wc >= '!' && wc <= '~';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswlower
-# else
+# else
iswlower
-# endif
+# endif
(wint_t wc)
{
return wc >= 'a' && wc <= 'z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswprint
-# else
+# else
iswprint
-# endif
+# endif
(wint_t wc)
{
return wc >= ' ' && wc <= '~';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswpunct
-# else
+# else
iswpunct
-# endif
+# endif
(wint_t wc)
{
return (wc >= '!' && wc <= '~'
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswspace
-# else
+# else
iswspace
-# endif
+# endif
(wint_t wc)
{
return (wc == ' ' || wc == '\t'
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswupper
-# else
+# else
iswupper
-# endif
+# endif
(wint_t wc)
{
return wc >= 'A' && wc <= 'Z';
}
static inline int
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_iswxdigit
-# else
+# else
iswxdigit
-# endif
+# endif
(wint_t wc)
{
return ((wc >= '0' && wc <= '9')
}
static inline wint_t
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_towlower
-# else
+# else
towlower
-# endif
+# endif
(wint_t wc)
{
return (wc >= 'A' && wc <= 'Z' ? wc - 'A' + 'a' : wc);
}
static inline wint_t
-# if @REPLACE_ISWCNTRL@
+# if @REPLACE_ISWCNTRL@
rpl_towupper
-# else
+# else
towupper
-# endif
+# endif
(wint_t wc)
{
return (wc >= 'a' && wc <= 'z' ? wc - 'a' + 'A' : wc);
}
-#elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
+# elif ! @HAVE_ISWBLANK@ || @REPLACE_ISWBLANK@
/* Only the iswblank function is missing. */
-# if @REPLACE_ISWBLANK@
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define iswblank rpl_iswblank
-# endif
+# if @REPLACE_ISWBLANK@
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define iswblank rpl_iswblank
+# endif
_GL_FUNCDECL_RPL (iswblank, int, (wint_t wc));
-# else
+# else
_GL_FUNCDECL_SYS (iswblank, int, (wint_t wc));
-# endif
+# endif
-#endif
+# endif
-#if defined __MINGW32__
+# if defined __MINGW32__
/* On native Windows, wchar_t is uint16_t, and wint_t is uint32_t.
The functions towlower and towupper are implemented in the MSVCRT library
{
return (wint_t) (wchar_t) towlower (wc);
}
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define towlower rpl_towlower
-# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towlower rpl_towlower
+# endif
static inline wint_t
rpl_towupper (wint_t wc)
{
return (wint_t) (wchar_t) towupper (wc);
}
-# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
-# define towupper rpl_towupper
-# endif
+# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
+# define towupper rpl_towupper
+# endif
-#endif /* __MINGW32__ */
+# endif /* __MINGW32__ */
+
+# define GNULIB_defined_wctype_functions 1
+#endif
#if @REPLACE_ISWCNTRL@
_GL_CXXALIAS_RPL (iswalnum, int, (wint_t wc));