Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F98234467
macros.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Sat, Jan 11, 07:53
Size
4 KB
Mime Type
text/x-c
Expires
Mon, Jan 13, 07:53 (2 d)
Engine
blob
Format
Raw Data
Handle
23537292
Attached To
rSPECMICP SpecMiCP / ReactMiCP
macros.hpp
View Options
/*-------------------------------------------------------------------------------
Copyright (c) 2015 F. Georget <fabieng@princeton.edu>, Princeton University
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation and/or
other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software without
specific prior written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-----------------------------------------------------------------------------*/
#ifndef SPECMCICP_MACROS_HPP
#define SPECMCICP_MACROS_HPP
#include <cassert>
//! \file macros.hpp
//! \brief Macros and config
// a lot of the eigen stuff may raise an error if in Debug mode
#ifdef NDEBUG
constexpr
bool
ndebug
{
false
};
#else
constexpr
bool
ndebug
{
true
};
#endif
#define NOEXCEPT noexcept(ndebug)
//! \def specmicp_assert
//! \brief Assertion macro used in SpecMiCP
//!
//! This is the assertion macro used in SpecMiCP.
//! It can be selectively disabled by declaring SPECMICP_NO_DEBUG.
#ifdef SPECMICP_NO_DEBUG
#define specmicp_assert
#else
#define specmicp_assert(x) assert(x)
#endif
// SPECMICP_NO_DEBUG
// deprecation
// -----------
//! \def SPECMICP_DEPRECATED
//! \brief Declare a symbol to be deprecated
//!
//! This symbol will be removed shortly. Do not use it.
#if defined(__GNUC__) && (__GNUC__ > 4 || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 5)))
#define SPECMICP_DEPRECATED(message) __attribute__((deprecated(message)))
#elif defined(__clang__) && defined(__has_feature)
#if __has_feature(attribute_deprecated_with_message)
#define SPECMICP_DEPRECATED(message) __attribute__ ((deprecated(message)))
#endif
#else
#define SPECMICP_DEPRECATED
#endif
// visibility
// ----------
//! \def SPECMICP_DLL_PUBLIC
//! \brief Declare a symbol to be exported in a shared library
//!
//! Only symbols defined with this macro will be exported in the shared library.
//! The others symbols are hidden.
//!
//! \sa SPECMICP_DLL_LOCAL
//! \def SPECMICP_DLL_LOCAL
//! \brief Declare a symbol to be hidden in a shared library
//!
//! This symbols are not available to the user. They are not part of the API.
//!
//! \sa SPECMICP_DLL_PUBLIC
#if defined(_WIN32) || defined(__CYGWIN__)
#ifdef _EXPORTING
#ifdef __GNUC__
#define SPECMICP_DLL_PUBLIC __attribute__((dllexport))
#else
#define SPECMICP_DLL_PUBLIC __declspec(dllexport)
#endif
#else
#ifdef __GNUC__
#define SPECMICP_DLL_PUBLIC __attribute__((dllimport))
#else
#define SPECMICP_DLL_PUBLIC __declspec(dllimport)
#endif
#endif
#else
#if __GNUC__ >= 4
#define SPECMICP_DLL_PUBLIC __attribute__ ((visibility("default")))
#define SPECMICP_DLL_LOCAL __attribute__ ((visibility("hidden")))
#else
#define SPECMICP_DLL_PUBLIC
#define SPECMICP_DLL_LOCAL
#endif
#endif
// Pure function
// ---------------
//! \def SPECMICP_PURE_F
//! \brief Define a function to have no side effect (but can read global memory)
#ifdef __GNUC__
#define SPECMICP_PURE_F __attribute__ ((pure))
#else
#define SPECMICP_PURE_F
#endif
//! \def SPECMICP_CONST_F
//! \brief Define a function to have no side effect (but can read global memory)
#ifdef __GNUC__
#define SPECMICP_CONST_F __attribute__ ((const))
#else
#define SPECMICP_CONST_F
#endif
#endif
// SPECMCICP_MACROS_HPP
Event Timeline
Log In to Comment