Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

b64/implicit_link.h

Go to the documentation of this file.
00001 /* /////////////////////////////////////////////////////////////////////////////
00002  * File:    b64/implicit_link.h
00003  *
00004  * Purpose: Implicit linking for the b64 API.
00005  *
00006  * Created: 5th March 2006
00007  * Updated: 8th March 2008
00008  *
00009  * Home:    http://synesis.com.au/software/
00010  *
00011  * Copyright (c) 2006-2008, 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 
00048 #ifndef B64_INCL_B64_H_IMPLICIT_LINK
00049 #define B64_INCL_B64_H_IMPLICIT_LINK
00050 
00051 /* /////////////////////////////////////////////////////////////////////////////
00052  * Version
00053  */
00054 
00055 #ifndef B64_DOCUMENTATION_SKIP_SECTION
00056 # define B64_VER_B64_H_IMPLICIT_LINK_MAJOR      1
00057 # define B64_VER_B64_H_IMPLICIT_LINK_MINOR      0
00058 # define B64_VER_B64_H_IMPLICIT_LINK_REVISION   3
00059 # define B64_VER_B64_H_IMPLICIT_LINK_EDIT       3
00060 #endif /* !B64_DOCUMENTATION_SKIP_SECTION */
00061 
00062 /* /////////////////////////////////////////////////////////////////////////////
00063  * Includes
00064  */
00065 
00066 #ifndef B64_INCL_B64_H_B64
00067 # include <b64/b64.h>
00068 #endif /* !B64_INCL_B64_H_B64 */
00069 
00070 /* /////////////////////////////////////////////////////////////////////////////
00071  * Implicit linking
00072  */
00073 
00074 #if defined(WIN32) || \
00075     defined(_WIN32)
00076 
00077 # if defined(__BORLANDC__) || \
00078      /* defined(__DMC__) || */ \
00079      defined(__INTEL_COMPILER) || \
00080      defined(__MWERKS__) || \
00081      defined(_MSC_VER)
00082 #  define B64_IMPLICIT_LINK_SUPPORT
00083 # endif /* compiler */
00084 
00085 #if defined(B64_IMPLICIT_LINK_SUPPORT) && \
00086     defined(B64_NO_IMPLICIT_LINK)
00087 # undef B64_IMPLICIT_LINK_SUPPORT
00088 #endif /* B64_IMPLICIT_LINK_SUPPORT && B64_NO_IMPLICIT_LINK */
00089 
00090 # if defined(B64_IMPLICIT_LINK_SUPPORT)
00091 
00092 #  if defined(__BORLANDC__)
00093 #   if __BORLANDC__ == 0x0550
00094 #    define B64_IMPL_LINK_COMPILER_NAME         "bc55"
00095 #   elif (__BORLANDC__ == 0x0551)
00096 #    define B64_IMPL_LINK_COMPILER_NAME         "bc551"
00097 #   elif (__BORLANDC__ == 0x0560)
00098 #    define B64_IMPL_LINK_COMPILER_NAME         "bc56"
00099 #   elif (__BORLANDC__ == 0x0564)
00100 #    define B64_IMPL_LINK_COMPILER_NAME         "bc564"
00101 #   else /* ? __BORLANDC__ */
00102 #    error Unrecognised value of __BORLANDC__
00103 #   endif /* __BORLANDC__ */
00104 
00105 /*
00106 #  elif defined(__DMC__)
00107 #   define B64_IMPL_LINK_COMPILER_NAME          "dm"
00108  */
00109 
00110 #  elif defined(__INTEL_COMPILER)
00111 #   if (__INTEL_COMPILER == 600)
00112 #    define B64_IMPL_LINK_COMPILER_NAME         "icl6"
00113 #   elif (__INTEL_COMPILER == 700)
00114 #    define B64_IMPL_LINK_COMPILER_NAME         "icl7"
00115 #   elif (__INTEL_COMPILER == 800)
00116 #    define B64_IMPL_LINK_COMPILER_NAME         "icl8"
00117 #   else /* ? __INTEL_COMPILER */
00118 #    error Unrecognised value of __INTEL_COMPILER
00119 #   endif /* __INTEL_COMPILER */
00120 
00121 #  elif defined(__MWERKS__)
00122 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00123 #    define B64_IMPL_LINK_COMPILER_NAME         "cw7"
00124 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00125 #    define B64_IMPL_LINK_COMPILER_NAME         "cw8"
00126 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00127 #    define B64_IMPL_LINK_COMPILER_NAME         "cw9"
00128 #   else /* ? __MWERKS__ */
00129 #    error Unrecognised value of __MWERKS__
00130 #   endif /* __MWERKS__ */
00131 
00132 #  elif defined(_MSC_VER)
00133 #   if _MSC_VER == 1000
00134 #    define B64_IMPL_LINK_COMPILER_NAME         "vc4"
00135 #   elif _MSC_VER == 1020
00136 #    define B64_IMPL_LINK_COMPILER_NAME         "vc42"
00137 #   elif _MSC_VER == 1100
00138 #    define B64_IMPL_LINK_COMPILER_NAME         "vc5"
00139 #   elif _MSC_VER == 1200
00140 #    define B64_IMPL_LINK_COMPILER_NAME         "vc6"
00141 #   elif _MSC_VER == 1300
00142 #    define B64_IMPL_LINK_COMPILER_NAME         "vc7"
00143 #   elif _MSC_VER == 1310
00144 #    define B64_IMPL_LINK_COMPILER_NAME         "vc71"
00145 #   elif _MSC_VER == 1400
00146 #    define B64_IMPL_LINK_COMPILER_NAME         "vc8"
00147 #   else /* ? _MSC_VER */
00148 #    error Unrecognised value of _MSC_VER
00149 #   endif /* _MSC_VER */
00150 
00151 #  else /* ? compiler */
00152 #   error Unrecognised compiler
00153 #  endif /* compiler */
00154 
00155 
00156 # if defined(__MT__) || \
00157      defined(_REENTRANT) || \
00158      defined(_MT)
00159 #  if defined(_DLL) || \
00160       defined(__DLL)
00161 #   define B64_IMPL_LINK_THREADING_TYPE         ".dll"
00162 #  else /* ? dll */
00163 #   define B64_IMPL_LINK_THREADING_TYPE         ".mt"
00164 #  endif /* dll */
00165 # else /* ? mt */
00166 #   define B64_IMPL_LINK_THREADING_TYPE         ""
00167 # endif /* mt */
00168 
00169 
00170 # if !defined(NDEBUG) && \
00171      defined(_DEBUG)
00172 #  define B64_IMPL_LINK_DEBUG_TYPE              ".debug"
00173 # else /* ? debug */
00174 #  define B64_IMPL_LINK_DEBUG_TYPE              ""
00175 # endif /* debug */
00176 
00177 #  define B64_IMPL_LINK_LIBRARY_BASENAME_s_(x)  #x
00178 #  define B64_IMPL_LINK_LIBRARY_BASENAME_s(x)   B64_IMPL_LINK_LIBRARY_BASENAME_s_(x)
00179 #  define B64_IMPL_LINK_LIBRARY_BASENAME        "b64." B64_IMPL_LINK_LIBRARY_BASENAME_s(B64_VER_MAJOR) "."
00180 
00181 #  define B64_IMPL_LINK_LIBRARY_NAME            B64_IMPL_LINK_LIBRARY_BASENAME B64_IMPL_LINK_COMPILER_NAME B64_IMPL_LINK_THREADING_TYPE B64_IMPL_LINK_DEBUG_TYPE ".lib"
00182 
00183 #  pragma message("lib: " B64_IMPL_LINK_LIBRARY_NAME)
00184 
00185 #  pragma comment(lib, B64_IMPL_LINK_LIBRARY_NAME)
00186 
00187 # endif /* B64_IMPLICIT_LINK_SUPPORT */
00188 
00189 #endif /* Win32 */
00190 
00191 /* ////////////////////////////////////////////////////////////////////////// */
00192 
00193 #endif /* B64_INCL_B64_H_IMPLICIT_LINK */
00194 
00195 /* ////////////////////////////////////////////////////////////////////////// */

b64 Library documentation © Synesis Software Pty Ltd, 2004-2007