Skip to content

Commit

Permalink
Update Fast-CDR thirdparty
Browse files Browse the repository at this point in the history
If this commit is applied then plotjuggler will be able to compile and
run with Fast-CDR version 2.x.x from eProsima.
It can compile from:
- local thirdparty folder included within the repo
- install of fastcdr within the machine (usually /usr/local)

to do so:
- Udpated files, API and namespace names

Done it because I need to use plotJuggler with latest lib from eProsima
and I would like this to be available for everyone.

Issue:
[facontidavide#919]
  • Loading branch information
manuelValch authored and manuelValch committed Feb 6, 2024
1 parent 92f7389 commit 0687ebf
Show file tree
Hide file tree
Showing 22 changed files with 9,800 additions and 8,767 deletions.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -23,39 +23,29 @@
// C++11 support defines
#ifndef HAVE_CXX11
#define HAVE_CXX11 @HAVE_CXX11@
#endif

// C++0x support defines
#ifndef HAVE_CXX0X
#define HAVE_CXX0X @HAVE_CXX0X@
#endif

// C++ constexpr support
#ifndef HAVE_CXX_CONSTEXPR
#define HAVE_CXX_CONSTEXPR @HAVE_CXX_CONSTEXPR@
#endif

#if HAVE_CXX_CONSTEXPR
#define CONSTEXPR constexpr
#else
#define CONSTEXPR const
#endif
#endif // ifndef HAVE_CXX11

// Endianness defines
#ifndef FASTCDR_IS_BIG_ENDIAN_TARGET
#define FASTCDR_IS_BIG_ENDIAN_TARGET @FASTCDR_IS_BIG_ENDIAN_TARGET@
#endif
#endif // ifndef FASTCDR_IS_BIG_ENDIAN_TARGET

#ifndef FASTCDR_HAVE_FLOAT128
#define FASTCDR_HAVE_FLOAT128 @FASTCDR_HAVE_FLOAT128@
#endif
#endif // ifndef FASTCDR_HAVE_FLOAT128

#ifndef FASTCDR_SIZEOF_LONG_DOUBLE
#define FASTCDR_SIZEOF_LONG_DOUBLE @FASTCDR_SIZEOF_LONG_DOUBLE@
#endif
#endif // ifndef FASTCDR_SIZEOF_LONG_DOUBLE

#if defined(__ARM_ARCH) && __ARM_ARCH <= 7
#define FASTCDR_ARM32
#endif
#endif // if defined(__ARM_ARCH) && __ARM_ARCH <= 7

#if defined(__GNUC__) && !defined(__clang__)
#define TEMPLATE_SPEC
#else
#define TEMPLATE_SPEC template<>
#endif // if defined(__GNUC__) && !defined(__clang__)

#endif // _FASTCDR_CONFIG_H_
Original file line number Diff line number Diff line change
Expand Up @@ -21,49 +21,47 @@
*/

#if defined(_MSC_VER)
#define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X)
#define EPROSIMA_DO_STRINGIZE(X) #X
#define EPROSIMA_STRINGIZE(X) EPROSIMA_DO_STRINGIZE(X)
#define EPROSIMA_DO_STRINGIZE(X) #X

#if defined(_DEBUG)
#define EPROSIMA_LIB_DEBUG_TAG "d"
#else
#define EPROSIMA_LIB_DEBUG_TAG
#endif // _DEBUG
#if defined(_DEBUG)
#define EPROSIMA_LIB_DEBUG_TAG "d"
#else
#define EPROSIMA_LIB_DEBUG_TAG
#endif // _DEBUG

// Select linkage option.
#if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
#define EPROSIMA_LIB_PREFIX
#elif defined(EPROSIMA_DYN_LINK)
#error "Mixing a dll eprosima library with a static runtime is a bad idea"
#else
#define EPROSIMA_LIB_PREFIX "lib"
#endif // if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
#if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)
#define EPROSIMA_LIB_PREFIX
#elif defined(EPROSIMA_DYN_LINK)
#error "Mixing a dll eprosima library with a static runtime is a bad idea"
#else
#define EPROSIMA_LIB_PREFIX "lib"
#endif // if (defined(_DLL) || defined(_RTLDLL)) && defined(EPROSIMA_DYN_LINK)

// Include library
#if defined(EPROSIMA_LIB_NAME) && defined(EPROSIMA_LIB_PREFIX) && \
defined(EPROSIMA_LIB_DEBUG_TAG) && defined(FASTCDR_VERSION_MAJOR) && \
defined(FASTCDR_VERSION_MINOR)
#pragma comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) \
EPROSIMA_LIB_DEBUG_TAG \
"-" EPROSIMA_STRINGIZE(FASTCDR_VERSION_MAJOR) "." EPROSIMA_STRINGIZE( \
FASTCDR_VERSION_MINOR) ".lib")
#else
#error "Some required macros where not defined"
#endif // if defined(EPROSIMA_LIB_NAME) && defined(EPROSIMA_LIB_PREFIX) &&
// defined(EPROSIMA_LIB_DEBUG_TAG) && defined(FASTCDR_VERSION_MAJOR) &&
// defined(FASTCDR_VERSION_MINOR)
#if defined(EPROSIMA_LIB_NAME) \
&& defined(EPROSIMA_LIB_PREFIX) \
&& defined(EPROSIMA_LIB_DEBUG_TAG) \
&& defined(FASTCDR_VERSION_MAJOR) \
&& defined(FASTCDR_VERSION_MINOR)
#pragma \
comment(lib, EPROSIMA_LIB_PREFIX EPROSIMA_STRINGIZE(EPROSIMA_LIB_NAME) EPROSIMA_LIB_DEBUG_TAG "-" EPROSIMA_STRINGIZE(FASTCDR_VERSION_MAJOR) "." EPROSIMA_STRINGIZE(FASTCDR_VERSION_MINOR) ".lib")
#else
#error "Some required macros where not defined"
#endif // if defined(EPROSIMA_LIB_NAME) && defined(EPROSIMA_LIB_PREFIX) && defined(EPROSIMA_LIB_DEBUG_TAG) && defined(FASTCDR_VERSION_MAJOR) && defined(FASTCDR_VERSION_MINOR)

