From 2b143287878c83dd24f5c14c53eb1cc44e75ed5f Mon Sep 17 00:00:00 2001 From: Pavel Kirienko Date: Mon, 5 May 2014 20:14:57 +0400 Subject: [PATCH] Style fix, UAVCAN_CPP_VERSION made optional --- libuavcan/include/uavcan/impl_constants.hpp | 14 ++++++++------ libuavcan/include/uavcan/util/templates.hpp | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/libuavcan/include/uavcan/impl_constants.hpp b/libuavcan/include/uavcan/impl_constants.hpp index 379ffa1596..7be734fc16 100644 --- a/libuavcan/include/uavcan/impl_constants.hpp +++ b/libuavcan/include/uavcan/impl_constants.hpp @@ -19,12 +19,14 @@ #define UAVCAN_CPP11 2011 #define UAVCAN_CPP03 2003 -#if __cplusplus > 201200 -# error Unsupported C++ standard -#elif (__cplusplus > 201100) || defined(__GXX_EXPERIMENTAL_CXX0X__) -# define UAVCAN_CPP_VERSION UAVCAN_CPP11 -#else -# define UAVCAN_CPP_VERSION UAVCAN_CPP03 +#ifndef UAVCAN_CPP_VERSION +# if __cplusplus > 201200 +# error Unsupported C++ standard +# elif (__cplusplus > 201100) || defined(__GXX_EXPERIMENTAL_CXX0X__) +# define UAVCAN_CPP_VERSION UAVCAN_CPP11 +# else +# define UAVCAN_CPP_VERSION UAVCAN_CPP03 +# endif #endif /** diff --git a/libuavcan/include/uavcan/util/templates.hpp b/libuavcan/include/uavcan/util/templates.hpp index 0afc5150a1..cb4e373004 100644 --- a/libuavcan/include/uavcan/util/templates.hpp +++ b/libuavcan/include/uavcan/util/templates.hpp @@ -213,7 +213,7 @@ const T& max(const T& a, const T& b) /** * Replacement for std::lexicographical_compare(..) */ -template +template UAVCAN_EXPORT bool lexicographical_compare(InputIt1 first1, InputIt1 last1, InputIt2 first2, InputIt2 last2) { @@ -236,7 +236,7 @@ bool lexicographical_compare(InputIt1 first1, InputIt1 last1, InputIt2 first2, I /** * Replacement for std::equal(..) */ -template +template UAVCAN_EXPORT bool equal(InputIt1 first1, InputIt1 last1, InputIt2 first2) {