From: Kurt Zeilenga Date: Wed, 19 Aug 1998 18:58:16 +0000 (+0000) Subject: Rename old regex.h (BSD re_comp) to compat_regex.h to support new regex(3) code. X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=4268cba9f084edcfae738318d4a639ea40222271;p=openldap Rename old regex.h (BSD re_comp) to compat_regex.h to support new regex(3) code. FreeBSD has re_comp in -lcompat. Use of re_comp/exec for all platforms should be depreciated completely. --- diff --git a/include/compat_regex.h b/include/compat_regex.h new file mode 100644 index 0000000000..e006929009 --- /dev/null +++ b/include/compat_regex.h @@ -0,0 +1,43 @@ +#if defined( MACOS ) || defined( DOS ) || defined( _WIN32 ) || defined( NEED_BSDREGEX ) +/* + * Copyright (c) 1993 Regents of the University of Michigan. + * All rights reserved. + * + * Redistribution and use in source and binary forms are permitted + * provided that this notice is preserved and that due credit is given + * to the University of Michigan at Ann Arbor. The name of the University + * may not be used to endorse or promote products derived from this + * software without specific prior written permission. This software + * is provided ``as is'' without express or implied warranty. + */ +/* + * regex.h -- includes for regular expression matching routines + * 13 August 1993 Mark C Smith + */ + +#ifdef __cplusplus +extern "C" { +#endif + +#if !defined( NEEDPROTOS ) && defined( __STDC__ ) +#define NEEDPROTOS +#endif + +#ifdef NEEDPROTOS +char *re_comp( char *pat ); +int re_exec( char *lp ); +void re_modw( char *s ); +int re_subs( char *src, char *dst ); +#else /* NEEDPROTOS */ +char *re_comp(); +int re_exec(); +void re_modw(); +int re_subs(); +#endif /* NEEDPROTOS */ + +#define re_fail( m, p ) + +#ifdef __cplusplus +} +#endif +#endif /* MACOS or DOS or NEED_BSDREGEX */ diff --git a/include/portable.h b/include/portable.h index a91b27a5d5..8d08f6feff 100644 --- a/include/portable.h +++ b/include/portable.h @@ -61,9 +61,9 @@ #endif /* - * on many systems, we should use waitpid() instead of waitN() + * on most systems, we should use waitpid() instead of waitN() */ -#if !defined( USE_WAITPID ) && ( defined( SYSV ) || defined( sunos4 ) || defined( ultrix ) || defined( aix )) +#if !defined( USE_WAITPID ) && !defined( nextstep ) #define USE_WAITPID #endif @@ -101,7 +101,7 @@ * some systems don't have the BSD re_comp and re_exec routines */ #ifndef NEED_BSDREGEX -#if defined( SYSV ) || defined( VMS ) || defined( netbsd ) || defined( freebsd ) || defined( linux ) +#if defined( SYSV ) || defined( VMS ) || defined( netbsd ) || defined( linux ) #define NEED_BSDREGEX #endif #endif @@ -120,7 +120,7 @@ * Are sys_errlist and sys_nerr declared in stdio.h? */ #ifndef SYSERRLIST_IN_STDIO -#if defined( freebsd ) +#if defined( freebsd ) || defined( __GLIBC__ ) && ( __GLIBC__ > 1 ) #define SYSERRLIST_IN_STDIO #endif #endif @@ -170,7 +170,7 @@ * call signal or sigset (signal does not block the signal while * in the handler on sys v and sigset does not exist on bsd) */ -#ifdef SYSV +#if defined(SYSV) && !defined(linux) #define SIGNAL sigset #else #define SIGNAL signal diff --git a/include/regex.h b/include/regex.h deleted file mode 100644 index e006929009..0000000000 --- a/include/regex.h +++ /dev/null @@ -1,43 +0,0 @@ -#if defined( MACOS ) || defined( DOS ) || defined( _WIN32 ) || defined( NEED_BSDREGEX ) -/* - * Copyright (c) 1993 Regents of the University of Michigan. - * All rights reserved. - * - * Redistribution and use in source and binary forms are permitted - * provided that this notice is preserved and that due credit is given - * to the University of Michigan at Ann Arbor. The name of the University - * may not be used to endorse or promote products derived from this - * software without specific prior written permission. This software - * is provided ``as is'' without express or implied warranty. - */ -/* - * regex.h -- includes for regular expression matching routines - * 13 August 1993 Mark C Smith - */ - -#ifdef __cplusplus -extern "C" { -#endif - -#if !defined( NEEDPROTOS ) && defined( __STDC__ ) -#define NEEDPROTOS -#endif - -#ifdef NEEDPROTOS -char *re_comp( char *pat ); -int re_exec( char *lp ); -void re_modw( char *s ); -int re_subs( char *src, char *dst ); -#else /* NEEDPROTOS */ -char *re_comp(); -int re_exec(); -void re_modw(); -int re_subs(); -#endif /* NEEDPROTOS */ - -#define re_fail( m, p ) - -#ifdef __cplusplus -} -#endif -#endif /* MACOS or DOS or NEED_BSDREGEX */