Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
F
fmt
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Libraries
fmt
Commits
115e00e0
Commit
115e00e0
authored
Jul 03, 2022
by
Vladislav Shchapov
Committed by
Victor Zverovich
Jul 04, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace __cplusplus with FMT_CPLUSPLUS.
Signed-off-by:
Vladislav Shchapov
<
vladislav@shchapov.ru
>
parent
94114b05
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
20 additions
and
20 deletions
+20
-20
include/fmt/core.h
include/fmt/core.h
+11
-11
include/fmt/format.h
include/fmt/format.h
+1
-1
test/compile-fp-test.cc
test/compile-fp-test.cc
+1
-1
test/compile-test.cc
test/compile-test.cc
+2
-2
test/format-test.cc
test/format-test.cc
+3
-3
test/xchar-test.cc
test/xchar-test.cc
+2
-2
No files found.
include/fmt/core.h
View file @
115e00e0
...
@@ -93,7 +93,7 @@
...
@@ -93,7 +93,7 @@
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
// GCC doesn't allow throw in constexpr until version 6 (bug 67371).
#ifndef FMT_USE_CONSTEXPR
#ifndef FMT_USE_CONSTEXPR
# if (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VERSION >= 1912 || \
# if (FMT_HAS_FEATURE(cxx_relaxed_constexpr) || FMT_MSC_VERSION >= 1912 || \
(FMT_GCC_VERSION >= 600 &&
__cplusplus >= 201402L)) &&
\
(FMT_GCC_VERSION >= 600 &&
FMT_CPLUSPLUS >= 201402L)) &&
\
!FMT_ICC_VERSION && !defined(__NVCC__)
!FMT_ICC_VERSION && !defined(__NVCC__)
# define FMT_USE_CONSTEXPR 1
# define FMT_USE_CONSTEXPR 1
# else
# else
...
@@ -106,9 +106,9 @@
...
@@ -106,9 +106,9 @@
# define FMT_CONSTEXPR
# define FMT_CONSTEXPR
#endif
#endif
#if ((
__cplusplus >= 202002L) &&
\
#if ((
FMT_CPLUSPLUS >= 202002L) &&
\
(!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE > 9)) || \
(!defined(_GLIBCXX_RELEASE) || _GLIBCXX_RELEASE > 9)) || \
(
__cplusplus
>= 201709L && FMT_GCC_VERSION >= 1002)
(
FMT_CPLUSPLUS
>= 201709L && FMT_GCC_VERSION >= 1002)
# define FMT_CONSTEXPR20 constexpr
# define FMT_CONSTEXPR20 constexpr
#else
#else
# define FMT_CONSTEXPR20
# define FMT_CONSTEXPR20
...
@@ -116,11 +116,11 @@
...
@@ -116,11 +116,11 @@
// Check if constexpr std::char_traits<>::{compare,length} are supported.
// Check if constexpr std::char_traits<>::{compare,length} are supported.
#if defined(__GLIBCXX__)
#if defined(__GLIBCXX__)
# if
__cplusplus
>= 201703L && defined(_GLIBCXX_RELEASE) && \
# if
FMT_CPLUSPLUS
>= 201703L && defined(_GLIBCXX_RELEASE) && \
_GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
_GLIBCXX_RELEASE >= 7 // GCC 7+ libstdc++ has _GLIBCXX_RELEASE.
# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
# endif
# endif
#elif defined(_LIBCPP_VERSION) &&
__cplusplus
>= 201703L && \
#elif defined(_LIBCPP_VERSION) &&
FMT_CPLUSPLUS
>= 201703L && \
_LIBCPP_VERSION >= 4000
_LIBCPP_VERSION >= 4000
# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
# define FMT_CONSTEXPR_CHAR_TRAITS constexpr
#elif FMT_MSC_VERSION >= 1914 && FMT_CPLUSPLUS >= 201703L
#elif FMT_MSC_VERSION >= 1914 && FMT_CPLUSPLUS >= 201703L
...
@@ -248,7 +248,7 @@
...
@@ -248,7 +248,7 @@
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
(FMT_CPLUSPLUS >= 201703L || defined(_LIBCPP_VERSION))
# include <string_view>
# include <string_view>
# define FMT_USE_STRING_VIEW
# define FMT_USE_STRING_VIEW
#elif FMT_HAS_INCLUDE("experimental/string_view") &&
__cplusplus
>= 201402L
#elif FMT_HAS_INCLUDE("experimental/string_view") &&
FMT_CPLUSPLUS
>= 201402L
# include <experimental/string_view>
# include <experimental/string_view>
# define FMT_USE_EXPERIMENTAL_STRING_VIEW
# define FMT_USE_EXPERIMENTAL_STRING_VIEW
#endif
#endif
...
@@ -258,9 +258,9 @@
...
@@ -258,9 +258,9 @@
#endif
#endif
#ifndef FMT_CONSTEVAL
#ifndef FMT_CONSTEVAL
# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) && \
# if ((FMT_GCC_VERSION >= 1000 || FMT_CLANG_VERSION >= 1101) &&
\
__cplusplus
>= 202002L && !defined(__apple_build_version__)) || \
FMT_CPLUSPLUS
>= 202002L && !defined(__apple_build_version__)) || \
(defined(__cpp_consteval) && \
(defined(__cpp_consteval) &&
\
(!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
(!FMT_MSC_VERSION || _MSC_FULL_VER >= 193030704))
// consteval is broken in MSVC before VS2022 and Apple clang 13.
// consteval is broken in MSVC before VS2022 and Apple clang 13.
# define FMT_CONSTEVAL consteval
# define FMT_CONSTEVAL consteval
...
@@ -271,8 +271,8 @@
...
@@ -271,8 +271,8 @@
#endif
#endif
#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS
#ifndef FMT_USE_NONTYPE_TEMPLATE_ARGS
# if defined(__cpp_nontype_template_args) && \
# if defined(__cpp_nontype_template_args) &&
\
((FMT_GCC_VERSION >= 903 &&
__cplusplus
>= 201709L) || \
((FMT_GCC_VERSION >= 903 &&
FMT_CPLUSPLUS
>= 201709L) || \
__cpp_nontype_template_args >= 201911L)
__cpp_nontype_template_args >= 201911L)
# define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
# define FMT_USE_NONTYPE_TEMPLATE_ARGS 1
# else
# else
...
...
include/fmt/format.h
View file @
115e00e0
...
@@ -1516,7 +1516,7 @@ template <typename T = void> struct basic_data {
...
@@ -1516,7 +1516,7 @@ template <typename T = void> struct basic_data {
10000000000000000000ULL
};
10000000000000000000ULL
};
};
};
#if
__cplusplus
< 201703L
#if
FMT_CPLUSPLUS
< 201703L
template
<
typename
T
>
constexpr
uint64_t
basic_data
<
T
>::
pow10_significands
[];
template
<
typename
T
>
constexpr
uint64_t
basic_data
<
T
>::
pow10_significands
[];
template
<
typename
T
>
constexpr
int16_t
basic_data
<
T
>::
pow10_exponents
[];
template
<
typename
T
>
constexpr
int16_t
basic_data
<
T
>::
pow10_exponents
[];
template
<
typename
T
>
constexpr
uint64_t
basic_data
<
T
>::
power_of_10_64
[];
template
<
typename
T
>
constexpr
uint64_t
basic_data
<
T
>::
power_of_10_64
[];
...
...
test/compile-fp-test.cc
View file @
115e00e0
...
@@ -11,7 +11,7 @@
...
@@ -11,7 +11,7 @@
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806 && \
#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806 && \
defined(__cpp_constexpr) && __cpp_constexpr >= 201907 && \
defined(__cpp_constexpr) && __cpp_constexpr >= 201907 && \
defined(__cpp_constexpr_dynamic_alloc) && \
defined(__cpp_constexpr_dynamic_alloc) && \
__cpp_constexpr_dynamic_alloc >= 201907 &&
__cplusplus
>= 202002L
__cpp_constexpr_dynamic_alloc >= 201907 &&
FMT_CPLUSPLUS
>= 202002L
template
<
size_t
max_string_length
,
typename
Char
=
char
>
struct
test_string
{
template
<
size_t
max_string_length
,
typename
Char
=
char
>
struct
test_string
{
template
<
typename
T
>
constexpr
bool
operator
==
(
const
T
&
rhs
)
const
noexcept
{
template
<
typename
T
>
constexpr
bool
operator
==
(
const
T
&
rhs
)
const
noexcept
{
return
fmt
::
basic_string_view
<
Char
>
(
rhs
).
compare
(
buffer
)
==
0
;
return
fmt
::
basic_string_view
<
Char
>
(
rhs
).
compare
(
buffer
)
==
0
;
...
...
test/compile-test.cc
View file @
115e00e0
...
@@ -294,8 +294,8 @@ TEST(compile_test, compile_format_string_literal) {
...
@@ -294,8 +294,8 @@ TEST(compile_test, compile_format_string_literal) {
}
}
#endif
#endif
#if
__cplusplus
>= 202002L || \
#if
FMT_CPLUSPLUS
>= 202002L || \
(
__cplusplus
>= 201709L && FMT_GCC_VERSION >= 1002)
(
FMT_CPLUSPLUS
>= 201709L && FMT_GCC_VERSION >= 1002)
template
<
size_t
max_string_length
,
typename
Char
=
char
>
struct
test_string
{
template
<
size_t
max_string_length
,
typename
Char
=
char
>
struct
test_string
{
template
<
typename
T
>
constexpr
bool
operator
==
(
const
T
&
rhs
)
const
noexcept
{
template
<
typename
T
>
constexpr
bool
operator
==
(
const
T
&
rhs
)
const
noexcept
{
return
fmt
::
basic_string_view
<
Char
>
(
rhs
).
compare
(
buffer
)
==
0
;
return
fmt
::
basic_string_view
<
Char
>
(
rhs
).
compare
(
buffer
)
==
0
;
...
...
test/format-test.cc
View file @
115e00e0
...
@@ -1860,11 +1860,11 @@ TEST(format_test, compile_time_string) {
...
@@ -1860,11 +1860,11 @@ TEST(format_test, compile_time_string) {
(
void
)
with_null
;
(
void
)
with_null
;
(
void
)
no_null
;
(
void
)
no_null
;
#if
__cplusplus
>= 201703L
#if
FMT_CPLUSPLUS
>= 201703L
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
with_null
),
42
));
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
with_null
),
42
));
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
no_null
),
42
));
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
no_null
),
42
));
#endif
#endif
#if defined(FMT_USE_STRING_VIEW) &&
__cplusplus
>= 201703L
#if defined(FMT_USE_STRING_VIEW) &&
FMT_CPLUSPLUS
>= 201703L
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
std
::
string_view
(
"{}"
)),
42
));
EXPECT_EQ
(
"42"
,
fmt
::
format
(
FMT_STRING
(
std
::
string_view
(
"{}"
)),
42
));
#endif
#endif
}
}
...
@@ -2233,7 +2233,7 @@ TEST(format_test, char_traits_is_not_ambiguous) {
...
@@ -2233,7 +2233,7 @@ TEST(format_test, char_traits_is_not_ambiguous) {
using
namespace
std
;
using
namespace
std
;
auto
c
=
char_traits
<
char
>::
char_type
();
auto
c
=
char_traits
<
char
>::
char_type
();
(
void
)
c
;
(
void
)
c
;
#if
__cplusplus
>= 201103L
#if
FMT_CPLUSPLUS
>= 201103L
auto
s
=
std
::
string
();
auto
s
=
std
::
string
();
auto
lval
=
begin
(
s
);
auto
lval
=
begin
(
s
);
(
void
)
lval
;
(
void
)
lval
;
...
...
test/xchar-test.cc
View file @
115e00e0
...
@@ -98,12 +98,12 @@ TEST(xchar_test, is_formattable) {
...
@@ -98,12 +98,12 @@ TEST(xchar_test, is_formattable) {
}
}
TEST
(
xchar_test
,
compile_time_string
)
{
TEST
(
xchar_test
,
compile_time_string
)
{
#if defined(FMT_USE_STRING_VIEW) &&
__cplusplus
>= 201703L
#if defined(FMT_USE_STRING_VIEW) &&
FMT_CPLUSPLUS
>= 201703L
EXPECT_EQ
(
L"42"
,
fmt
::
format
(
FMT_STRING
(
std
::
wstring_view
(
L"{}"
)),
42
));
EXPECT_EQ
(
L"42"
,
fmt
::
format
(
FMT_STRING
(
std
::
wstring_view
(
L"{}"
)),
42
));
#endif
#endif
}
}
#if
__cplusplus
> 201103L
#if
FMT_CPLUSPLUS
> 201103L
struct
custom_char
{
struct
custom_char
{
int
value
;
int
value
;
custom_char
()
=
default
;
custom_char
()
=
default
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment