C/C++ User's Journal STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ... ATLSTL - where the Standard Template Library meets the Active Template Library COMSTL - where the Standard Template Library meets the Component Object Model
Synesis Software InetSTL - where the Standard Template Library meets the Internet UNIXSTL - Template Software for the UNIX Operating System WinSTL - where the Standard Template Library meets the Win32 API

H:/freelibs/recls/current/src/recls_impl.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////////
00002  * File:        recls_impl.h
00003  *
00004  * Purpose:     Implementation header.
00005  *
00006  * Created:     7th March 2005
00007  * Updated:     22nd April 2007
00008  *
00009  * Home:        http://recls.org/
00010  *
00011  * Copyright (c) 2005-2007, Matthew Wilson and Synesis Software
00012  * All rights reserved.
00013  *
00014  * Redistribution and use in source and binary forms, with or without 
00015  * modification, are permitted in accordance with the license and warranty
00016  * information described in recls.h (included in this distribution, or available
00017  * from http://recls.org/)
00018  *
00019  * ////////////////////////////////////////////////////////////////////////// */
00020 
00021 
00022 #ifndef RECLS_INCL_H_RECLS_IMPL
00023 #define RECLS_INCL_H_RECLS_IMPL
00024 
00025 /* File version */
00026 #ifndef RECLS_DOCUMENTATION_SKIP_SECTION
00027 # define RECLS_VER_H_RECLS_IMPL_MAJOR       3
00028 # define RECLS_VER_H_RECLS_IMPL_MINOR       2
00029 # define RECLS_VER_H_RECLS_IMPL_REVISION    5
00030 # define RECLS_VER_H_RECLS_IMPL_EDIT        32
00031 #endif /* !RECLS_DOCUMENTATION_SKIP_SECTION */
00032 
00036 /* /////////////////////////////////////////////////////////////////////////////
00037  * Includes
00038  */
00039 
00040 #include <recls/recls.h>
00041 
00042 #ifdef RECLS_PURE_API
00043 # error Cannot define RECLS_PURE_API for the implementation of recls
00044 #endif /* RECLS_PURE_API */
00045 
00046 #if defined(RECLS_PLATFORM_IS_UNIX)
00047 # if defined(WIN32) && \
00048      defined(EMULATE_UNIX_ON_WIN32)
00049 #  include <windows.h>
00050 # endif /* WIN32 && EMULATE_UNIX_ON_WIN32 */
00051 #endif /* RECLS_PLATFORM_IS_UNIX */
00052 
00053 /* /////////////////////////////////////////////////////////////////////////////
00054  * C++ stuff
00055  */
00056 
00057 #ifdef __cplusplus
00058 # include <stlsoft/stlsoft.h>    /* If the compiler cannot find this, you are not using STLSoft 1.9.1 or later, as required. */
00059 # if !defined(_STLSOFT_VER_1_9_1) || \
00060     _STLSOFT_VER < _STLSOFT_VER_1_9_1
00061 #  error Requires STLSoft 1.9.1, or later. (www.stlsoft.org/downloads.html)
00062 # endif /* STLSoft version */
00063 # include <stlsoft/conversion/sap_cast.hpp>
00064 #endif /* __cplusplus */
00065 
00066 /* /////////////////////////////////////////////////////////////////////////////
00067  * Exceptions
00068  */
00069 
00070 #ifdef __cplusplus
00071 # if defined(STLSOFT_CF_EXCEPTION_SUPPORT) || \
00072      defined(STLSOFT_CF_EXCEPTION_SUPPORT)
00073 #  define _RECLS_EXCEPTION_SUPPORT
00074 #  ifdef STLSOFT_CF_THROW_BAD_ALLOC
00075 #   define RECLS_COMPILER_THROWS_ON_NEW_FAIL
00076 #  endif /* STLSOFT_CF_THROW_BAD_ALLOC */
00077 # endif /* STLSOFT_CF_EXCEPTION_SUPPORT || STLSOFT_CF_EXCEPTION_SUPPORT */
00078 #endif /* __cplusplus */
00079 
00080 /* /////////////////////////////////////////////////////////////////////////////
00081  * Debugging?
00082  */
00083 
00092 #if !defined(NDEBUG)
00093 # if defined(RECLS_PLATFORM_IS_UNIX)
00094 #  define _RECLS_DEBUG
00095 # elif defined(RECLS_PLATFORM_IS_WIN32) && \
00096        (   defined(DEBUG) || \
00097            defined(_DEBUG))
00098 #  define _RECLS_DEBUG
00099 # endif /* platform */
00100 #endif /* debug */
00101 
00110 #ifdef _RECLS_DEBUG
00111 # ifndef RECLS_DEBUG_LEVEL
00112 #  define RECLS_DEBUG_LEVEL 1
00113 # endif /* RECLS_DEBUG_LEVEL */
00114 #else /* ? _RECLS_DEBUG */
00115 # ifdef RECLS_DEBUG_LEVEL
00116 #  undef RECLS_DEBUG_LEVEL
00117 # endif /* RECLS_DEBUG_LEVEL */
00118 # define RECLS_DEBUG_LEVEL  0
00119 #endif /* _RECLS_DEBUG */
00120 
00121 /* /////////////////////////////////////////////////////////////////////////////
00122  * Contract enforcement
00123  */
00124 
00127 #if defined(_RECLS_DEBUG) || \
00128     defined(RECLS_ENFORCE_CONTRACTS)
00129 # define RECLS_ENFORCING_CONTRACTS
00130 #endif /* _RECLS_DEBUG || RECLS_ENFORCE_CONTRACTS */
00131 
00132 /* /////////////////////////////////////////////////////////////////////////////
00133  * Multithreading
00134  */
00135 
00138 #if defined(RECLS_PLATFORM_IS_UNIX)
00139 # if defined(_REENTRANT)
00140 #  define _RECLS_MT
00141 # elif defined(WIN32) && \
00142        defined(EMULATE_UNIX_ON_WIN32) && \
00143        (    defined(_MT) || \
00144             defined(__MT__))
00145 #  define _RECLS_MT
00146 #  ifndef _REENTRANT
00147 #   define _REENTRANT
00148 #  endif /* !_REENTRANT */
00149 # endif /* threads? */
00150 #elif defined(RECLS_PLATFORM_IS_WIN32)
00151 # if defined(_MT) || \
00152      defined(__MT__)
00153 #  define _RECLS_MT
00154 # endif /* threads? */
00155 #endif /* platform */
00156 
00157 /* /////////////////////////////////////////////////////////////////////////////
00158  * RECLS_NUM_ELEMENTS
00159  */
00160 
00161 #ifndef RECLS_NUM_ELEMENTS
00162 # if defined(stlsoft_num_elements)
00163 #  define RECLS_NUM_ELEMENTS(x)             stlsoft_num_elements(x)
00164 # else /* ? stlsoft_num_elements */
00165 #  define RECLS_NUM_ELEMENTS(x)             (sizeof(x) / sizeof((x)[0]))
00166 # endif /* stlsoft_num_elements */
00167 #endif /* !RECLS_NUM_ELEMENTS */
00168 
00169 /* /////////////////////////////////////////////////////////////////////////////
00170  * Multi-part patterns
00171  */
00172 
00173 #if (   !defined(RECLS_COMPILER_IS_MSVC) || \
00174         _MSC_VER >= 1200) && \
00175     !defined(RECLS_COMPILER_IS_WATCOM)
00176 # define _RECLS_SUPPORTS_MULTIPATTERN
00177 #endif /* compiler */
00178 
00179 /* ////////////////////////////////////////////////////////////////////////// */
00180 
00181 #endif /* !RECLS_INCL_H_RECLS_IMPL */
00182 
00183 /* ////////////////////////////////////////////////////////////////////////// */

recls Library documentation © Synesis Software Pty Ltd, 2001-2006