Setup visibility handling for librotgen components

See merge request oss/rotgen!13
This commit is contained in:
Joel Falcou 2025-08-15 11:19:28 +02:00
parent cae9d2cfa6
commit 70b6770389
11 changed files with 71 additions and 27 deletions

View file

@ -0,0 +1,40 @@
//==================================================================================================
/*
ROTGEN - Runtime Overlay for Eigen
Copyright : CODE RECKONS
SPDX-License-Identifier: BSL-1.0
*/
//==================================================================================================
#pragma once
#ifdef ROTGEN_STATIC_DEFINE
# define ROTGEN_EXPORT
# define ROTGEN_NO_EXPORT
#else
# ifndef ROTGEN_EXPORT
# ifdef rotgen_EXPORTS
/* We are building this library */
# define ROTGEN_EXPORT __attribute__((visibility("default")))
# else
/* We are using this library */
# define ROTGEN_EXPORT __attribute__((visibility("default")))
# endif
# endif
# ifndef ROTGEN_NO_EXPORT
# define ROTGEN_NO_EXPORT __attribute__((visibility("hidden")))
# endif
#endif
#ifndef ROTGEN_DEPRECATED
# define ROTGEN_DEPRECATED __attribute__ ((__deprecated__))
#endif
#ifndef ROTGEN_DEPRECATED_EXPORT
# define ROTGEN_DEPRECATED_EXPORT ROTGEN_EXPORT ROTGEN_DEPRECATED
#endif
#ifndef ROTGEN_DEPRECATED_NO_EXPORT
# define ROTGEN_DEPRECATED_NO_EXPORT ROTGEN_NO_EXPORT ROTGEN_DEPRECATED
#endif

View file

@ -9,6 +9,7 @@
#include <cstddef>
#include <iostream>
#include <rotgen/common/export.hpp>
namespace rotgen
{
@ -44,7 +45,7 @@ namespace rotgen
namespace detail
{
std::ostream& dynamic_info(std::ostream& os);
ROTGEN_EXPORT std::ostream& dynamic_info(std::ostream& os);
}
}

View file

@ -11,7 +11,7 @@
This file is a X-File to generate various block_impl_* declarations variant
*/
//==================================================================================================
class CLASSNAME
class ROTGEN_EXPORT CLASSNAME
{
public:
CLASSNAME(SOURCENAME& r, std::size_t i0, std::size_t j0, std::size_t ni, std::size_t nj);
@ -72,9 +72,9 @@ class CLASSNAME
SOURCENAME mul(TYPE s) const;
SOURCENAME div(TYPE s) const;
friend std::ostream& operator<<(std::ostream&,CLASSNAME const&);
friend bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT std::ostream& operator<<(std::ostream&,CLASSNAME const&);
friend ROTGEN_EXPORT bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
const TYPE* data() const;
TYPE* data();

View file

@ -11,7 +11,7 @@
This file is a X-File to generate various map_impl_* declarations variant
*/
//==================================================================================================
class CLASSNAME
class ROTGEN_EXPORT CLASSNAME
{
public:
CLASSNAME(TYPE CONST* ptr, Index r, Index c);
@ -82,7 +82,7 @@ class CLASSNAME
SOURCENAME mul(TYPE s) const;
SOURCENAME div(TYPE s) const;
friend std::ostream& operator<<(std::ostream&,CLASSNAME const&);
friend ROTGEN_EXPORT std::ostream& operator<<(std::ostream&,CLASSNAME const&);
const TYPE* data() const;
#if !defined(USE_CONST)
@ -93,8 +93,8 @@ class CLASSNAME
void setConstant(TYPE);
#endif
friend bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
private:
struct payload;

View file

@ -8,7 +8,7 @@
#pragma once
#define ROTGEN_DEF_RELOP_PAIR(OP, T1, T2) \
bool operator OP (T1 const&, T2 const&); \
ROTGEN_EXPORT bool operator OP (T1 const&, T2 const&); \
inline bool operator OP (T2 const& a, T1 const& b) { return b OP a; } \
/**/
@ -31,8 +31,6 @@ namespace rotgen
{
ROTGEN_DEF_RELOP(==)
ROTGEN_DEF_RELOP(!=)
// ROTGEN_DEF_RELOP(+)
// ROTGEN_DEF_RELOP(-)
}
#undef ROTGEN_DEF_RELOP_PAIR

View file

@ -11,7 +11,7 @@
This file is a X-File to generate various matrix_impl_* declarations variant
*/
//==================================================================================================
class CLASSNAME
class ROTGEN_EXPORT CLASSNAME
{
public:
CLASSNAME(std::size_t rows = 0, std::size_t cols = 0);
@ -67,9 +67,9 @@ class CLASSNAME
CLASSNAME& operator*=(TYPE d);
CLASSNAME& operator/=(TYPE d);
friend std::ostream& operator<<(std::ostream&,CLASSNAME const&);
friend bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT std::ostream& operator<<(std::ostream&,CLASSNAME const&);
friend ROTGEN_EXPORT bool operator==(CLASSNAME const& lhs, CLASSNAME const& rhs);
friend ROTGEN_EXPORT bool operator!=(CLASSNAME const& lhs, CLASSNAME const& rhs);
const TYPE* data() const;
TYPE* data();