- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages
- Examples

# fastformat/implicit_link.h

Go to the documentation of this file.

    00001 /* /////////////////////////////////////////////////////////////////////////
    00002  * File:        fastformat/implicit_link.h (formerly fastformat/fastformat_implicit_link.h)
    00003  *
    00004  * Purpose:     Implicit linking for the FastFormat API
    00005  *
    00006  * Created:     30th January 2007
    00007  * Updated:     9th March 2010
    00008  *
    00009  * Home:        http://fastformat.org/
    00010  *
    00011  * Copyright (c) 2007-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
    00045 #ifndef FASTFORMAT_INCL_FASTFORMAT_H_IMPLICIT_LINK
    00046 #define FASTFORMAT_INCL_FASTFORMAT_H_IMPLICIT_LINK
    00047
    00048 /* /////////////////////////////////////////////////////////////////////////
    00049  * Version information
    00050  */
    00051
    00052 #ifndef FASTFORMAT_DOCUMENTATION_SKIP_SECTION
    00053 # define FASTFORMAT_VER_FASTFORMAT_H_IMPLICIT_LINK_MAJOR    1
    00054 # define FASTFORMAT_VER_FASTFORMAT_H_IMPLICIT_LINK_MINOR    5
    00055 # define FASTFORMAT_VER_FASTFORMAT_H_IMPLICIT_LINK_REVISION 1
    00056 # define FASTFORMAT_VER_FASTFORMAT_H_IMPLICIT_LINK_EDIT     19
    00057 #endif /* !FASTFORMAT_DOCUMENTATION_SKIP_SECTION */
    00058
    00059 /* /////////////////////////////////////////////////////////////////////////
    00060  * Includes
    00061  */
    00062
    00063 #ifndef FASTFORMAT_INCL_FASTFORMAT_H_FASTFORMAT
    00064 # include <fastformat/fastformat.h>
    00065 #endif /* !FASTFORMAT_INCL_FASTFORMAT_H_FASTFORMAT */
    00066
    00067 #include <platformstl/platformstl.h>
    00068
    00069 /* /////////////////////////////////////////////////////////////////////////
    00070  * Implicit linking
    00071  */
    00072
    00073 #if defined(_WIN32) || \
    00074     defined(_WIN64)
    00075
    00076 # if defined(__BORLANDC__) || \
    00077      /* defined(__DMC__) || */ \
    00078      defined(__INTEL_COMPILER) || \
    00079      defined(__MWERKS__) || \
    00080      defined(_MSC_VER)
    00081 #  if !defined(__COMO__)
    00082 #   define FASTFORMAT_IMPLICIT_LINK_SUPPORT
    00083 #  endif /* compiler */
    00084 # endif /* compiler */
    00085
    00086 # if defined(FASTFORMAT_IMPLICIT_LINK_SUPPORT) && \
    00087      defined(FASTFORMAT_NO_IMPLICIT_LINK)
    00088 #  undef FASTFORMAT_IMPLICIT_LINK_SUPPORT
    00089 # endif /* FASTFORMAT_IMPLICIT_LINK_SUPPORT && FASTFORMAT_NO_IMPLICIT_LINK */
    00090
    00091 # if defined(FASTFORMAT_IMPLICIT_LINK_SUPPORT)
    00092
    00093   /* prefix */
    00094
    00095 #  define FASTFORMAT_IMPL_LINK_PREFIX
    00096
    00097   /* library basename */
    00098
    00099 #  define FASTFORMAT_IMPL_LINK_LIBRARY_BASENAME         "fastformat"
    00100
    00101   /* major version */
    00102
    00103 #  define FASTFORMAT_IMPL_LINK_MAJOR_VERSION            "." STLSOFT_STRINGIZE(FASTFORMAT_VER_MAJOR)
    00104
    00105   /* module name */
    00106
    00107 #  define FASTFORMAT_IMPL_LINK_MODULE_NAME              ".core"
    00108
    00109   /* compiler tag */
    00110
    00111 #  if defined(__BORLANDC__)
    00112 #   if __BORLANDC__ == 0x0550
    00113 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc55"
    00114 #   elif (__BORLANDC__ == 0x0551)
    00115 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc551"
    00116 #   elif (__BORLANDC__ == 0x0560)
    00117 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc56"
    00118 #   elif (__BORLANDC__ == 0x0564)
    00119 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc564"
    00120 #   elif (__BORLANDC__ == 0x0582)
    00121 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc582"
    00122 #   elif (0x0590 == (__BORLANDC__ & 0xfff0))
    00123 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc59x"
    00124 #   elif (0x0610 == (__BORLANDC__ & 0xfff0))
    00125 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "bc61x"
    00126 #   else /* ? __BORLANDC__ */
    00127 #    error Unrecognised value of __BORLANDC__
    00128 #   endif /* __BORLANDC__ */
    00129
    00130 /*
    00131 #  elif defined(__DMC__)
    00132 #   define FASTFORMAT_IMPL_LINK_COMPILER_NAME           "dm"
    00133  */
    00134
    00135 #  elif defined(__INTEL_COMPILER)
    00136 #   if __INTEL_COMPILER == 600
    00137 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl6"
    00138 #   elif __INTEL_COMPILER == 700
    00139 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl7"
    00140 #   elif __INTEL_COMPILER == 800
    00141 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl8"
    00142 #   elif __INTEL_COMPILER == 900
    00143 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl9"
    00144 #   elif __INTEL_COMPILER == 1000
    00145 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl10"
    00146 #   elif __INTEL_COMPILER == 1100
    00147 #    define   FASTFORMAT_IMPL_LINK_COMPILER_NAME        "icl11"
    00148 #   else /* ? __INTEL_COMPILER */
    00149 #    error Intel C/C++ version not supported
    00150 #   endif /* __INTEL_COMPILER */
    00151
    00152 #  elif defined(__MWERKS__)
    00153 #   if ((__MWERKS__ & 0xFF00) == 0x2400)
    00154 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "cw7"
    00155 #   elif ((__MWERKS__ & 0xFF00) == 0x3000)
    00156 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "cw8"
    00157 #   elif ((__MWERKS__ & 0xFF00) == 0x3200)
    00158 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "cw9"
    00159 #   else /* ? __MWERKS__ */
    00160 #    error CodeWarrior version not supported
    00161 #   endif /* __MWERKS__ */
    00162
    00163 #  elif defined(_MSC_VER)
    00164 #   if _MSC_VER == 1000
    00165 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc4"
    00166 #   elif _MSC_VER == 1020
    00167 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc42"
    00168 #   elif _MSC_VER == 1100
    00169 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc5"
    00170 #   elif _MSC_VER == 1200
    00171 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc6"
    00172 #   elif _MSC_VER == 1300
    00173 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc7"
    00174 #   elif _MSC_VER == 1310
    00175 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc71"
    00176 #   elif _MSC_VER == 1400
    00177 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc8"
    00178 #   elif _MSC_VER == 1500
    00179 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc9"
    00180 #   elif _MSC_VER == 1600
    00181 #    define FASTFORMAT_IMPL_LINK_COMPILER_NAME          "vc10"
    00182 #   else /* ? _MSC_VER */
    00183 #    error Visual C++ version not supported
    00184 #   endif /* _MSC_VER */
    00185
    00186 #  else /* ? compiler */
    00187 #   error Unrecognised compiler
    00188 #  endif /* compiler */
    00189
    00190
    00191   /* operating system tag */
    00192
    00193 #  if defined(_STLSOFT_FORCE_ANY_COMPILER) && \
    00194       defined(PLATFORMSTL_OS_IS_UNIX) && \
    00195       defined(_WIN32)
    00196 #   define FASTFORMAT_IMPL_LINK_OS_TAG                  ".unix"
    00197 #  endif /* pseudo UNIX */
    00198
    00199 #  if !defined(FASTFORMAT_IMPL_LINK_OS_TAG)
    00200 #   define FASTFORMAT_IMPL_LINK_OS_TAG                  ""
    00201 #  endif /* !FASTFORMAT_IMPL_LINK_OS_TAG */
    00202
    00203
    00204   /* architecture tag */
    00205
    00206 #  if defined(PLATFORMSTL_ARCH_IS_X86)
    00207 #   define FASTFORMAT_IMPL_LINK_ARCH_TAG                ""
    00208 #  elif defined(PLATFORMSTL_ARCH_IS_X64)
    00209 #   define FASTFORMAT_IMPL_LINK_ARCH_TAG                ".x64"
    00210 #  elif defined(PLATFORMSTL_ARCH_IS_IA64)
    00211 #   define FASTFORMAT_IMPL_LINK_ARCH_TAG                ".ia64"
    00212 #  endif /* arch */
    00213
    00214 #  if !defined(FASTFORMAT_IMPL_LINK_ARCH_TAG)
    00215 #   define FASTFORMAT_IMPL_LINK_ARCH_TAG                ""
    00216 #  endif /* !FASTFORMAT_IMPL_LINK_ARCH_TAG */
    00217
    00218
    00219   /* encoding tag */
    00220
    00221 #  if defined(FASTFORMAT_USE_WIDE_STRINGS)
    00222 #   define FASTFORMAT_IMPL_LINK_ENCODING_TAG            ".widestring"
    00223 #  else /* ? FASTFORMAT_USE_WIDE_STRINGS */
    00224 #   define FASTFORMAT_IMPL_LINK_ENCODING_TAG            ""
    00225 #  endif /* FASTFORMAT_USE_WIDE_STRINGS */
    00226
    00227
    00228   /* threading tag */
    00229
    00230 #  if defined(__MT__) || \
    00231       defined(_REENTRANT) || \
    00232       defined(_MT)
    00233 #   if defined(_DLL) || \
    00234        defined(__DLL)
    00235 #    define FASTFORMAT_IMPL_LINK_THREADING_TAG          ".dll"
    00236 #   else /* ? dll */
    00237 #    define FASTFORMAT_IMPL_LINK_THREADING_TAG          ".mt"
    00238 #   endif /* dll */
    00239 #  else /* ? mt */
    00240 #    define FASTFORMAT_IMPL_LINK_THREADING_TAG          ""
    00241 #  endif /* mt */
    00242
    00243
    00244   /* NoX */
    00245
    00246 #  if defined(FASTFORMAT_CF_NOX)
    00247 #   define FASTFORMAT_IMPL_LINK_NOX_TYPE                ".nox"
    00248 #  else /* ? FASTFORMAT_CF_NOX */
    00249 #   define FASTFORMAT_IMPL_LINK_NOX_TYPE                ""
    00250 #  endif /* FASTFORMAT_CF_NOX */
    00251
    00252
    00253   /* debug tag */
    00254
    00255 #  if !defined(NDEBUG) && \
    00256       defined(_DEBUG)
    00257 #   define FASTFORMAT_IMPL_LINK_DEBUG_TAG               ".debug"
    00258 #  else /* ? debug */
    00259 #   define FASTFORMAT_IMPL_LINK_DEBUG_TAG               ""
    00260 #  endif /* debug */
    00261
    00262
    00263   /* suffix */
    00264
    00265 #  define FASTFORMAT_IMPL_LINK_SUFFIX                   ".lib"
    00266
    00267
    00268    /* Library name is:
    00269     *
    00270     * [lib]<library-basename>.<major-version>.<module-name>.<compiler-name>[.<os-arch-tag>][.<char-encoding-tag>][.<threading-tag>][.<nox-tag>][.<debug-tag>].{a|lib}
    00271     */
    00272
    00273 #  define FASTFORMAT_IMPL_LINK_LIBRARY_NAME             FASTFORMAT_IMPL_LINK_PREFIX \
    00274                                                         FASTFORMAT_IMPL_LINK_LIBRARY_BASENAME \
    00275                                                         FASTFORMAT_IMPL_LINK_MAJOR_VERSION \
    00276                                                         FASTFORMAT_IMPL_LINK_MODULE_NAME \
    00277                                                         "." FASTFORMAT_IMPL_LINK_COMPILER_NAME \
    00278                                                         FASTFORMAT_IMPL_LINK_OS_TAG \
    00279                                                         FASTFORMAT_IMPL_LINK_ARCH_TAG \
    00280                                                         FASTFORMAT_IMPL_LINK_ENCODING_TAG \
    00281                                                         FASTFORMAT_IMPL_LINK_THREADING_TAG \
    00282                                                         FASTFORMAT_IMPL_LINK_NOX_TYPE \
    00283                                                         FASTFORMAT_IMPL_LINK_DEBUG_TAG \
    00284                                                         FASTFORMAT_IMPL_LINK_SUFFIX
    00285
    00286
    00287 #  pragma message("lib: " FASTFORMAT_IMPL_LINK_LIBRARY_NAME)
    00288
    00289 #  pragma comment(lib, FASTFORMAT_IMPL_LINK_LIBRARY_NAME)
    00290
    00291 # endif /* FASTFORMAT_IMPLICIT_LINK_SUPPORT */
    00292
    00293 #endif /* Win-32 || Win-64 */
    00294
    00295 /* ////////////////////////////////////////////////////////////////////// */
    00296
    00297 #endif /* !FASTFORMAT_INCL_FASTFORMAT_H_IMPLICIT_LINK */
    00298
    00299 /* ///////////////////////////// end of file //////////////////////////// */

FastFormat Library documentation © Matthew Wilson, 2006-2009 |