Path: blob/master/3rdparty/openexr/Imath/ImathPlatform.h
16337 views
///////////////////////////////////////////////////////////////////////////1//2// Copyright (c) 2002, Industrial Light & Magic, a division of Lucas3// Digital Ltd. LLC4//5// All rights reserved.6//7// Redistribution and use in source and binary forms, with or without8// modification, are permitted provided that the following conditions are9// met:10// * Redistributions of source code must retain the above copyright11// notice, this list of conditions and the following disclaimer.12// * Redistributions in binary form must reproduce the above13// copyright notice, this list of conditions and the following disclaimer14// in the documentation and/or other materials provided with the15// distribution.16// * Neither the name of Industrial Light & Magic nor the names of17// its contributors may be used to endorse or promote products derived18// from this software without specific prior written permission.19//20// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS21// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT22// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR23// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT24// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,25// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT26// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,27// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY28// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT29// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE30// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.31//32///////////////////////////////////////////////////////////////////////////3334#ifndef INCLUDED_IMATHPLATFORM_H35#define INCLUDED_IMATHPLATFORM_H3637//----------------------------------------------------------------------------38//39// ImathPlatform.h40//41// This file contains functions and constants which aren't42// provided by the system libraries, compilers, or includes on43// certain platforms.44//45//----------------------------------------------------------------------------4647#include <math.h>4849#ifndef M_PI50#define M_PI 3.1415926535897932384651#endif5253#ifndef M_PI_254#define M_PI_2 1.57079632679489661923 // pi/255#endif565758//-----------------------------------------------------------------------------59//60// Some, but not all, C++ compilers support the C99 restrict61// keyword or some variant of it, for example, __restrict.62//63//-----------------------------------------------------------------------------6465#if defined __GNUC__6667//68// supports __restrict69//7071#define IMATH_RESTRICT __restrict7273#elif defined (__INTEL_COMPILER) || \74defined(__ICL) || \75defined(__ICC) || \76defined(__ECC)7778//79// supports restrict80//8182#define IMATH_RESTRICT restrict8384#elif defined __sgi8586//87// supports restrict88//8990#define IMATH_RESTRICT restrict9192#elif defined _MSC_VER9394//95// supports __restrict96//9798// #define IMATH_RESTRICT __restrict99#define IMATH_RESTRICT100101#else102103//104// restrict / __restrict not supported105//106107#define IMATH_RESTRICT108109#endif110111#endif // INCLUDED_IMATHPLATFORM_H112113114