Open-RJ C/C++ User's Journal Synesis Software STLSoft - ... Robust, Lightweight, Cross-platform, Template Software ...

openrj/implicit_link.h

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

Open-RJ Library documentation © Synesis Software Pty Ltd, 2004-2005