#endif // _MSC_VER
#endif // _MSC_VER

// Undef macros
#ifdef EPROSIMA_LIB_PREFIX
#undef EPROSIMA_LIB_PREFIX
#endif // ifdef EPROSIMA_LIB_PREFIX
#endif // ifdef EPROSIMA_LIB_PREFIX

#ifdef EPROSIMA_LIB_NAME
#undef EPROSIMA_LIB_NAME
#endif // ifdef EPROSIMA_LIB_NAME
#endif // ifdef EPROSIMA_LIB_NAME

#ifdef EPROSIMA_LIB_DEBUG_TAG
#undef EPROSIMA_LIB_DEBUG_TAG
#endif // ifdef EPROSIMA_LIB_DEBUG_TAG
#endif // ifdef EPROSIMA_LIB_DEBUG_TAG
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
// Copyright 2023 Proyectos y Sistemas de Mantenimiento SL (eProsima).
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#ifndef _FASTCDR_EXCEPTIONS_BADOPTIONALACCESSEXCEPTION_H_
#define _FASTCDR_EXCEPTIONS_BADOPTIONALACCESSEXCEPTION_H_

#include "Exception.h"

namespace eprosima {
namespace fastcdr {
namespace exception {
/*!
* @brief This class is thrown as an exception when accessing the value of a null optional.
* @ingroup EXCEPTIONMODULE
*/
class BadOptionalAccessException : public Exception
{
public:

/*!
* @brief Default constructor.
*
* @param message An error message. This message pointer is copied.
*/
Cdr_DllAPI BadOptionalAccessException(
const char* const& message) noexcept;

/*!
* @brief Default copy constructor.
*
* @param ex BadOptionalAccessException that will be copied.
*/
Cdr_DllAPI BadOptionalAccessException(
const BadOptionalAccessException& ex) noexcept;

/*!
* @brief Default move constructor.
*
* @param ex BadOptionalAccessException that will be moved.
*/
Cdr_DllAPI BadOptionalAccessException(
BadOptionalAccessException&& ex) noexcept;

/*!
* @brief Assigment operation.
*
* @param ex BadOptionalAccessException that will be copied.
*/
Cdr_DllAPI BadOptionalAccessException& operator =(
const BadOptionalAccessException& ex) noexcept;

/*!
* @brief Assigment operation.
*
* @param ex BadOptionalAccessException that will be moved.
*/
BadOptionalAccessException& operator =(
BadOptionalAccessException&& ex) noexcept;

//! @brief Default destructor
virtual Cdr_DllAPI ~BadOptionalAccessException() noexcept;

//! @brief This function throws the object as exception.
Cdr_DllAPI void raise() const override;

//! @brief Default message used in the library.
static Cdr_DllAPI const char* const BAD_OPTIONAL_ACCESS_MESSAGE_DEFAULT;
};
} //namespace exception
} //namespace fastcdr
} //namespace eprosima
#endif // _FASTCDR_EXCEPTIONS_BADOPTIONALACCESSEXCEPTION_H_
Original file line number Diff line number Diff line change
Expand Up @@ -17,69 +17,67 @@

