Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/OrxonoxConfig.h.in @ 9190

Last change on this file since 9190 was 8858, checked in by landauf, 13 years ago

merged output branch back to trunk.

Changes:

  • you have to include util/Output.h instead of util/Debug.h
  • COUT(x) is now called orxout(level)
  • output levels are now defined by an enum instead of numbers. see util/Output.h for the definition
  • it's possible to use output contexts with orxout(level, context). see util/Output.h for some common contexts. you can define more contexts
  • you must use 'endl' at the end of an output message, '\n' does not flush the message

Output levels:

  • instead of COUT(0) use orxout()
  • instead of COUT(1) use orxout(user_error) or orxout(internal_error)
  • instead of COUT(2) use orxout(user_warning) or orxout(internal_warning)
  • instead of COUT(3) use orxout(user_status/user_info) or orxout(internal_status/internal_info)
  • instead of COUT(4) use orxout(verbose)
  • instead of COUT(5) use orxout(verbose_more)
  • instead of COUT(6) use orxout(verbose_ultra)

Guidelines:

  • user_* levels are for the user, visible in the console and the log-file
  • internal_* levels are for developers, visible in the log-file
  • verbose_* levels are for debugging, only visible if the context of the output is activated

Usage in C++:

  • orxout() << "message" << endl;
  • orxout(level) << "message" << endl;
  • orxout(level, context) << "message" << endl;

Usage in Lua:

  • orxout("message")
  • orxout(orxonox.level.levelname, "message")
  • orxout(orxonox.level.levelname, "context", "message")

Usage in Tcl (and in the in-game-console):

  • orxout levelname message
  • orxout_context levelname context message
  • shortcuts: log message, error message, warning message, status message, info message, debug message
  • Property svn:eol-style set to native
