mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-11-11 21:03:07 +00:00
Fix building when using C++11
Update changelog
This commit is contained in:
@@ -31,6 +31,7 @@ set(GNSS_SPLIBS_SOURCES
|
||||
item_type_helpers.cc
|
||||
pass_through.cc
|
||||
short_x2_to_cshort.cc
|
||||
gnss_sdr_string_literals.cc
|
||||
)
|
||||
|
||||
set(GNSS_SPLIBS_HEADERS
|
||||
@@ -61,6 +62,7 @@ set(GNSS_SPLIBS_HEADERS
|
||||
item_type_helpers.h
|
||||
pass_through.h
|
||||
short_x2_to_cshort.h
|
||||
gnss_sdr_string_literals.h
|
||||
)
|
||||
|
||||
if(ENABLE_OPENCL)
|
||||
|
||||
37
src/algorithms/libs/gnss_sdr_string_literals.cc
Normal file
37
src/algorithms/libs/gnss_sdr_string_literals.cc
Normal file
@@ -0,0 +1,37 @@
|
||||
/*!
|
||||
* \file gnss_sdr_string_literals.cc
|
||||
* \brief This file implements the ""s operator for std::string in C++11, and
|
||||
* puts it into the std::string_literals namespace. This is already implemented
|
||||
* in C++14, so this is only compiled when using C++11. The .cc file is required
|
||||
* for avoiding the duplication of symbols.
|
||||
*
|
||||
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#include "gnss_sdr_string_literals.h"
|
||||
|
||||
#if __cplusplus == 201103L
|
||||
|
||||
namespace std
|
||||
{
|
||||
namespace string_literals
|
||||
{
|
||||
std::string operator"" s(const char* str, std::size_t len)
|
||||
{
|
||||
return std::string(str, len);
|
||||
};
|
||||
} // namespace string_literals
|
||||
} // namespace std
|
||||
|
||||
#endif // __cplusplus == 201103L
|
||||
48
src/algorithms/libs/gnss_sdr_string_literals.h
Normal file
48
src/algorithms/libs/gnss_sdr_string_literals.h
Normal file
@@ -0,0 +1,48 @@
|
||||
/*!
|
||||
* \file gnss_sdr_string_literals.h
|
||||
* \brief This file implements the ""s operator for std::string in C++11, and
|
||||
* puts it into the std::string_literals namespace. This is already implemented
|
||||
* in C++14, so this is only compiled when using C++11. The .cc file is required
|
||||
* for avoiding the duplication of symbols.
|
||||
*
|
||||
* \author Carles Fernandez-Prades, 2021. cfernandez(at)cttc.es
|
||||
*
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*
|
||||
* GNSS-SDR is a Global Navigation Satellite System software-defined receiver.
|
||||
* This file is part of GNSS-SDR.
|
||||
*
|
||||
* Copyright (C) 2010-2021 (see AUTHORS file for a list of contributors)
|
||||
* SPDX-License-Identifier: GPL-3.0-or-later
|
||||
*
|
||||
* -----------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
#ifndef GNSS_SDR_STRING_LITERALS_H
|
||||
#define GNSS_SDR_STRING_LITERALS_H
|
||||
|
||||
/** \addtogroup Algorithms_Library
|
||||
* \{ */
|
||||
/** \addtogroup Algorithm_libs algorithms_libs
|
||||
* \{ */
|
||||
|
||||
#if __cplusplus == 201103L
|
||||
|
||||
#include <cstddef>
|
||||
#include <string>
|
||||
|
||||
namespace std
|
||||
{
|
||||
namespace string_literals
|
||||
{
|
||||
std::string operator"" s(const char* str, std::size_t len);
|
||||
} // namespace string_literals
|
||||
} // namespace std
|
||||
|
||||
#endif // __cplusplus == 201103L
|
||||
|
||||
/** \} */
|
||||
/** \} */
|
||||
|
||||
#endif // GNSS_SDR_STRING_LITERALS_H
|
||||
Reference in New Issue
Block a user