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: 16th June 2010
00008  *
00009  * Home:    http://synesis.com.au/software/
00010  *
00011  * Copyright (c) 2006-2010, 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      3
00059 # define B64_VER_B64_H_IMPLICIT_LINK_REVISION   1
00060 # define B64_VER_B64_H_IMPLICIT_LINK_EDIT       9
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  * Macros and definitions
00073  */
00074 
00075 #  define B64_IMPL_LINK_STRINGIZE_2_(x)   #x
00076 #  define B64_IMPL_LINK_STRINGIZE_1_(x)   B64_IMPL_LINK_STRINGIZE_2_(x)
00077 
00078 /* /////////////////////////////////////////////////////////////////////////
00079  * Implicit linking
00080  */
00081 
00082 #if defined(_WIN32) || \
00083     defined(_WIN64)
00084 
00085 # if defined(__BORLANDC__) || \
00086      /* defined(__DMC__) || */ \
00087      defined(__INTEL_COMPILER) || \
00088      defined(__MWERKS__) || \
00089      defined(_MSC_VER)
00090 #  if !defined(__COMO__)
00091 #   define B64_IMPLICIT_LINK_SUPPORT
00092 #  endif /* compiler */
00093 # endif /* compiler */
00094 
00095 #if defined(B64_IMPLICIT_LINK_SUPPORT) && \
00096     defined(B64_NO_IMPLICIT_LINK)
00097 # undef B64_IMPLICIT_LINK_SUPPORT
00098 #endif /* B64_IMPLICIT_LINK_SUPPORT && B64_NO_IMPLICIT_LINK */
00099 
00100 # if defined(B64_IMPLICIT_LINK_SUPPORT)
00101 
00102   /* prefix */
00103 
00104 #  define B64_IMPL_LINK_PREFIX
00105 
00106   /* library basename */
00107 
00108 #  define B64_IMPL_LINK_LIBRARY_BASENAME        "b64"
00109 
00110   /* major version */
00111 
00112 #  define B64_IMPL_LINK_MAJOR_VERSION           "." B64_IMPL_LINK_STRINGIZE_1_(B64_VER_MAJOR)
00113 
00114   /* module name */
00115 
00116 #  define B64_IMPL_LINK_MODULE_NAME             ".core"
00117 
00118   /* compiler tag */
00119 
00120 #  if defined(__BORLANDC__)
00121 #   if __BORLANDC__ == 0x0550
00122 #    define B64_IMPL_LINK_COMPILER_NAME         "bc55"
00123 #   elif (__BORLANDC__ == 0x0551)
00124 #    define B64_IMPL_LINK_COMPILER_NAME         "bc551"
00125 #   elif (__BORLANDC__ == 0x0560)
00126 #    define B64_IMPL_LINK_COMPILER_NAME         "bc56"
00127 #   elif (__BORLANDC__ == 0x0564)
00128 #    define B64_IMPL_LINK_COMPILER_NAME         "bc564"
00129 #   elif (__BORLANDC__ == 0x0582)
00130 #    define B64_IMPL_LINK_COMPILER_NAME         "bc582"
00131 #   elif (0x0590 == (__BORLANDC__ & 0xfff0))
00132 #    define B64_IMPL_LINK_COMPILER_NAME         "bc59x"
00133 #   elif (0x0610 == (__BORLANDC__ & 0xfff0))
00134 #    define B64_IMPL_LINK_COMPILER_NAME         "bc61x"
00135 #   else /* ? __BORLANDC__ */
00136 #    error Unrecognised value of __BORLANDC__
00137 #   endif /* __BORLANDC__ */
00138 
00139 /*
00140 #  elif defined(__DMC__)
00141 #   define B64_IMPL_LINK_COMPILER_NAME          "dm"
00142  */
00143 
00144 #  elif defined(__INTEL_COMPILER)
00145 #   if (__INTEL_COMPILER == 600)
00146 #    define B64_IMPL_LINK_COMPILER_NAME         "icl6"
00147 #   elif (__INTEL_COMPILER == 700)
00148 #    define B64_IMPL_LINK_COMPILER_NAME         "icl7"
00149 #   elif (__INTEL_COMPILER == 800)
00150 #    define B64_IMPL_LINK_COMPILER_NAME         "icl8"
00151 #   elif (__INTEL_COMPILER == 900)
00152 #    define B64_IMPL_LINK_COMPILER_NAME         "icl9"
00153 #   elif (__INTEL_COMPILER == 1000)
00154 #    define B64_IMPL_LINK_COMPILER_NAME         "icl10"
00155 #   elif (__INTEL_COMPILER == 1100)
00156 #    define B64_IMPL_LINK_COMPILER_NAME         "icl11"
00157 #   else /* ? __INTEL_COMPILER */
00158 #    error Unrecognised value of __INTEL_COMPILER
00159 #   endif /* __INTEL_COMPILER */
00160 
00161 #  elif defined(__MWERKS__)
00162 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
00163 #    define B64_IMPL_LINK_COMPILER_NAME         "cw7"
00164 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
00165 #    define B64_IMPL_LINK_COMPILER_NAME         "cw8"
00166 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
00167 #    define B64_IMPL_LINK_COMPILER_NAME         "cw9"
00168 #   else /* ? __MWERKS__ */
00169 #    error Unrecognised value of __MWERKS__
00170 #   endif /* __MWERKS__ */
00171 
00172 #  elif defined(_MSC_VER)
00173 #   if _MSC_VER == 1000
00174 #    define B64_IMPL_LINK_COMPILER_NAME         "vc4"
00175 #   elif _MSC_VER == 1020
00176 #    define B64_IMPL_LINK_COMPILER_NAME         "vc42"
00177 #   elif _MSC_VER == 1100
00178 #    define B64_IMPL_LINK_COMPILER_NAME         "vc5"
00179 #   elif _MSC_VER == 1200
00180 #    define B64_IMPL_LINK_COMPILER_NAME         "vc6"
00181 #   elif _MSC_VER == 1300
00182 #    define B64_IMPL_LINK_COMPILER_NAME         "vc7"
00183 #   elif _MSC_VER == 1310
00184 #    define B64_IMPL_LINK_COMPILER_NAME         "vc71"
00185 #   elif _MSC_VER == 1400
00186 #    define B64_IMPL_LINK_COMPILER_NAME         "vc8"
00187 #   elif _MSC_VER == 1500
00188 #    define B64_IMPL_LINK_COMPILER_NAME         "vc9"
00189 #   elif _MSC_VER == 1600
00190 #    define B64_IMPL_LINK_COMPILER_NAME         "vc10"
00191 #   else /* ? _MSC_VER */
00192 #    error Unrecognised value of _MSC_VER
00193 #   endif /* _MSC_VER */
00194 
00195 #  else /* ? compiler */
00196 #   error Unrecognised compiler
00197 #  endif /* compiler */
00198 
00199 
00200   /* operating system tag */
00201 
00202 #  if defined(_STLSOFT_FORCE_ANY_COMPILER) && \
00203       defined(PLATFORMSTL_OS_IS_UNIX) && \
00204       defined(_WIN32)
00205 #   define B64_IMPL_LINK_OS_TAG                 ".unix"
00206 #  endif /* pseudo UNIX */
00207 
00208 #  if !defined(B64_IMPL_LINK_OS_TAG)
00209 #   define B64_IMPL_LINK_OS_TAG                 ""
00210 #  endif /* !B64_IMPL_LINK_OS_TAG */
00211 
00212 
00213   /* architecture tag */
00214 
00215 #  if defined(PLATFORMSTL_ARCH_IS_X86)
00216 #   define B64_IMPL_LINK_ARCH_TAG               ""
00217 #  elif defined(PLATFORMSTL_ARCH_IS_X64)
00218 #   define B64_IMPL_LINK_ARCH_TAG               ".x64"
00219 #  elif defined(PLATFORMSTL_ARCH_IS_IA64)
00220 #   define B64_IMPL_LINK_ARCH_TAG               ".ia64"
00221 #  endif /* arch */
00222 
00223 #  if !defined(B64_IMPL_LINK_ARCH_TAG)
00224 #   define B64_IMPL_LINK_ARCH_TAG               ""
00225 #  endif /* !B64_IMPL_LINK_ARCH_TAG */
00226 
00227 
00228   /* encoding tag */
00229 
00230 #  if defined(B64_USE_WIDE_STRINGS)
00231 #   define B64_IMPL_LINK_ENCODING_TAG           ".widestring"
00232 #  else /* ? B64_USE_WIDE_STRINGS */
00233 #   define B64_IMPL_LINK_ENCODING_TAG           ""
00234 #  endif /* B64_USE_WIDE_STRINGS */
00235 
00236 
00237   /* threading tag */
00238 
00239 # if defined(__MT__) || \
00240      defined(_REENTRANT) || \
00241      defined(_MT)
00242 #  if defined(_DLL) || \
00243       defined(__DLL)
00244 #   define B64_IMPL_LINK_THREADING_TAG          ".dll"
00245 #  else /* ? dll */
00246 #   define B64_IMPL_LINK_THREADING_TAG          ".mt"
00247 #  endif /* dll */
00248 # else /* ? mt */
00249 #   define B64_IMPL_LINK_THREADING_TAG          ""
00250 # endif /* mt */
00251 
00252 
00253   /* NoX */
00254 
00255 #  if defined(B64_CF_NOX)
00256 #   define B64_IMPL_LINK_NOX_TYPE               ".nox"
00257 #  else /* ? B64_CF_NOX */
00258 #   define B64_IMPL_LINK_NOX_TYPE               ""
00259 #  endif /* B64_CF_NOX */
00260 
00261 
00262   /* debug tag */
00263 
00264 # if defined(B64_VARIANT_TEST)
00265 #  define B64_IMPL_LINK_DEBUG_TYPE              ".test"
00266 # elif !defined(NDEBUG) && \
00267       defined(_DEBUG)
00268 #   define B64_IMPL_LINK_DEBUG_TAG              ".debug"
00269 #  else /* ? debug */
00270 #   define B64_IMPL_LINK_DEBUG_TAG              ""
00271 #  endif /* debug */
00272 
00273 
00274   /* suffix */
00275 
00276 #  define B64_IMPL_LINK_SUFFIX                  ".lib"
00277 
00278 
00279    /* Library name is:
00280     *
00281     * [lib]<library-basename>.<major-version>.<module-name>.<compiler-name>[.<os-arch-tag>][.<char-encoding-tag>][.<threading-tag>][.<nox-tag>][.<debug-tag>].{a|lib}
00282     */
00283 
00284 #  define B64_IMPL_LINK_LIBRARY_NAME            B64_IMPL_LINK_PREFIX \
00285                                                 B64_IMPL_LINK_LIBRARY_BASENAME \
00286                                                 B64_IMPL_LINK_MAJOR_VERSION \
00287                                                 B64_IMPL_LINK_MODULE_NAME \
00288                                                 "." B64_IMPL_LINK_COMPILER_NAME \
00289                                                 B64_IMPL_LINK_OS_TAG \
00290                                                 B64_IMPL_LINK_ARCH_TAG \
00291                                                 B64_IMPL_LINK_ENCODING_TAG \
00292                                                 B64_IMPL_LINK_THREADING_TAG \
00293                                                 B64_IMPL_LINK_NOX_TYPE \
00294                                                 B64_IMPL_LINK_DEBUG_TAG \
00295                                                 B64_IMPL_LINK_SUFFIX
00296                                                         
00297 
00298 #  pragma message("lib: " B64_IMPL_LINK_LIBRARY_NAME)
00299 
00300 #  pragma comment(lib, B64_IMPL_LINK_LIBRARY_NAME)
00301 
00302 # endif /* B64_IMPLICIT_LINK_SUPPORT */
00303 
00304 #endif /* Win-32 || Win-64 */
00305 
00306 /* ////////////////////////////////////////////////////////////////////// */
00307 
00308 #endif /* B64_INCL_B64_H_IMPLICIT_LINK */
00309 
00310 /* ///////////////////////////// end of file //////////////////////////// */

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