re-engine-GNU

 view release on metacpan or  search on metacpan

regex_internal.h  view on Meta::CPAN

   Lesser General Public License for more details.

   You should have received a copy of the GNU Lesser General Public
   License along with the GNU C Library; if not, see
   <http://www.gnu.org/licenses/>.  */

#ifndef _REGEX_INTERNAL_H
#define _REGEX_INTERNAL_H 1

#ifdef HAVE_ASSERT_H
#  include <assert.h>
#endif
#ifdef HAVE_CTYPE_H
#  include <ctype.h>
#endif
#ifdef HAVE_STDIO_H
#  include <stdio.h>
#endif
#ifdef HAVE_STDLIB_H
#  include <stdlib.h>
#endif
#ifdef HAVE_STRING_H
#  include <string.h>
#endif

/* We do not want to include locale stuff: everything */
/* will be done using perl API */
#if 0
#  include <langinfo.h>
#  include <locale.h>
#endif
#ifdef HAVE_WCHAR_H
#  include <wchar.h>
#endif
#ifdef HAVE_WCTYPE_H
#  include <wctype.h>
#endif
#ifndef HAS_BOOL
/* Because perl usually already defined it */
#  ifdef HAVE_STDBOOL_H
#    include <stdbool.h>
#  else
#    ifndef __cplusplus
#      ifndef bool
#        ifdef HAVE__BOOL
typedef _Bool bool;
#        else
typedef unsigned char bool;
#        endif
#      endif
#      ifndef true
#        define true 1
#      endif
#      ifndef false
#        define false 0
#      endif
#      define __bool_true_false_are_defined 1
#    endif
#  endif
#else
/* This is perl's bool style. Though it usually does not define true or false */
#  ifndef __bool_true_false_are_defined
#    ifndef true
#      define true 1
#    endif
#    ifndef false
#      define false 0
#    endif
#    define __bool_true_false_are_defined 1
#  endif
#endif /* HAS_BOOL */
#ifdef HAVE_STDINT_H
#include <stdint.h>
#endif
#ifdef HAVE_SYS_INT_TYPES_H
/* for some old solaris */
#include <sys/int_types.h>
#endif

#ifdef _LIBC
# include <bits/libc-lock.h>
# define lock_define(name) __libc_lock_define (, name)
# define lock_init(lock) (__libc_lock_init (lock), 0)
# define lock_fini(lock) 0
# define lock_lock(lock) __libc_lock_lock (lock)
# define lock_unlock(lock) __libc_lock_unlock (lock)
#elif defined GNULIB_LOCK
# include "glthread/lock.h"
  /* Use gl_lock_define if empty macro arguments are known to work.
     Otherwise, fall back on less-portable substitutes.  */
# if ((defined __GNUC__ && !defined __STRICT_ANSI__) \
      || (defined __STDC_VERSION__ && 199901L <= __STDC_VERSION__))
#  define lock_define(name) gl_lock_define (, name)
# elif USE_POSIX_THREADS
#  define lock_define(name) pthread_mutex_t name;
# elif USE_PTH_THREADS
#  define lock_define(name) pth_mutex_t name;
# elif USE_SOLARIS_THREADS
#  define lock_define(name) mutex_t name;
# elif USE_WINDOWS_THREADS
#  define lock_define(name) gl_lock_t name;
# else
#  define lock_define(name)
# endif
# define lock_init(lock) glthread_lock_init (&(lock))
# define lock_fini(lock) glthread_lock_destroy (&(lock))
# define lock_lock(lock) glthread_lock_lock (&(lock))
# define lock_unlock(lock) glthread_lock_unlock (&(lock))
#elif defined GNULIB_PTHREAD
# include <pthread.h>
# define lock_define(name) pthread_mutex_t name;
# define lock_init(lock) pthread_mutex_init (&(lock), 0)
# define lock_fini(lock) pthread_mutex_destroy (&(lock))
# define lock_lock(lock) pthread_mutex_lock (&(lock))
# define lock_unlock(lock) pthread_mutex_unlock (&(lock))
#else
# define lock_define(name) SV *name;
/* GNU regex expect lock_init(lock) to return 0 if success */
/* Break on win32 ? */
/*
# define lock_init(lock) (SvSHARE(lock), 0)



( run in 0.919 second using v1.01-cache-2.11-cpan-96521ef73a4 )