Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions include/proxsuite/config.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
/*
* This file has been automatically generated by the jrl-cmakemodules.
* Please see https://github.com/jrl-umi3218/jrl-cmakemodules/blob/master/config.hh.cmake for details.
*/

#ifndef PROXSUITE_CONFIG_HH
# define PROXSUITE_CONFIG_HH

// Package version (header).
# define PROXSUITE_VERSION_UNKNOWN_TAG 0 // Used to mention that the current version is unknown.
# define PROXSUITE_VERSION "0.7.2"
# define PROXSUITE_MAJOR_VERSION 0
# define PROXSUITE_MINOR_VERSION 7
# define PROXSUITE_PATCH_VERSION 2

#define PROXSUITE_VERSION_AT_LEAST(major, minor, patch) (PROXSUITE_MAJOR_VERSION>major || (PROXSUITE_MAJOR_VERSION>=major && \
(PROXSUITE_MINOR_VERSION>minor || (PROXSUITE_MINOR_VERSION>=minor && \
PROXSUITE_PATCH_VERSION>=patch))))

#define PROXSUITE_VERSION_AT_MOST(major, minor, patch) (PROXSUITE_MAJOR_VERSION<major || (PROXSUITE_MAJOR_VERSION<=major && \
(PROXSUITE_MINOR_VERSION<minor || (PROXSUITE_MINOR_VERSION<=minor && \
PROXSUITE_PATCH_VERSION<=patch))))

// Handle portable symbol export.
// Defining manually which symbol should be exported is required
// under Windows whether MinGW or MSVC is used.
//
// The headers then have to be able to work in two different modes:
// - dllexport when one is building the library,
// - dllimport for clients using the library.
//
// On Linux, set the visibility accordingly. If C++ symbol visibility
// is handled by the compiler, see: http://gcc.gnu.org/wiki/Visibility
//
// Explicit template instantiation on Windows need to add
// dllexport on the definition and dllimport on the declaration.
// The XXX_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI macro
// should be set on the declaration while
// the XXX_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI macro
// should be set on the definition.
# if defined _WIN32 || defined __CYGWIN__
// On Microsoft Windows, use dllimport and dllexport to tag symbols.
# define PROXSUITE_DLLIMPORT __declspec(dllimport)
# define PROXSUITE_DLLEXPORT __declspec(dllexport)
# define PROXSUITE_DLLLOCAL
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT __declspec(dllimport)
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT __declspec(dllimport)
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT __declspec(dllexport)
# else
// On Linux, for GCC >= 4, tag symbols using GCC extension.
# if __GNUC__ >= 4
# define PROXSUITE_DLLIMPORT __attribute__ ((visibility("default")))
# define PROXSUITE_DLLEXPORT __attribute__ ((visibility("default")))
# define PROXSUITE_DLLLOCAL __attribute__ ((visibility("hidden")))
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT __attribute__ ((visibility("default")))
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT __attribute__ ((visibility("default")))
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT
# else
// Otherwise (GCC < 4 or another compiler is used), export everything.
# define PROXSUITE_DLLIMPORT
# define PROXSUITE_DLLEXPORT
# define PROXSUITE_DLLLOCAL
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT
# endif // __GNUC__ >= 4
# endif // defined _WIN32 || defined __CYGWIN__

# ifdef PROXSUITE_STATIC
// If one is using the library statically, get rid of
// extra information and use standard explicit template
// instantiation keyword.
# define PROXSUITE_DLLAPI
# define PROXSUITE_LOCAL
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION extern template
# else
// Depending on whether one is building or using the
// library define DLLAPI to import or export and
// define the right explicit template instantiation keyword.
# ifdef proxsuite_EXPORTS
# define PROXSUITE_DLLAPI PROXSUITE_DLLEXPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLEXPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLEXPORT
# else
# define PROXSUITE_DLLAPI PROXSUITE_DLLIMPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLAPI PROXSUITE_EXPLICIT_INSTANTIATION_DECLARATION_DLLIMPORT
# define PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLAPI PROXSUITE_EXPLICIT_INSTANTIATION_DEFINITION_DLLIMPORT
# endif // PROXSUITE_EXPORTS
# define PROXSUITE_LOCAL PROXSUITE_DLLLOCAL
# endif // PROXSUITE_STATIC
#endif //! PROXSUITE_CONFIG_HH
4 changes: 4 additions & 0 deletions include/proxsuite/linalg/veg/internal/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
#define PROXSUITE_PRETTY_FUNCTION __PRETTY_FUNCTION__
#endif

#ifndef PROXSUITE_THROW_PRETTY
#define PROXSUITE_THROW_PRETTY(condition, exception, message) \
if (condition) { \
std::ostringstream ss; \
Expand All @@ -24,7 +25,9 @@
ss << message << "\n"; \
throw exception(ss.str()); \
}
#endif

#ifndef PROXSUITE_CHECK_ARGUMENT_SIZE
#define PROXSUITE_CHECK_ARGUMENT_SIZE(size, expected_size, message) \
if (size != expected_size) { \
std::ostringstream oss; \
Expand All @@ -33,6 +36,7 @@
oss << "hint: " << message << std::endl; \
PROXSUITE_THROW_PRETTY(true, std::invalid_argument, oss.str()); \
}
#endif

#if HEDLEY_MSVC_VERSION_CHECK(14, 0, 0) || \
HEDLEY_INTEL_CL_VERSION_CHECK(2021, 1, 0)
Expand Down