Jacob Vosmaer
dca0519336
Clang: only use [[fallthrough]] in C++ files
...
It appears that [[fallthrough]] is valid in C++ but not in C. And
in some Clang versions (e.g. Clang 11 on macOS), Clang is pedantic
about this and considers it an error to use [[fallthrough]] in a
.c file such as src/util/format.c.
This changes makes gcc_fallthrough a no-op under Clang in C files.
2019-12-31 13:54:09 +01:00
Max Kellermann
7770298a65
util/Compiler.h: use [[fallthrough]]
on clang
...
Older clang versions don't support the GCC __attribute__ syntax. For
those, don't use anything at all, and new clang versions shall use the
standard syntax.
2019-12-24 08:04:48 +01:00
Max Kellermann
a1afe9afc6
util/Compiler.h: add gcc_fallthrough
...
Works around build failures with ccache which may feed processed code
to GCC, which doesn't have the "fall through" code comments.
2019-12-23 17:53:57 +01:00
Max Kellermann
e9af692973
util/Time*: move to time/
2019-12-16 23:02:14 +01:00
Max Kellermann
2e8f42c6ad
util/StringBuffer: use std::size_t instead of size_t
2019-12-16 22:51:23 +01:00
Max Kellermann
2c276770f0
util/PrintException, ...: update copyright
2019-12-04 12:33:36 +01:00
Max Kellermann
52bee8f81f
util/StaticFifoBuffer: add GetAvailable()
2019-08-02 22:49:55 +02:00
Max Kellermann
adc25e648f
util/StaticFifoBuffer: add constexpr
2019-08-02 22:49:33 +02:00
Max Kellermann
31da8eac9b
util/StaticFifoBuffer: add noexcept
2019-08-02 22:49:05 +02:00
Max Kellermann
e00464435b
util/Compiler.h: move compiler version checks to meson.build
2019-08-02 15:53:16 +02:00
Max Kellermann
1eae9339f2
db/Interface: CollectUniqueTags() allows multiple "groups"
...
Instead of passing tag and group, pass an array of tags. To support a
nested return value, return a nested std::map of std::maps. Each key
specifies the tag value, and each value may be another nesting level.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/408
2019-06-16 10:39:29 +02:00
Max Kellermann
05aa9f72a9
util/StringView: add SkipPrefix(), RemoveSuffix()
2019-02-19 11:51:32 +01:00
Max Kellermann
5cf889b676
util/WStringView: add missing include
2019-01-22 08:38:03 +01:00
Max Kellermann
b02fee7309
util/PrintException: support "const char *"
2019-01-21 21:19:35 +01:00
Max Kellermann
424f75c9e1
util/OffsetPointer: remove redundant inline
keywords from constexpr
functions
2019-01-21 21:19:09 +01:00
Max Kellermann
f6e1176f97
util/CharUtil: remove redundant inline
keywords from constexpr
functions
2019-01-21 21:18:23 +01:00
Max Kellermann
e4700c0a27
util/Cast: remove redundant inline
keywords from constexpr
functions
2019-01-21 21:17:58 +01:00
Max Kellermann
7104ac963b
util/AllocatedArray: import std::swap
2018-12-28 17:18:41 +01:00
Max Kellermann
2cb36590b2
util/AllocatedArray: add noexcept
2018-12-28 17:17:28 +01:00
Max Kellermann
53a4de35c4
util/DynamicFifoBuffer: add noexcept
2018-12-28 17:06:01 +01:00
Max Kellermann
ce49d99c2f
check.h: remove obsolete header
...
Since we switched from autotools to Meson in commit
94592c1406
, we don't need to include
`config.h` early to properly enable large file support. Meson passes
the required macros on the compiler command line instead of defining
them in `config.h`.
This means we can include `config.h` at any time, whenever we want to
check its macros, and there are no ordering constraints.
2018-11-19 16:33:49 +01:00
Max Kellermann
f5c9071494
*: copyright year 2018
2018-10-31 17:54:59 +01:00
Max Kellermann
d0349880da
util/StringCompare: add StringAfterPrefixIgnoreCase()
2018-10-29 14:34:29 +01:00
Max Kellermann
94592c1406
build with Meson instead of autotools
...
So long, autotools! This is my last MPD related project to migrate
away from it. It has its strengths, but also very obvious weaknesses
and weirdnesses. Today, many of its quirks are not needed anymore,
and are cumbersome and slow. Now welcome our new Meson overlords!
2018-10-14 23:41:38 +02:00
Max Kellermann
608d232373
util/SliceBuffer: re-add line which got lost in the last commit
2018-09-23 19:33:34 +02:00
Max Kellermann
1702e98fdf
util/SliceBuffer: move code to DiscardMemory()
2018-09-23 19:15:28 +02:00
Max Kellermann
728e4e9a38
util/StringCompare: add StringEndsWithIgnoreCase(), StringStartsWithIgnoreCase()
2018-09-06 19:52:43 +02:00
Max Kellermann
2d6f9f9a9c
Util/WStringAPI: non-Windows implementation of _wcs*cmp()
2018-09-06 19:49:45 +02:00
Max Kellermann
c2e2e5543e
util/WStringAPI: add wcscoll() wrapper
2018-09-06 19:39:28 +02:00
Max Kellermann
349d8eb248
util/WStringCompare: add "noexcept"
2018-09-06 19:35:09 +02:00
Max Kellermann
94b96bde9b
util/WStringCompare: wcpcpy() and wcsdup() are available on Android
2018-09-06 19:33:50 +02:00
Max Kellermann
45ffc864c5
util/StringCompare: add more function attributes
2018-09-06 19:23:13 +02:00
Max Kellermann
eee91aa4ea
util/Exception: update copyright
2018-08-21 08:20:52 +02:00
Max Kellermann
855750c784
util/{Const,Writable}Buffer: add method SetEnd()
2018-08-21 08:20:17 +02:00
Max Kellermann
2156fc64f4
util/StringStrip: more API documentation
2018-08-20 16:30:46 +02:00
Max Kellermann
441440101d
util/StringStrip: add more "nonnull" attributes
2018-08-20 16:28:43 +02:00
Max Kellermann
ec54754e22
Compiler.h: move to util/
2018-08-20 16:19:17 +02:00
Max Kellermann
489e11072e
util/WritableBuffer: add ConstBuffer cast operator
2018-08-20 15:36:50 +02:00
Max Kellermann
5e2af15e94
util/Manual: add static method Cast()
2018-08-20 15:35:43 +02:00
Max Kellermann
3fbb54e0a4
util/IterableSplitString: use operator==(nullptr_t)
2018-08-20 15:35:09 +02:00
Max Kellermann
fe6de14faf
util/StringView: add ConstBuffer cast constructors
2018-08-20 15:34:07 +02:00
Max Kellermann
e85b9960f0
util/StringCompare: use StringAPI.hxx
2018-08-20 15:33:16 +02:00
Max Kellermann
75c836fbd9
util/StringAPI: use StringCompare() in StringIsEqual()
2018-08-20 15:31:09 +02:00
Max Kellermann
94b1025780
util/RuntimeError: fix typo
2018-08-20 15:22:24 +02:00
Max Kellermann
36ca9d01fb
util/ForeignFifoBuffer: shift the buffer in MoveFrom() on demand
...
The API documentation says "move as much data as possible", and if
there is room at the head of the buffer, we should use that if the
room after the tail is not large enough.
2018-08-20 15:21:05 +02:00
Max Kellermann
3bceed1b53
util/ForeignFifoBuffer: add "noexcept"
2018-08-20 14:53:39 +02:00
Max Kellermann
90de2c4bd6
util/Exception: move code to NestCurrentException()
2018-08-20 14:52:54 +02:00
Max Kellermann
9d63c8220b
util/Cast: reverse operands in ContainerAttributeOffset()
...
The result shall be positive.
2018-08-20 14:23:02 +02:00
Max Kellermann
edd9d16c84
util/Cast: move OffsetPointer() to OffsetPointer.hxx
2018-08-20 13:46:18 +02:00
Max Kellermann
ec373eba5d
util/BindMethod: add "noexcept"
2018-08-20 13:45:41 +02:00