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
1b193e7b
Commit
1b193e7b
authored
Jan 03, 2022
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Deprecate more
parent
8e59744b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
24 additions
and
49 deletions
+24
-49
include/fmt/core.h
include/fmt/core.h
+21
-8
include/fmt/format.h
include/fmt/format.h
+0
-14
test/core-test.cc
test/core-test.cc
+3
-5
test/format-test.cc
test/format-test.cc
+0
-16
test/printf-test.cc
test/printf-test.cc
+0
-6
No files found.
include/fmt/core.h
View file @
1b193e7b
...
@@ -219,6 +219,20 @@
...
@@ -219,6 +219,20 @@
# endif
# endif
#endif
#endif
#ifndef FMT_DEPRECATED
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
# define FMT_DEPRECATED [[deprecated]]
# else
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED
/* deprecated */
# endif
# endif
#endif
#ifndef FMT_BEGIN_NAMESPACE
#ifndef FMT_BEGIN_NAMESPACE
# define FMT_BEGIN_NAMESPACE \
# define FMT_BEGIN_NAMESPACE \
namespace fmt { \
namespace fmt { \
...
@@ -1373,21 +1387,20 @@ template <typename Context> struct arg_mapper {
...
@@ -1373,21 +1387,20 @@ template <typename Context> struct arg_mapper {
using
cstring_result
=
conditional_t
<
std
::
is_same
<
char_type
,
char
>::
value
,
using
cstring_result
=
conditional_t
<
std
::
is_same
<
char_type
,
char
>::
value
,
const
char
*
,
unformattable_pointer
>
;
const
char
*
,
unformattable_pointer
>
;
// DEPRECATED!
FMT_DEPRECATED
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
signed
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
signed
char
*
val
)
->
cstring_result
{
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
// DEPRECATED!
FMT_DEPRECATED
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
unsigned
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
const
unsigned
char
*
val
)
->
cstring_result
{
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
// DEPRECATED!
FMT_DEPRECATED
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
signed
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
signed
char
*
val
)
->
cstring_result
{
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
// DEPRECATED!
FMT_DEPRECATED
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
unsigned
char
*
val
)
FMT_CONSTEXPR
FMT_INLINE
auto
map
(
unsigned
char
*
val
)
->
cstring_result
{
->
cstring_result
{
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
return
map
(
reinterpret_cast
<
const
char
*>
(
val
));
}
}
...
...
include/fmt/format.h
View file @
1b193e7b
...
@@ -110,20 +110,6 @@ FMT_END_NAMESPACE
...
@@ -110,20 +110,6 @@ FMT_END_NAMESPACE
# define FMT_CATCH(x) if (false)
# define FMT_CATCH(x) if (false)
#endif
#endif
#ifndef FMT_DEPRECATED
# if FMT_HAS_CPP14_ATTRIBUTE(deprecated) || FMT_MSC_VER >= 1900
# define FMT_DEPRECATED [[deprecated]]
# else
# if (defined(__GNUC__) && !defined(__LCC__)) || defined(__clang__)
# define FMT_DEPRECATED __attribute__((deprecated))
# elif FMT_MSC_VER
# define FMT_DEPRECATED __declspec(deprecated)
# else
# define FMT_DEPRECATED
/* deprecated */
# endif
# endif
#endif
#ifndef FMT_MAYBE_UNUSED
#ifndef FMT_MAYBE_UNUSED
# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused)
# if FMT_HAS_CPP17_ATTRIBUTE(maybe_unused)
# define FMT_MAYBE_UNUSED [[maybe_unused]]
# define FMT_MAYBE_UNUSED [[maybe_unused]]
...
...
test/core-test.cc
View file @
1b193e7b
...
@@ -740,10 +740,13 @@ struct convertible_to_pointer {
...
@@ -740,10 +740,13 @@ struct convertible_to_pointer {
enum
class
test_scoped_enum
{};
enum
class
test_scoped_enum
{};
TEST
(
core_test
,
is_formattable
)
{
TEST
(
core_test
,
is_formattable
)
{
#if 0
// This should be enabled once corresponding map overloads are gone.
static_assert(fmt::is_formattable<signed char*>::value, "");
static_assert(fmt::is_formattable<signed char*>::value, "");
static_assert(fmt::is_formattable<unsigned char*>::value, "");
static_assert(fmt::is_formattable<unsigned char*>::value, "");
static_assert(fmt::is_formattable<const signed char*>::value, "");
static_assert(fmt::is_formattable<const signed char*>::value, "");
static_assert(fmt::is_formattable<const unsigned char*>::value, "");
static_assert(fmt::is_formattable<const unsigned char*>::value, "");
#endif
static_assert
(
!
fmt
::
is_formattable
<
wchar_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
wchar_t
>::
value
,
""
);
#ifdef __cpp_char8_t
#ifdef __cpp_char8_t
static_assert
(
!
fmt
::
is_formattable
<
char8_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
char8_t
>::
value
,
""
);
...
@@ -768,11 +771,6 @@ TEST(core_test, is_formattable) {
...
@@ -768,11 +771,6 @@ TEST(core_test, is_formattable) {
static_assert
(
!
fmt
::
is_formattable
<
convertible_to_pointer
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
convertible_to_pointer
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
signed
char
*
,
wchar_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
unsigned
char
*
,
wchar_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
const
signed
char
*
,
wchar_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
const
unsigned
char
*
,
wchar_t
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
void
(
*
)()
>::
value
,
""
);
static_assert
(
!
fmt
::
is_formattable
<
void
(
*
)()
>::
value
,
""
);
struct
s
;
struct
s
;
...
...
test/format-test.cc
View file @
1b193e7b
...
@@ -1386,22 +1386,6 @@ TEST(format_test, format_cstring) {
...
@@ -1386,22 +1386,6 @@ TEST(format_test, format_cstring) {
format_error
,
"string pointer is null"
);
format_error
,
"string pointer is null"
);
}
}
TEST
(
format_test
,
format_schar_string
)
{
signed
char
str
[]
=
"test"
;
EXPECT_EQ
(
"test"
,
fmt
::
format
(
"{0:s}"
,
str
));
const
signed
char
*
const_str
=
str
;
EXPECT_EQ
(
"test"
,
fmt
::
format
(
"{0:s}"
,
const_str
));
}
TEST
(
format_test
,
format_uchar_string
)
{
unsigned
char
str
[]
=
"test"
;
EXPECT_EQ
(
"test"
,
fmt
::
format
(
"{0:s}"
,
str
));
const
unsigned
char
*
const_str
=
str
;
EXPECT_EQ
(
"test"
,
fmt
::
format
(
"{0:s}"
,
const_str
));
unsigned
char
*
ptr
=
str
;
EXPECT_EQ
(
"test"
,
fmt
::
format
(
"{0:s}"
,
ptr
));
}
void
function_pointer_test
(
int
,
double
,
std
::
string
)
{}
void
function_pointer_test
(
int
,
double
,
std
::
string
)
{}
TEST
(
format_test
,
format_pointer
)
{
TEST
(
format_test
,
format_pointer
)
{
...
...
test/printf-test.cc
View file @
1b193e7b
...
@@ -481,12 +481,6 @@ TEST(printf_test, string) {
...
@@ -481,12 +481,6 @@ TEST(printf_test, string) {
EXPECT_PRINTF
(
L" (null)"
,
L"%10s"
,
null_wstr
);
EXPECT_PRINTF
(
L" (null)"
,
L"%10s"
,
null_wstr
);
}
}
TEST
(
printf_test
,
uchar_string
)
{
unsigned
char
str
[]
=
"test"
;
unsigned
char
*
pstr
=
str
;
EXPECT_EQ
(
"test"
,
fmt
::
sprintf
(
"%s"
,
pstr
));
}
TEST
(
printf_test
,
pointer
)
{
TEST
(
printf_test
,
pointer
)
{
int
n
;
int
n
;
void
*
p
=
&
n
;
void
*
p
=
&
n
;
...
...
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