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: 15th May 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      1
00058 # define B64_VER_B64_H_IMPLICIT_LINK_REVISION   2
00059 # define B64_VER_B64_H_IMPLICIT_LINK_EDIT       5
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(_WIN64)
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 #   elif (__BORLANDC__ == 0x0582)
00102 #    define B64_IMPL_LINK_COMPILER_NAME         "bc582"
00103 #   else /* ? __BORLANDC__ */
00104 #    error Unrecognised value of __BORLANDC__
00105 #   endif /* __BORLANDC__ */
00106 
00107 /*
00108 #  elif defined(__DMC__)
00109 #   define B64_IMPL_LINK_COMPILER_NAME          "dm"
00110  */
00111 
00112 #  elif defined(__INTEL_COMPILER)
00113 #   if (__INTEL_COMPILER == 600)
00114 #    define B64_IMPL_LINK_COMPILER_NAME         "icl6"
00115 #   elif (__INTEL_COMPILER == 700)
00116 #    define B64_IMPL_LINK_COMPILER_NAME         "icl7"
00117 #   elif (__INTEL_COMPILER == 800)
00118 #    define B64_IMPL_LINK_COMPILER_NAME         "icl8"
00119 #   else /* ? __INTEL_COMPILER */
00120 #    error Unrecognised value of __INTEL_COMPILER
00121 #   endif /* __INTEL_COMPILER */
00122 
00123 #  elif defined(__MWERKS__)
00124 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00125 #    define B64_IMPL_LINK_COMPILER_NAME         "cw7"
00126 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00127 #    define B64_IMPL_LINK_COMPILER_NAME         "cw8"
00128 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00129 #    define B64_IMPL_LINK_COMPILER_NAME         "cw9"
00130 #   else /* ? __MWERKS__ */
00131 #    error Unrecognised value of __MWERKS__
00132 #   endif /* __MWERKS__ */
00133 
00134 #  elif defined(_MSC_VER)
00135 #   if _MSC_VER == 1000
00136 #    define B64_IMPL_LINK_COMPILER_NAME         "vc4"
00137 #   elif _MSC_VER == 1020
00138 #    define B64_IMPL_LINK_COMPILER_NAME         "vc42"
00139 #   elif _MSC_VER == 1100
00140 #    define B64_IMPL_LINK_COMPILER_NAME         "vc5"
00141 #   elif _MSC_VER == 1200
00142 #    define B64_IMPL_LINK_COMPILER_NAME         "vc6"
00143 #   elif _MSC_VER == 1300
00144 #    define B64_IMPL_LINK_COMPILER_NAME         "vc7"
00145 #   elif _MSC_VER == 1310
00146 #    define B64_IMPL_LINK_COMPILER_NAME         "vc71"
00147 #   elif _MSC_VER == 1400
00148 #    if defined(_M_IX86)
00149 #     define B64_IMPL_LINK_COMPILER_NAME        "vc8"
00150 #    elif defined(_M_X64) || \
00151           defined(_M_AMD64)
00152 #     define B64_IMPL_LINK_COMPILER_NAME        "vc8_x64"
00153 #    elif defined(_M_IA64)
00154 #     define B64_IMPL_LINK_COMPILER_NAME        "vc8_ia64"
00155 #    else /* ? arch */
00156 #     error Unrecognised architecture
00157 #    endif /* arch */
00158 #   elif _MSC_VER == 1500
00159 #    if defined(_M_IX86)
00160 #     define B64_IMPL_LINK_COMPILER_NAME        "vc9"
00161 #    elif defined(_M_X64) || \
00162           defined(_M_AMD64)
00163 #     define B64_IMPL_LINK_COMPILER_NAME        "vc9_x64"
00164 #    elif defined(_M_IA64)
00165 #     define B64_IMPL_LINK_COMPILER_NAME        "vc9_ia64"
00166 #    else /* ? arch */
00167 #     error Unrecognised architecture
00168 #    endif /* arch */
00169 #   else /* ? _MSC_VER */
00170 #    error Unrecognised value of _MSC_VER
00171 #   endif /* _MSC_VER */
00172 
00173 #  else /* ? compiler */
00174 #   error Unrecognised compiler
00175 #  endif /* compiler */
00176 
00177 
00178 # if defined(__MT__) || \
00179      defined(_REENTRANT) || \
00180      defined(_MT)
00181 #  if defined(_DLL) || \
00182       defined(__DLL)
00183 #   define B64_IMPL_LINK_THREADING_TYPE         ".dll"
00184 #  else /* ? dll */
00185 #   define B64_IMPL_LINK_THREADING_TYPE         ".mt"
00186 #  endif /* dll */
00187 # else /* ? mt */
00188 #   define B64_IMPL_LINK_THREADING_TYPE         ""
00189 # endif /* mt */
00190 
00191 
00192 # if !defined(NDEBUG) && \
00193      defined(_DEBUG)
00194 #  define B64_IMPL_LINK_DEBUG_TYPE              ".debug"
00195 # else /* ? debug */
00196 #  define B64_IMPL_LINK_DEBUG_TYPE              ""
00197 # endif /* debug */
00198 
00199 #  define B64_IMPL_LINK_LIBRARY_BASENAME_s_(x)  #x
00200 #  define B64_IMPL_LINK_LIBRARY_BASENAME_s(x)   B64_IMPL_LINK_LIBRARY_BASENAME_s_(x)
00201 #  define B64_IMPL_LINK_LIBRARY_BASENAME        "b64." B64_IMPL_LINK_LIBRARY_BASENAME_s(B64_VER_MAJOR) "."
00202 
00203 #  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"
00204 
00205 #  pragma message("lib: " B64_IMPL_LINK_LIBRARY_NAME)
00206 
00207 #  pragma comment(lib, B64_IMPL_LINK_LIBRARY_NAME)
00208 
00209 # endif /* B64_IMPLICIT_LINK_SUPPORT */
00210 
00211 #endif /* Win32 */
00212 
00213 /* ////////////////////////////////////////////////////////////////////// */
00214 
00215 #endif /* B64_INCL_B64_H_IMPLICIT_LINK */
00216 
00217 /* ////////////////////////////////////////////////////////////////////// */

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