File size: 7.1 KB
RevLine 
[682]1/*
2 *   ORXONOX - the hottest 3D action shooter ever to exist
[1505]3 *                    > www.orxonox.net <
[682]4 *
5 *
6 *   License notice:
7 *
8 *   This program is free software; you can redistribute it and/or
9 *   modify it under the terms of the GNU General Public License
10 *   as published by the Free Software Foundation; either version 2
11 *   of the License, or (at your option) any later version.
12 *
13 *   This program is distributed in the hope that it will be useful,
14 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
15 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16 *   GNU General Public License for more details.
17 *
18 *   You should have received a copy of the GNU General Public License
19 *   along with this program; if not, write to the Free Software
20 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
21 *
22 *   Author:
[2639]23 *      Reto Grieder
24 *   Co-authors:
[1293]25 *      ...
[682]26 *
[1755]27 *   Original code: OgrePlatform.h, licensed under the LGPL. The code
[2639]28 *   has changed almost completely though.
[1755]29 *
[2643]30 *   Caution: Do not configure this file CMake configuration (Debug, Release, etc.)
31 *            dependent! XCode and Visual Studio have the same file for all.
32 *
[682]33 */
[1505]34
[682]35/**
[3196]36@file
37@brief
[1755]38    Various constants for compiler, architecture and platform.
[3196]39@remarks
[2639]40    @GENERATED_FILE_COMMENT@
[3196]41*/
[1505]42
[2639]43#ifndef _OrxonoxConfig_H__
44#define _OrxonoxConfig_H__
[1505]45
[2639]46/*---------------------------------
47 * Platform and compiler related options
48 *-------------------------------*/
49#cmakedefine ORXONOX_PLATFORM_WINDOWS
50#cmakedefine ORXONOX_PLATFORM_LINUX
51#cmakedefine ORXONOX_PLATFORM_APPLE
52#cmakedefine ORXONOX_PLATFORM_UNIX /* Apple and Linux */
[1755]53
[3196]54// Determine compiler and set ORXONOX_COMP_VER
[1505]55#if defined( _MSC_VER )
[2639]56#  define ORXONOX_COMPILER_MSVC
[1505]57#  define ORXONOX_COMP_VER _MSC_VER
58
59#elif defined( __GNUC__ )
[2639]60#  define ORXONOX_COMPILER_GCC
[1505]61#  define ORXONOX_COMP_VER (((__GNUC__)*100) + \
62        (__GNUC_MINOR__*10) + \
63        __GNUC_PATCHLEVEL__)
[2639]64#  if defined(__MINGW32__)
65#    define ORXONOX_COMPILER_MINGW
66#  endif
[1505]67
68#elif defined( __BORLANDC__ )
[2639]69#  define ORXONOX_COMPILER_BORLAND
[1505]70#  define ORXONOX_COMP_VER __BCPLUSPLUS__
71
72#else
[2639]73#  pragma error "No known compiler. Abort!"
[1505]74
75#endif
76
[3196]77// Endianness
[2639]78#cmakedefine ORXONOX_BIG_ENDIAN
79#cmakedefine ORXONOX_LITTLE_ENDIAN
[1755]80
[3196]81// Architecture
[8351]82#if defined(__x86_64__) || defined(_M_X64) || defined(__powerpc64__) || defined(__alpha__) || defined(__ia64__) || defined(__s390__) || defined(__s390x__)
83#   define ORXONOX_ARCH_64
84#else
85#   define ORXONOX_ARCH_32
86#endif
[2639]87
[3196]88// See if we can use __forceinline or if we need to use __inline instead
[2639]89#cmakedefine HAVE_FORCEINLINE
[8351]90#ifndef ORX_FORCEINLINE
[2797]91#  ifdef HAVE_FORCEINLINE
[8351]92#    define ORX_FORCEINLINE __forceinline
[2797]93#  else
[8351]94#    define ORX_FORCEINLINE __inline
[2797]95#  endif
[1505]96#endif
97
[3196]98// Try to define function information
[1755]99#ifndef __FUNCTIONNAME__
[2639]100#  ifdef ORXONOX_COMPILER_BORLAND
[1755]101#    define __FUNCTIONNAME__ __FUNC__
[2639]102#  elif defined(ORXONOX_COMPILER_GCC)
[1755]103#    define __FUNCTIONNAME__ __PRETTY_FUNCTION__
[2639]104#  elif defined(ORXONOX_COMPILER_MSVC)
[1755]105#    define __FUNCTIONNAME__ __FUNCTION__
[1505]106#  else
[1755]107#    define __FUNCTIONNAME__
[1505]108#  endif
[1755]109#endif
[1505]110
[8858]111// Declare a function deprecated
112#ifndef __DEPRECATED__
113#  if defined(ORXONOX_COMPILER_GCC)
114#    define __DEPRECATED__(function) function __attribute__ ((deprecated))
115#  elif defined(ORXONOX_COMPILER_MSVC)
116#    define __DEPRECATED__(function) __declspec(deprecated) function
117#  else
118#    define __DEPRECATED__(function) function
119#  endif
120#endif
121
[8418]122#ifndef __UNIQUE_NUMBER__
123#  if defined(ORXONOX_COMPILER_GCC) && ORXONOX_COMP_VER >= 430
124#    define __UNIQUE_NUMBER__ __COUNTER__
125#  elif defined(ORXONOX_COMPILER_MSVC)
126#    define __UNIQUE_NUMBER__ __COUNTER__
127#  else
128#    define __UNIQUE_NUMBER__ __LINE__
129#  endif
130#endif
[1755]131
[2639]132/*---------------------------------
133 * Version information
134 *-------------------------------*/
135#define ORXONOX_VERSION_MAJOR @ORXONOX_VERSION_MAJOR@
136#define ORXONOX_VERSION_MINOR @ORXONOX_VERSION_MINOR@
137#define ORXONOX_VERSION_PATCH @ORXONOX_VERSION_PATCH@
138#define ORXONOX_VERSION_NAME "@ORXONOX_VERSION_NAME@"
[1755]139
[3196]140//! Defines version info encoded as 0xMMIIPP (M: Major version, I: Minor version, P: Patch version, all as hex)
141#define ORXONOX_VERSION \
142    ((ORXONOX_VERSION_MAJOR << 16) | (ORXONOX_VERSION_MINOR << 8) | ORXONOX_VERSION_PATCH)
[1921]143
144
[1755]145/*---------------------------------
[2639]146 * Unix settings
[1755]147 *-------------------------------*/
[2639]148#ifdef ORXONOX_PLATFORM_UNIX
[1505]149
[3196]150// TODO: Check what this actually is and whether we need it or not
[1755]151#if 0
[2639]152#  ifdef ORXONOX_PLATFORM_APPLE
[1505]153#    define ORXONOX_PLATFORM_LIB "OrxonoxPlatform.bundle"
[3196]154#  else // ORXONOX_PLATFORM_LINUX
[1505]155#    define ORXONOX_PLATFORM_LIB "libOrxonoxPlatform.so"
156#  endif
[1755]157#endif
[1505]158
[2639]159#endif /* Patform Unix */
[1505]160
161
[1755]162/*---------------------------------
163 * Apple Settings
164 *-------------------------------*/
[1505]165
166
[1755]167/*---------------------------------
[3196]168 * Includes and Declarations
[1755]169 *-------------------------------*/
[3196]170// Define the english written operators like and, or, xor
171// This is C++ standard, but the Microsoft compiler doesn't define them.
[2650]172#cmakedefine HAVE_ISO646_H
173#ifdef HAVE_ISO646_H
174#  include <iso646.h>
[2639]175#endif
[1505]176
[8351]177// On OS X some headers already define HAVE_STDINT_H and that spits out
178// some warnings. Therefore we use this macro.
179// Note: This requires some extra code in OrxonoxConfig.cmake
180#cmakedefine ORX_HAVE_STDINT_H
181#ifdef ORX_HAVE_STDINT_H
[2650]182#  include <stdint.h>
[2639]183#elif defined(ORXONOX_COMPILER_MSVC)
184typedef __int8            int8_t;
185typedef __int16           int16_t;
186typedef __int32           int32_t;
187typedef __int64           int64_t;
188typedef unsigned __int8   uint8_t;
189typedef unsigned __int16  uint16_t;
190typedef unsigned __int32  uint32_t;
191typedef unsigned __int64  uint64_t;
192#endif
[1505]193
[2650]194#cmakedefine HAVE_STDDEF_H
[2685]195/* Quite large, do not include unless necessary
[2650]196#ifdef HAVE_STDDEF_H
197#  include <stddef.h>
[2639]198#endif
[2685]199*/
[1505]200
[8368]201// Configurations Release, RelWithDebInfo and MinSizeRel are designed for
202// redistribution while RelForDevs is for development purposes
[8363]203// ORXONOX_RELEASE simplifies this a little bit
[8368]204#if defined(CMAKE_Release_BUILD) || defined(CMAKE_MinSizeRel_BUILD) \
205    || defined(CMAKE_RelWithDebInfo_BUILD)
[8363]206#  define ORXONOX_RELEASE
207#endif
208
[3196]209// Forward declare the everywhere used std::string
210namespace std
211{
212    template<class _Elem> struct char_traits;
213    template<class _Ty>   class  allocator;
214    template<class _Elem, class _Traits, class _Ax> class basic_string;
215    typedef basic_string<char, char_traits<char>, allocator<char> > string;
216}
217
[5695]218// Import general purpose smart pointers
219namespace boost
220{
221    template<class T> class scoped_ptr;
222    template<class T> class shared_ptr;
223    template<class T> class weak_ptr;
224    template<class T> class intrusive_ptr;
225    template<class T> class shared_array;
226    template<class T> class scoped_array;
227}
228namespace orxonox
229{
230    using boost::scoped_ptr;
231    using boost::shared_ptr;
232    using boost::weak_ptr;
233    using boost::intrusive_ptr;
234    using boost::shared_array;
235    using boost::scoped_array;
236}
237
[8351]238// Define Boost Filesystem version
239#include <boost/version.hpp>
240#ifndef BOOST_FILESYSTEM_VERSION
241#  if (BOOST_VERSION < 104600)
242#    define BOOST_FILESYSTEM_VERSION 2
243#  else
244#    define BOOST_FILESYSTEM_VERSION 3
245#  endif
246#endif
247
[2639]248#endif /* _OrxonoxConfig_H__ */
Note: See TracBrowser for help on using the repository browser.