#include "Exception.h"

namespace eprosima
{
namespace fastcdr
{
namespace exception
{
namespace eprosima {
namespace fastcdr {
namespace exception {
/*!
* @brief This class is thrown as an exception when a invalid parameter was being
* serialized.
* @brief This class is thrown as an exception when an invalid parameter is being serialized.
* @ingroup EXCEPTIONMODULE
*/
class BadParamException : public Exception
{
public:
/*!
* @brief Default constructor.
*
* @param message A error message. This message pointer is copied.
*/
Cdr_DllAPI BadParamException(const char* const& message) noexcept;

/*!
* @brief Default copy constructor.
*
* @param ex BadParamException that will be copied.
*/
Cdr_DllAPI BadParamException(const BadParamException& ex) noexcept;
/*!
* @brief Default constructor.
*
* @param message An error message. This message pointer is copied.
*/
Cdr_DllAPI BadParamException(
const char* const& message) noexcept;

/*!
* @brief Default copy constructor.
*
* @param ex BadParamException that will be copied.
*/
Cdr_DllAPI BadParamException(
const BadParamException& ex) noexcept;

#if HAVE_CXX0X
/*!
* @brief Default move constructor.
*
* @param ex BadParamException that will be moved.
*/
Cdr_DllAPI BadParamException(BadParamException&& ex) noexcept;
#endif // if HAVE_CXX0X
/*!
* @brief Default move constructor.
*
* @param ex BadParamException that will be moved.
*/
Cdr_DllAPI BadParamException(
BadParamException&& ex) noexcept;

/*!
* @brief Assigment operation.
*
* @param ex BadParamException that will be copied.
*/
Cdr_DllAPI BadParamException& operator=(const BadParamException& ex) noexcept;
/*!
* @brief Assigment operation.
*
* @param ex BadParamException that will be copied.
*/
Cdr_DllAPI BadParamException& operator =(
const BadParamException& ex) noexcept;

#if HAVE_CXX0X
/*!
* @brief Assigment operation.
*
* @param ex BadParamException that will be moved.
*/
BadParamException& operator=(BadParamException&& ex) noexcept;
#endif // if HAVE_CXX0X
/*!
* @brief Assigment operation.
*
* @param ex BadParamException that will be moved.
*/
BadParamException& operator =(
BadParamException&& ex) noexcept;

//! @brief Default constructor
virtual Cdr_DllAPI ~BadParamException() noexcept;
//! @brief Default destructor
virtual Cdr_DllAPI ~BadParamException() noexcept;

//! @brief This function throws the object as exception.
virtual Cdr_DllAPI void raise() const;
//! @brief This function throws the object as exception.
Cdr_DllAPI void raise() const override;

//! @brief Default message used in the library.
static Cdr_DllAPI const char* const BAD_PARAM_MESSAGE_DEFAULT;
//! @brief Default message used in the library.
static Cdr_DllAPI const char* const BAD_PARAM_MESSAGE_DEFAULT;
};
} // namespace exception
} // namespace fastcdr
} // namespace eprosima
#endif // _FASTCDR_EXCEPTIONS_BADPARAMEXCEPTION_H_
} //namespace exception
} //namespace fastcdr
} //namespace eprosima
#endif // _FASTCDR_EXCEPTIONS_BADPARAMEXCEPTION_H_
Loading

0 comments on commit 0687ebf

Please sign in to comment.