|
|
|
|
|
|
|
|
|
|
|
|||||||
00001 /* 00002 * File: dotnetstl.h 00003 * 00004 * Purpose: Root header for the .netSTL libraries. Performs various compiler 00005 * and platform discriminations, and definitions of types. 00006 * 00007 * Created: 12th May 2003 00008 * Updated: 11th September 2004 00009 * 00010 * Home: http://stlsoft.org/ 00011 * 00012 * Copyright (c) 2003-2004, Matthew Wilson and Synesis Software 00013 * All rights reserved. 00014 * 00015 * Redistribution and use in source and binary forms, with or without 00016 * modification, are permitted provided that the following conditions are met: 00017 * 00018 * - Redistributions of source code must retain the above copyright notice, this 00019 * list of conditions and the following disclaimer. 00020 * - Redistributions in binary form must reproduce the above copyright notice, 00021 * this list of conditions and the following disclaimer in the documentation 00022 * and/or other materials provided with the distribution. 00023 * - Neither the name(s) of Matthew Wilson and Synesis Software nor the names of 00024 * any contributors may be used to endorse or promote products derived from 00025 * this software without specific prior written permission. 00026 * 00027 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 00028 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 00029 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 00030 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 00031 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 00032 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 00033 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 00034 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 00035 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 00036 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 00037 * POSSIBILITY OF SUCH DAMAGE. 00038 * 00039 * 00040 00041 00042 #ifndef DOTNETSTL_INCL_H_DOTNETSTL 00043 #define DOTNETSTL_INCL_H_DOTNETSTL 00044 00045 /* File version */ 00046 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION 00047 # define DOTNETSTL_VER_HDOTNETSTL_MAJOR 2 00048 # define DOTNETSTL_VER_HDOTNETSTL_MINOR 0 00049 # define DOTNETSTL_VER_HDOTNETSTL_REVISION 1 00050 # define DOTNETSTL_VER_HDOTNETSTL_EDIT 16 00051 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00052 00096 /* 00097 * .netSTL version 00098 * 00099 * The libraries version information is comprised of major, minor and revision 00100 * components. 00101 * 00102 * The major version is denoted by the DOTNETSTL_VER_MAJOR preprocessor symbol. 00103 * A changes to the major version component implies that a dramatic change has 00104 * occurred in the libraries, such that considerable changes to source dependent 00105 * on previous versions would need to be effected. 00106 * 00107 * The minor version is denoted by the DOTNETSTL_VER_MINOR preprocessor symbol. 00108 * Changes to the minor version component imply that a significant change has 00109 * occurred to the libraries, either in the addition of new functionality or in 00110 * the destructive change to one or more components such that recomplilation and 00111 * code change may be necessitated. 00112 * 00113 * The revision version is denoted by the DOTNETSTL_VER_REVISIO preprocessor 00114 * symbol. Changes to the revision version component imply that a bug has been 00115 * fixed. Dependent code should be recompiled in order to pick up the changes. 00116 * 00117 * In addition to the individual version symbols - DOTNETSTL_VER_MAJOR, 00118 * DOTNETSTL_VER_MINOR and DOTNETSTL_VER_REVISION - a composite symbol DOTNETSTL_VER 00119 * is defined, where the upper 8 bits are 0, bits 16-23 represent the major 00120 * component, bits 8-15 represent the minor component, and bits 0-7 represent 00121 * the revision component. 00122 * 00123 * Each release of the libraries will bear a different version, and that version 00124 * will also have its own symbol: Version 1.0.1 specifies DOTNETSTL_VER_1_0_1. 00125 * 00126 * Thus the symbol DOTNETSTL_VER may be compared meaningfully with a specific 00127 * version symbol, e.g. #if DOTNETSTL_VER >= DOTNETSTL_VER_1_0_1 00128 */ 00129 00132 00135 00138 00141 00142 #define DOTNETSTL_VER_MAJOR 1 00143 #define DOTNETSTL_VER_MINOR 1 00144 #define DOTNETSTL_VER_REVISION 1 00145 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION 00146 # define DOTNETSTL_VER_1_0_1 0x00010001 00147 # define DOTNETSTL_VER_1_1_1 0x00010101 00148 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00149 00150 #define DOTNETSTL_VER DOTNETSTL_VER_1_1_1 00151 00152 /* 00153 * Includes 00154 */ 00155 00156 #ifndef STLSOFT_INCL_H_STLSOFT 00157 # include "stlsoft.h" // STLSoft root header 00158 #endif /* !STLSOFT_INCL_H_STLSOFT */ 00159 00160 /* 00161 * STLSoft version compatibility 00162 */ 00163 00164 #if !defined(_STLSOFT_VER_1_6_3) || \ 00165 _STLSOFT_VER < _STLSOFT_VER_1_6_3 00166 # error This version of the .netSTL libraries requires STLSoft version 1.6.3 or later 00167 #endif /* _STLSOFT_VER < _STLSOFT_VER_1_6_3 */ 00168 00169 /* 00170 * Compiler compatibility 00171 * 00172 * Currently the only compilers supported by the .netSTL libraries are 00173 * 00174 * Borland C++ 5.5, 5.51, 5.6 00175 * Digital Mars C/C++ 8.26 - 8.32 00176 * Metrowerks 2.4 & 3.0 (CodeWarrior 7.0 & 8.0) 00177 * Intel C/C++ 6.0 00178 * Visual C++ 5.0, 6.0, 7.0 00179 */ 00180 00181 #if defined(__STLSOFT_COMPILER_IS_MSVC) 00182 /* Visual C++ */ 00183 # if _MSC_VER < 1300 00184 # error Versions of Visual C++ prior to 7.0 are not supported by the .netSTL libraries 00185 # endif /* _MSC_VER */ 00186 00187 #else 00188 /* No recognised compiler */ 00189 # ifdef _STLSOFT_FORCE_ANY_COMPILER 00190 # define DOTNETSTL_COMPILER_IS_UNKNOWN 00191 # ifdef _STLSOFT_COMPILE_VERBOSE 00192 # pragma message("Compiler is unknown to .netSTL") 00193 # endif /* _STLSOFT_COMPILE_VERBOSE */ 00194 # else 00195 # error Currently only Visual C++ compilers are supported by the .netSTL libraries 00196 # endif /* _STLSOFT_FORCE_ANY_COMPILER */ 00197 #endif /* compiler */ 00198 00199 /* 00200 * More includes 00201 */ 00202 00203 #if _MSC_VER >= 1310 00204 # using <mscorlib.dll> 00205 #else /* ? _MSC_VER */ 00206 # using <system.dll> 00207 #endif /* _MSC_VER */ 00208 00209 /* 00210 * Debugging 00211 * 00212 * The macro dotnetstl_assert provides standard debug-mode assert functionality. 00213 */ 00214 00218 #define dotnetstl_assert(expr) stlsoft_assert(expr) 00219 00224 #define dotnetstl_message_assert(msg, expr) stlsoft_message_assert(msg, expr) 00225 00229 #define dotnetstl_static_assert(expr) stlsoft_static_assert(expr) 00230 00231 /* 00232 * Namespace 00233 * 00234 * The .netSTL components are contained within the dotnetstl namespace. This is 00235 * usually an alias for stlsoft::dotnetstl_project, 00236 * 00237 * When compilers support namespaces they are defined by default. They can be 00238 * undefined using a cascasing system, as follows: 00239 * 00240 * DOTNETSTL_NO_NAMESPACES may not be defined. 00241 * 00242 * If _STLSOFT_NO_NAMESPACE is defined (whence the namespace stlsoft does not 00243 * exist), then the .netSTL constructs are defined within the dotnetstl 00244 * namespace. The definition matrix is as follows: 00245 * 00246 * _STLSOFT_NO_NAMESPACE dotnetstl definition 00247 * --------------------- ----------------- 00248 * not defined = stlsoft::dotnetstl_project 00249 * defined dotnetstl 00250 * 00251 * The macro dotnetstl_ns_qual() macro can be used to refer to elements in the 00252 * .netSTL libraries irrespective of whether they are in the 00253 * stlsoft::dotnetstl_project or dotnetstl namespaces. 00254 * 00255 * Furthermore, some compilers do not support the standard library in the std 00256 * namespace, so the dotnetstl_ns_qual_std() macro can be used to refer to elements 00257 * in the .netSTL libraries irrespective of whether they are in the std namespace 00258 * or in the global namespace. 00259 */ 00260 00261 /* Cannot define .netSTL entities within the global namespace */ 00262 #if defined(DOTNETSTL_NO_NAMESPACE) 00263 # error .netSTL constructs cannot be defined to be in the global namespace 00264 #endif /* DOTNETSTL_NO_NAMESPACE */ 00265 00266 00267 #ifdef _STLSOFT_NO_NAMESPACE 00268 /* There is no stlsoft namespace, so must define ::dotnetstl */ 00271 namespace dotnetstl 00272 { 00273 # else 00274 /* Define stlsoft::dotnetstl_project */ 00275 00276 namespace stlsoft 00277 { 00278 00279 namespace dotnetstl_project 00280 { 00281 00282 #endif /* _STLSOFT_NO_NAMESPACE */ 00283 00286 00289 00290 #define dotnetstl_ns_qual(x) ::dotnetstl::x 00291 #define dotnetstl_ns_using(x) using ::dotnetstl::x; 00292 00295 00298 00299 #ifdef __STLSOFT_CF_std_NAMESPACE 00300 # define dotnetstl_ns_qual_std(x) ::std::x 00301 # define dotnetstl_ns_using_std(x) using ::std::x; 00302 #else 00303 # define dotnetstl_ns_qual_std(x) x 00304 # define dotnetstl_ns_using_std(x) 00305 #endif /* !__STLSOFT_CF_std_NAMESPACE */ 00306 00307 /* 00308 * Typedefs 00309 * 00310 * The .netSTL uses a number of typedefs to aid in compiler-independence in the 00311 * libraries' main code. 00312 */ 00313 00314 typedef stlsoft_ns_qual(ss_char_a_t) ds_char_a_t; 00315 typedef stlsoft_ns_qual(ss_char_w_t) ds_char_w_t; 00316 typedef stlsoft_ns_qual(ss_sint8_t) ds_sint8_t; 00317 typedef stlsoft_ns_qual(ss_uint8_t) ds_uint8_t; 00318 typedef stlsoft_ns_qual(ss_int16_t) ds_int16_t; 00319 typedef stlsoft_ns_qual(ss_sint16_t) ds_sint16_t; 00320 typedef stlsoft_ns_qual(ss_uint16_t) ds_uint16_t; 00321 typedef stlsoft_ns_qual(ss_int32_t) ds_int32_t; 00322 typedef stlsoft_ns_qual(ss_sint32_t) ds_sint32_t; 00323 typedef stlsoft_ns_qual(ss_uint32_t) ds_uint32_t; 00324 #ifdef STLSOFT_CF_64BIT_INT_SUPPORT 00325 typedef stlsoft_ns_qual(ss_int64_t) ds_int64_t; 00326 typedef stlsoft_ns_qual(ss_sint64_t) ds_sint64_t; 00327 typedef stlsoft_ns_qual(ss_uint64_t) ds_uint64_t; 00328 #endif /* STLSOFT_CF_64BIT_INT_SUPPORT */ 00329 typedef stlsoft_ns_qual(ss_int_t) ds_int_t; 00330 typedef stlsoft_ns_qual(ss_sint_t) ds_sint_t; 00331 typedef stlsoft_ns_qual(ss_uint_t) ds_uint_t; 00332 typedef stlsoft_ns_qual(ss_long_t) ds_long_t; 00333 typedef stlsoft_ns_qual(ss_bool_t) ds_bool_t; 00334 typedef stlsoft_ns_qual(ss_size_t) ds_size_t; 00335 typedef stlsoft_ns_qual(ss_ptrdiff_t) ds_ptrdiff_t; 00336 typedef stlsoft_ns_qual(ss_streampos_t) ds_streampos_t; 00337 typedef stlsoft_ns_qual(ss_streamoff_t) ds_streamoff_t; 00338 00339 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION 00340 /* 00341 * Values 00342 * 00343 * Since the boolean type may not be supported natively on all compilers, the 00344 * values of true and false may also not be provided. Hence the values of 00345 * ds_true_v and ds_false_v are defined, and are used in all code. 00346 */ 00347 00348 #define ds_true_v ss_true_v 00349 #define ds_false_v ss_false_v 00350 00351 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00352 /* 00353 * Code modification macros 00354 */ 00355 00356 #ifndef __STLSOFT_DOCUMENTATION_SKIP_SECTION 00357 /* Exception signatures. */ 00358 # define dotnetstl_throw_0() stlsoft_throw_0() 00359 # define dotnetstl_throw_1(x1) stlsoft_throw_1(x1) 00360 # define dotnetstl_throw_2(x1, x2) stlsoft_throw_2(x1, x2) 00361 # define dotnetstl_throw_3(x1, x2, x3) stlsoft_throw_3(x1, x2, x3) 00362 # define dotnetstl_throw_4(x1, x2, x3, x4) stlsoft_throw_4(x1, x2, x3, x4) 00363 # define dotnetstl_throw_5(x1, x2, x3, x4, x5) stlsoft_throw_5(x1, x2, x3, x4, x5) 00364 # define dotnetstl_throw_6(x1, x2, x3, x4, x5, x6) stlsoft_throw_6(x1, x2, x3, x4, x5, x6) 00365 # define dotnetstl_throw_7(x1, x2, x3, x4, x5, x6, x7) stlsoft_throw_7(x1, x2, x3, x4, x5, x6, x7) 00366 # define dotnetstl_throw_8(x1, x2, x3, x4, x5, x6, x7, x8) stlsoft_throw_8(x1, x2, x3, x4, x5, x6, x7, x8) 00367 #endif /* !__STLSOFT_DOCUMENTATION_SKIP_SECTION */ 00368 00370 #define dotnetstl_num_elements(ar) stlsoft_num_elements(ar) 00371 00373 #define dotnetstl_destroy_instance(t, _type, p) stlsoft_destroy_instance(t, _type, p) 00374 00376 #define dotnetstl_gen_opaque(_htype) stlsoft_gen_opaque(_htype) 00377 00378 /* 00379 00380 #ifndef DOTNETSTL_NO_NAMESPACE 00381 # if defined(_STLSOFT_NO_NAMESPACE) || \ 00382 defined(__STLSOFT_DOCUMENTATION_SKIP_SECTION) 00383 } // namespace dotnetstl 00384 # else 00385 } // namespace dotnetstl_project 00386 } // namespace stlsoft 00387 namespace dotnetstl = ::stlsoft::dotnetstl_project; 00388 # endif /* _STLSOFT_NO_NAMESPACE */ 00389 #endif /* !DOTNETSTL_NO_NAMESPACE */ 00390 00391 /* 00392 00393 #endif /* DOTNETSTL_INCL_H_DOTNETSTL */ 00394 00395 /*
|
|
| STLSoft Libraries documentation © Synesis Software Pty Ltd, 2001-2004 |