Synesis Software

Main Page   Modules   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

/cstring/implicit_link.h

Go to the documentation of this file.
00001 /* 
00002  * File:    cstring/implicit_link.h
00003  *
00004  * Purpose: Implicit linking for the cstring API.
00005  *
00006  * Created: 18th August 2005
00007  * Updated: 19th August 2005
00008  *
00009  * Home:    http://synesis.com.au/software/
00010  *
00011  * Copyright 1994-2005, 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 provided that the following conditions are met:
00016  *
00017  * - Redistributions of source code must retain the above copyright notice, this
00018  *   list of conditions and the following disclaimer. 
00019  * - Redistributions in binary form must reproduce the above copyright notice,
00020  *   this list of conditions and the following disclaimer in the documentation
00021  *   and/or other materials provided with the distribution.
00022  * - Neither the names of Matthew Wilson and Synesis Software nor the names of
00023  *   any contributors may be used to endorse or promote products derived from
00024  *   this software without specific prior written permission.
00025  *
00026  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
00027  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
00028  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
00029  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
00030  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
00031  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
00032  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
00033  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
00034  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
00035  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00036  * POSSIBILITY OF SUCH DAMAGE.
00037  *
00038  * 
00039 
00040 
00044 #ifndef CSTRING_INCL_IMPLICIT_LINK
00045 #define CSTRING_INCL_IMPLICIT_LINK
00046 
00047 /* 
00048  * Version
00049  */
00050 
00051 #ifndef CSTRING_DOCUMENTATION_SKIP_SECTION
00052 # define CSTRING_VER_CSTRING_H_IMPLICIT_LINK_MAJOR      1
00053 # define CSTRING_VER_CSTRING_H_IMPLICIT_LINK_MINOR      0
00054 # define CSTRING_VER_CSTRING_H_IMPLICIT_LINK_REVISION   1
00055 # define CSTRING_VER_CSTRING_H_IMPLICIT_LINK_EDIT       1
00056 #endif /* !CSTRING_DOCUMENTATION_SKIP_SECTION */
00057 
00058 /* 
00059  * Includes
00060  */
00061 
00062 #include <cstring/cstring.h>
00063 
00064 /* 
00065  * Implicit linking
00066  */
00067 
00068 #if defined(WIN32) || \
00069     defined(_WIN32)
00070 
00071 # if defined(__BORLANDC__) || \
00072      /* defined(__DMC__) || */ \
00073      defined(__INTEL_COMPILER) || \
00074      defined(__MWERKS__) || \
00075      defined(_MSC_VER)
00076 #  define CSTRING_IMPLICIT_LINK_SUPPORT
00077 # endif /* compiler */
00078 
00079 
00080 # if defined(CSTRING_IMPLICIT_LINK_SUPPORT)
00081 
00082 #  if defined(__BORLANDC__)
00083 #   if __BORLANDC__ == 0x0550
00084 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "bc55"
00085 #   elif (__BORLANDC__ == 0x0551)
00086 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "bc551"
00087 #   elif (__BORLANDC__ == 0x0560)
00088 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "bc56"
00089 #   elif (__BORLANDC__ == 0x0564)
00090 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "bc564"
00091 #   else /* ? __BORLANDC__ */
00092 #    error Unrecognised value of __BORLANDC__
00093 #   endif /* __BORLANDC__ */
00094 
00095 /*
00096 #  elif defined(__DMC__)
00097 #   define CSTRING_IMPL_LINK_COMPILER_NAME                      "dm"
00098  */
00099 
00100 #  elif defined(__INTEL_COMPILER)
00101 #   if (__INTEL_COMPILER == 600)
00102 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "icl6"
00103 #   elif (__INTEL_COMPILER == 700)
00104 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "icl7"
00105 #   elif (__INTEL_COMPILER == 800)
00106 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "icl8"
00107 #   else /* ? __INTEL_COMPILER */
00108 #    error Unrecognised value of __INTEL_COMPILER
00109 #   endif /* __INTEL_COMPILER */
00110 
00111 #  elif defined(__MWERKS__)
00112 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00113 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "cw7"
00114 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00115 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "cw8"
00116 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00117 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "cw9"
00118 #   else /* ? __MWERKS__ */
00119 #    error Unrecognised value of __MWERKS__
00120 #   endif /* __MWERKS__ */
00121 
00122 #  elif defined(_MSC_VER)
00123 #   if _MSC_VER == 1000
00124 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc4"
00125 #   elif _MSC_VER == 1020
00126 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc42"
00127 #   elif _MSC_VER == 1100
00128 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc5"
00129 #   elif _MSC_VER == 1200
00130 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc6"
00131 #   elif _MSC_VER == 1300
00132 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc7"
00133 #   elif _MSC_VER == 1310
00134 #    define CSTRING_IMPL_LINK_COMPILER_NAME                 "vc71"
00135 #   elif _MSC_VER == 1400
00136 #    define CSTRING_IMPL_LINK_COMPILER_NAME                     "vc8"
00137 #   else /* ? _MSC_VER */
00138 #    error Unrecognised value of _MSC_VER
00139 #   endif /* _MSC_VER */
00140 
00141 #  else /* ? compiler */
00142 #   error Unrecognised compiler
00143 #  endif /* compiler */
00144 
00145 
00146 # if defined(__MT__) || \
00147      defined(_REENTRANT) || \
00148      defined(_MT)
00149 #  if defined(_DLL) || \
00150       defined(__DLL)
00151 #   define CSTRING_IMPL_LINK_THREADING_TYPE                     ".dll"
00152 #  else /* ? dll */
00153 #   define CSTRING_IMPL_LINK_THREADING_TYPE                     ".mt"
00154 #  endif /* dll */
00155 # else /* ? mt */
00156 #   define CSTRING_IMPL_LINK_THREADING_TYPE                     ""
00157 # endif /* mt */
00158 
00159 
00160 # if !defined(NDEBUG) && \
00161      defined(_DEBUG)
00162 #  define CSTRING_IMPL_LINK_DEBUG_TYPE                          ".debug"
00163 # else /* ? debug */
00164 #  define CSTRING_IMPL_LINK_DEBUG_TYPE                          ""
00165 # endif /* debug */
00166 
00167 #  define CSTRING_IMPL_LINK_LIBRARY_BASENAME_s_(x)      #x
00168 #  define CSTRING_IMPL_LINK_LIBRARY_BASENAME_s(x)       CSTRING_IMPL_LINK_LIBRARY_BASENAME_s_(x)
00169 #  define CSTRING_IMPL_LINK_LIBRARY_BASENAME            "cstring." CSTRING_IMPL_LINK_LIBRARY_BASENAME_s(CSTRING_VER_MAJOR) "."
00170 
00171 #  define CSTRING_IMPL_LINK_LIBRARY_NAME                        CSTRING_IMPL_LINK_LIBRARY_BASENAME CSTRING_IMPL_LINK_COMPILER_NAME CSTRING_IMPL_LINK_THREADING_TYPE CSTRING_IMPL_LINK_DEBUG_TYPE ".lib"
00172 
00173 #  pragma message("lib: " CSTRING_IMPL_LINK_LIBRARY_NAME)
00174 
00175 #  pragma comment(lib, CSTRING_IMPL_LINK_LIBRARY_NAME)
00176 
00177 # endif /* CSTRING_IMPLICIT_LINK_SUPPORT */
00178 
00179 #endif /* Win32 */
00180 
00181 /* 
00182 
00183 #endif /* CSTRING_INCL_IMPLICIT_LINK */
00184 
00185 /* 

cstring Library documentation © Matthew Wilson and Synesis Software Pty Ltd, 1994-2005