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: 21st April 2009
00008  *
00009  * Home:    http://synesis.com.au/software/
00010  *
00011  * Copyright (c) 2006-2009, 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
00016  * met:
00017  *
00018  * - Redistributions of source code must retain the above copyright notice,
00019  *   this list of conditions and the following disclaimer.
00020  * - Redistributions in binary form must reproduce the above copyright
00021  *   notice, this list of conditions and the following disclaimer in the
00022  *   documentation and/or other materials provided with the distribution.
00023  * - Neither the names of Matthew Wilson and Synesis Software nor the names
00024  *   of any contributors may be used to endorse or promote products derived
00025  *   from this software without specific prior written permission.
00026  *
00027  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
00028  * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
00029  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
00030  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
00031  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
00032  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
00033  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
00034  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
00035  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00036  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00037  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00038  *
00039  * ////////////////////////////////////////////////////////////////////// */
00040 
00041 
00049 #ifndef B64_INCL_B64_H_IMPLICIT_LINK
00050 #define B64_INCL_B64_H_IMPLICIT_LINK
00051 
00052 /* /////////////////////////////////////////////////////////////////////////
00053  * Version
00054  */
00055 
00056 #ifndef B64_DOCUMENTATION_SKIP_SECTION
00057 # define B64_VER_B64_H_IMPLICIT_LINK_MAJOR      1
00058 # define B64_VER_B64_H_IMPLICIT_LINK_MINOR      2
00059 # define B64_VER_B64_H_IMPLICIT_LINK_REVISION   1
00060 # define B64_VER_B64_H_IMPLICIT_LINK_EDIT       7
00061 #endif /* !B64_DOCUMENTATION_SKIP_SECTION */
00062 
00063 /* /////////////////////////////////////////////////////////////////////////
00064  * Includes
00065  */
00066 
00067 #ifndef B64_INCL_B64_H_B64
00068 # include <b64/b64.h>
00069 #endif /* !B64_INCL_B64_H_B64 */
00070 
00071 /* /////////////////////////////////////////////////////////////////////////
00072  * Implicit linking
00073  */
00074 
00075 #if defined(_WIN32) || \
00076     defined(_WIN64)
00077 
00078 # if defined(__BORLANDC__) || \
00079      /* defined(__DMC__) || */ \
00080      defined(__INTEL_COMPILER) || \
00081      defined(__MWERKS__) || \
00082      defined(_MSC_VER)
00083 #  if !defined(__COMO__)
00084 #   define B64_IMPLICIT_LINK_SUPPORT
00085 #  endif /* compiler */
00086 # endif /* compiler */
00087 
00088 #if defined(B64_IMPLICIT_LINK_SUPPORT) && \
00089     defined(B64_NO_IMPLICIT_LINK)
00090 # undef B64_IMPLICIT_LINK_SUPPORT
00091 #endif /* B64_IMPLICIT_LINK_SUPPORT && B64_NO_IMPLICIT_LINK */
00092 
00093 # if defined(B64_IMPLICIT_LINK_SUPPORT)
00094 
00095   /* prefix */
00096 
00097 #  define B64_IMPL_LINK_PREFIX
00098 
00099   /* library basename */
00100 
00101 #  define B64_IMPL_LINK_LIBRARY_BASENAME        "b64"
00102 
00103   /* major version */
00104 
00105 #  define B64_IMPL_LINK_MAJOR_VERSION_STRINGIZE_2_(x)   #x
00106 #  define B64_IMPL_LINK_MAJOR_VERSION_STRINGIZE_1_(x)   B64_IMPL_LINK_MAJOR_VERSION_STRINGIZE_2_(x)
00107 
00108 #  define B64_IMPL_LINK_MAJOR_VERSION           "." B64_IMPL_LINK_MAJOR_VERSION_STRINGIZE_1_(B64_VER_MAJOR)
00109 
00110   /* module name */
00111 
00112 #  define B64_IMPL_LINK_MODULE_NAME             ".core"
00113 
00114   /* compiler tag */
00115 
00116 #  if defined(__BORLANDC__)
00117 #   if __BORLANDC__ == 0x0550
00118 #    define B64_IMPL_LINK_COMPILER_NAME         "bc55"
00119 #   elif (__BORLANDC__ == 0x0551)
00120 #    define B64_IMPL_LINK_COMPILER_NAME         "bc551"
00121 #   elif (__BORLANDC__ == 0x0560)
00122 #    define B64_IMPL_LINK_COMPILER_NAME         "bc56"
00123 #   elif (__BORLANDC__ == 0x0564)
00124 #    define B64_IMPL_LINK_COMPILER_NAME         "bc564"
00125 #   elif (__BORLANDC__ == 0x0582)
00126 #    define B64_IMPL_LINK_COMPILER_NAME         "bc582"
00127 #   elif (0x0590 == (__BORLANDC__ & 0xfff0))
00128 #    define B64_IMPL_LINK_COMPILER_NAME         "bc59x"
00129 #   elif (0x0610 == (__BORLANDC__ & 0xfff0))
00130 #    define B64_IMPL_LINK_COMPILER_NAME         "bc61x"
00131 #   else /* ? __BORLANDC__ */
00132 #    error Unrecognised value of __BORLANDC__
00133 #   endif /* __BORLANDC__ */
00134 
00135 /*
00136 #  elif defined(__DMC__)
00137 #   define B64_IMPL_LINK_COMPILER_NAME          "dm"
00138  */
00139 
00140 #  elif defined(__INTEL_COMPILER)
00141 #   if (__INTEL_COMPILER == 600)
00142 #    define B64_IMPL_LINK_COMPILER_NAME         "icl6"
00143 #   elif (__INTEL_COMPILER == 700)
00144 #    define B64_IMPL_LINK_COMPILER_NAME         "icl7"
00145 #   elif (__INTEL_COMPILER == 800)
00146 #    define B64_IMPL_LINK_COMPILER_NAME         "icl8"
00147 #   elif (__INTEL_COMPILER == 900)
00148 #    define B64_IMPL_LINK_COMPILER_NAME         "icl9"
00149 #   elif (__INTEL_COMPILER == 1000)
00150 #    define B64_IMPL_LINK_COMPILER_NAME         "icl10"
00151 #   elif (__INTEL_COMPILER == 1100)
00152 #    define B64_IMPL_LINK_COMPILER_NAME         "icl11"
00153 #   else /* ? __INTEL_COMPILER */
00154 #    error Unrecognised value of __INTEL_COMPILER
00155 #   endif /* __INTEL_COMPILER */
00156 
00157 #  elif defined(__MWERKS__)
00158 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00159 #    define B64_IMPL_LINK_COMPILER_NAME         "cw7"
00160 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00161 #    define B64_IMPL_LINK_COMPILER_NAME         "cw8"
00162 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00163 #    define B64_IMPL_LINK_COMPILER_NAME         "cw9"
00164 #   else /* ? __MWERKS__ */
00165 #    error Unrecognised value of __MWERKS__
00166 #   endif /* __MWERKS__ */
00167 
00168 #  elif defined(_MSC_VER)
00169 #   if _MSC_VER == 1000
00170 #    define B64_IMPL_LINK_COMPILER_NAME         "vc4"
00171 #   elif _MSC_VER == 1020
00172 #    define B64_IMPL_LINK_COMPILER_NAME         "vc42"
00173 #   elif _MSC_VER == 1100
00174 #    define B64_IMPL_LINK_COMPILER_NAME         "vc5"
00175 #   elif _MSC_VER == 1200
00176 #    define B64_IMPL_LINK_COMPILER_NAME         "vc6"
00177 #   elif _MSC_VER == 1300
00178 #    define B64_IMPL_LINK_COMPILER_NAME         "vc7"
00179 #   elif _MSC_VER == 1310
00180 #    define B64_IMPL_LINK_COMPILER_NAME         "vc71"
00181 #   elif _MSC_VER == 1400
00182 #    define B64_IMPL_LINK_COMPILER_NAME         "vc8"
00183 #   elif _MSC_VER == 1500
00184 #    define B64_IMPL_LINK_COMPILER_NAME         "vc9"
00185 #   else /* ? _MSC_VER */
00186 #    error Unrecognised value of _MSC_VER
00187 #   endif /* _MSC_VER */
00188 
00189 #  else /* ? compiler */
00190 #   error Unrecognised compiler
00191 #  endif /* compiler */
00192 
00193 
00194   /* operating system tag */
00195 
00196 #  if defined(_STLSOFT_FORCE_ANY_COMPILER) && \
00197       defined(PLATFORMSTL_OS_IS_UNIX) && \
00198       defined(_WIN32)
00199 #   define B64_IMPL_LINK_OS_TAG                 ".unix"
00200 #  endif /* pseudo UNIX */
00201 
00202 #  if !defined(B64_IMPL_LINK_OS_TAG)
00203 #   define B64_IMPL_LINK_OS_TAG                 ""
00204 #  endif /* !B64_IMPL_LINK_OS_TAG */
00205 
00206 
00207   /* architecture tag */
00208 
00209 #  if defined(PLATFORMSTL_ARCH_IS_X86)
00210 #   define B64_IMPL_LINK_ARCH_TAG               ""
00211 #  elif defined(PLATFORMSTL_ARCH_IS_X64)
00212 #   define B64_IMPL_LINK_ARCH_TAG               ".x64"
00213 #  elif defined(PLATFORMSTL_ARCH_IS_IA64)
00214 #   define B64_IMPL_LINK_ARCH_TAG               ".ia64"
00215 #  endif /* arch */
00216 
00217 #  if !defined(B64_IMPL_LINK_ARCH_TAG)
00218 #   define B64_IMPL_LINK_ARCH_TAG               ""
00219 #  endif /* !B64_IMPL_LINK_ARCH_TAG */
00220 
00221 
00222   /* encoding tag */
00223 
00224 #  if defined(B64_USE_WIDE_STRINGS)
00225 #   define B64_IMPL_LINK_ENCODING_TAG           ".widestring"
00226 #  else /* ? B64_USE_WIDE_STRINGS */
00227 #   define B64_IMPL_LINK_ENCODING_TAG           ""
00228 #  endif /* B64_USE_WIDE_STRINGS */
00229 
00230 
00231   /* threading tag */
00232 
00233 # if defined(__MT__) || \
00234      defined(_REENTRANT) || \
00235      defined(_MT)
00236 #  if defined(_DLL) || \
00237       defined(__DLL)
00238 #   define B64_IMPL_LINK_THREADING_TAG          ".dll"
00239 #  else /* ? dll */
00240 #   define B64_IMPL_LINK_THREADING_TAG          ".mt"
00241 #  endif /* dll */
00242 # else /* ? mt */
00243 #   define B64_IMPL_LINK_THREADING_TAG          ""
00244 # endif /* mt */
00245 
00246 
00247   /* NoX */
00248 
00249 #  if defined(B64_CF_NOX)
00250 #   define B64_IMPL_LINK_NOX_TYPE               ".nox"
00251 #  else /* ? B64_CF_NOX */
00252 #   define B64_IMPL_LINK_NOX_TYPE               ""
00253 #  endif /* B64_CF_NOX */
00254 
00255 
00256   /* debug tag */
00257 
00258 # if defined(B64_VARIANT_TEST)
00259 #  define B64_IMPL_LINK_DEBUG_TYPE              ".test"
00260 # elif !defined(NDEBUG) && \
00261       defined(_DEBUG)
00262 #   define B64_IMPL_LINK_DEBUG_TAG              ".debug"
00263 #  else /* ? debug */
00264 #   define B64_IMPL_LINK_DEBUG_TAG              ""
00265 #  endif /* debug */
00266 
00267 
00268   /* suffix */
00269 
00270 #  define B64_IMPL_LINK_SUFFIX                  ".lib"
00271 
00272 
00273    /* Library name is:
00274     *
00275     * [lib]<library-basename>.<major-version>.<module-name>.<compiler-name>[.<os-arch-tag>][.<char-encoding-tag>][.<threading-tag>][.<nox-tag>][.<debug-tag>].{a|lib}
00276     */
00277 
00278 #  define B64_IMPL_LINK_LIBRARY_NAME            B64_IMPL_LINK_PREFIX \
00279                                                 B64_IMPL_LINK_LIBRARY_BASENAME \
00280                                                 B64_IMPL_LINK_MAJOR_VERSION \
00281                                                 B64_IMPL_LINK_MODULE_NAME \
00282                                                 "." B64_IMPL_LINK_COMPILER_NAME \
00283                                                 B64_IMPL_LINK_OS_TAG \
00284                                                 B64_IMPL_LINK_ARCH_TAG \
00285                                                 B64_IMPL_LINK_ENCODING_TAG \
00286                                                 B64_IMPL_LINK_THREADING_TAG \
00287                                                 B64_IMPL_LINK_NOX_TYPE \
00288                                                 B64_IMPL_LINK_DEBUG_TAG \
00289                                                 B64_IMPL_LINK_SUFFIX
00290                                                         
00291 
00292 #  pragma message("lib: " B64_IMPL_LINK_LIBRARY_NAME)
00293 
00294 #  pragma comment(lib, B64_IMPL_LINK_LIBRARY_NAME)
00295 
00296 # endif /* B64_IMPLICIT_LINK_SUPPORT */
00297 
00298 #endif /* Win-32 || Win-64 */
00299 
00300 /* ////////////////////////////////////////////////////////////////////// */
00301 
00302 #endif /* B64_INCL_B64_H_IMPLICIT_LINK */
00303 
00304 /* ///////////////////////////// end of file //////////////////////////// */
00305 

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