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
fced79b0
Commit
fced79b0
authored
Sep 08, 2017
by
Victor Zverovich
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Get rid of old compat macros
parent
be887d92
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
4 additions
and
38 deletions
+4
-38
fmt/format.h
fmt/format.h
+3
-31
fmt/posix.cc
fmt/posix.cc
+1
-1
test/posix-mock-test.cc
test/posix-mock-test.cc
+0
-6
No files found.
fmt/format.h
View file @
fced79b0
...
...
@@ -165,24 +165,11 @@
# endif
#endif
// A macro to disallow the copy constructor and operator= functions
// This should be used in the private: declarations for a class
#ifndef FMT_USE_DELETED_FUNCTIONS
# define FMT_USE_DELETED_FUNCTIONS 0
#endif
#if FMT_USE_DELETED_FUNCTIONS || FMT_HAS_FEATURE(cxx_deleted_functions) || \
FMT_GCC_VERSION >= 404 || FMT_MSC_VER >= 1800
# define FMT_DELETED_OR_UNDEFINED = delete
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
// A macro to disallow the copy construction and assignment.
#define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&) = delete; \
TypeName& operator=(const TypeName&) = delete
#else
# define FMT_DELETED_OR_UNDEFINED
# define FMT_DISALLOW_COPY_AND_ASSIGN(TypeName) \
TypeName(const TypeName&); \
TypeName& operator=(const TypeName&)
#endif
#define FMT_DELETED_OR_UNDEFINED = delete
#ifndef FMT_USE_USER_DEFINED_LITERALS
// All compilers which support UDLs also support variadic templates. This
...
...
@@ -1447,27 +1434,12 @@ basic_arg<Context> make_arg(const T &value) {
return
arg
;
}
#define FMT_CONCAT(a, b) a##b
#if FMT_GCC_VERSION >= 407
# define FMT_UNUSED __attribute__((unused))
#else
# define FMT_UNUSED
#endif
#ifndef FMT_USE_STATIC_ASSERT
# define FMT_USE_STATIC_ASSERT 0
#endif
#if FMT_USE_STATIC_ASSERT || FMT_HAS_FEATURE(cxx_static_assert) || \
FMT_GCC_VERSION >= 403 || _MSC_VER >= 1600
# define FMT_STATIC_ASSERT(cond, message) static_assert(cond, message)
#else
# define FMT_CONCAT_(a, b) FMT_CONCAT(a, b)
# define FMT_STATIC_ASSERT(cond, message) \
typedef int FMT_CONCAT_(Assert, __LINE__)[(cond) ? 1 : -1] FMT_UNUSED
#endif
template
<
typename
Context
>
struct
named_arg
:
basic_arg
<
Context
>
{
typedef
typename
Context
::
char_type
Char
;
...
...
fmt/posix.cc
View file @
fced79b0
...
...
@@ -144,7 +144,7 @@ long long fmt::File::size() const {
Stat
file_stat
=
Stat
();
if
(
FMT_POSIX_CALL
(
fstat
(
fd_
,
&
file_stat
))
==
-
1
)
throw
system_error
(
errno
,
"cannot get file attributes"
);
FMT_STATIC_ASSERT
(
sizeof
(
long
long
)
>=
sizeof
(
file_stat
.
st_size
),
static_assert
(
sizeof
(
long
long
)
>=
sizeof
(
file_stat
.
st_size
),
"return type of File::size is not large enough"
);
return
file_stat
.
st_size
;
#endif
...
...
test/posix-mock-test.cc
View file @
fced79b0
...
...
@@ -218,12 +218,6 @@ void write_file(fmt::cstring_view filename, fmt::string_view content) {
f
.
print
(
"{}"
,
content
);
}
TEST
(
UtilTest
,
StaticAssert
)
{
FMT_STATIC_ASSERT
(
true
,
"success"
);
// Static assertion failure is tested in compile-test because it causes
// a compile-time error.
}
TEST
(
UtilTest
,
GetPageSize
)
{
#ifdef _WIN32
SYSTEM_INFO
si
=
{};
...
...
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