Cinder

  • Main Page
  • Related Pages
  • Namespaces
  • Classes
  • Files
  • Examples
  • File List
  • File Members

include/cinder/Cinder.h

Go to the documentation of this file.
00001 /*
00002  Copyright (c) 2010, The Barbarian Group
00003  All rights reserved.
00004 
00005  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
00006  the following conditions are met:
00007 
00008     * Redistributions of source code must retain the above copyright notice, this list of conditions and
00009     the following disclaimer.
00010     * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
00011     the following disclaimer in the documentation and/or other materials provided with the distribution.
00012 
00013  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
00014  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
00015  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
00016  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
00017  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
00018  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
00019  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
00020  POSSIBILITY OF SUCH DAMAGE.
00021 */
00022 
00023 #pragma once
00024 
00025 #include <boost/cstdint.hpp>
00026 #include <boost/version.hpp>
00027 
00028 #if BOOST_VERSION < 104800
00029     #error "Cinder requires Boost version 1.48 or later"
00030 #endif
00031 
00032 namespace cinder {
00033 using boost::int8_t;
00034 using boost::uint8_t;
00035 using boost::int16_t;
00036 using boost::uint16_t;
00037 using boost::int32_t;
00038 using boost::uint32_t;
00039 using boost::int64_t;
00040 using boost::uint64_t;
00041 
00042 #define CINDER_CINDER
00043 
00044 #if defined(_WIN32) || defined(__WIN32__) || defined(WIN32)
00045     #define CINDER_MSW
00046 #elif defined(linux) || defined(__linux) || defined(__linux__)
00047     #define CINDER_LINUX
00048 #elif defined(macintosh) || defined(__APPLE__) || defined(__APPLE_CC__)
00049     #define CINDER_COCOA
00050     #include "TargetConditionals.h"
00051     #if TARGET_OS_IPHONE
00052         #define CINDER_COCOA_TOUCH
00053     #else
00054         #define CINDER_MAC
00055     #endif
00056     // This is defined to prevent the inclusion of some unfortunate macros in <AssertMacros.h>
00057     #define __ASSERTMACROS__
00058 #else
00059     #error "cinder compile error: Unknown platform"
00060 #endif
00061 
00062 #define CINDER_LITTLE_ENDIAN
00063 
00064 } // namespace cinder
00065 
00066 
00067 #if defined( _MSC_VER ) && ( _MSC_VER >= 1600 )
00068     #include <memory>
00069 #elif defined( CINDER_COCOA )
00070     #include <tr1/memory>
00071     namespace std {
00072         using std::tr1::shared_ptr;
00073         using std::tr1::weak_ptr;       
00074         using std::tr1::static_pointer_cast;
00075         using std::tr1::dynamic_pointer_cast;
00076         using std::tr1::const_pointer_cast;
00077         using std::tr1::enable_shared_from_this;
00078     }
00079 #else
00080     #include <boost/shared_ptr.hpp>
00081     #include <boost/enable_shared_from_this.hpp>
00082     namespace std {
00083         using boost::shared_ptr; // future-proof shared_ptr by putting it into std::
00084         using boost::weak_ptr;
00085         using boost::static_pointer_cast;
00086         using boost::dynamic_pointer_cast;
00087         using boost::const_pointer_cast;
00088         using boost::enable_shared_from_this;       
00089     }
00090 #endif
00091 
00092 #include <boost/shared_ptr.hpp> // necessary for checked_array_deleter
00093 using boost::checked_array_deleter;
00094 
00095 // if compiler supports r-value references, #define CINDER_RVALUE_REFERENCES
00096 #if defined( _MSC_VER ) && ( _MSC_VER >= 1600 )
00097     #define CINDER_RVALUE_REFERENCES
00098 #elif defined( __clang__ )
00099     #if __has_feature(cxx_rvalue_references)
00100         #define CINDER_RVALUE_REFERENCES
00101     #endif
00102 #endif
00103 
00104 // Create a namepace alias as shorthand for cinder::
00105 #if ! defined( CINDER_NO_NS_ALIAS )
00106     namespace ci = cinder;
00107 #endif // ! defined( CINDER_NO_NS_ALIAS )