Commit Graph

189 Commits

Author SHA1 Message Date
Max Kellermann 6f539cfcd6 Partition, ...: use libfmt for logging 2021-06-24 21:40:11 +02:00
Max Kellermann 0185d58a2b Log: add libfmt support 2021-06-24 21:14:42 +02:00
Max Kellermann 96707c0426 Merge tag 'v0.22.7'
release v0.22.7
2021-05-19 18:43:19 +02:00
Max Kellermann a169a05e41 win32, ...: avoid including windows.h
Include the most specific header documented by MSDN instead.
2021-05-19 17:25:32 +02:00
Max Kellermann 6cdb3ff21e use [[gnu::pure]] instead of gcc_pure
This is semi-standard and doesn't require the util/Compiler.h header.
2021-02-12 18:34:16 +01:00
Max Kellermann 51f110a990 system/EventPipe: use class Unique{Socket,File}Descriptor 2021-01-11 17:51:22 +01:00
Max Kellermann 17eae74c1c system/EventFD: Get() returns FileDescriptor 2021-01-11 17:38:30 +01:00
Max Kellermann 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Max Kellermann 155fc8fa5a include cleanup 2020-07-23 16:26:18 +02:00
Max Kellermann 8c1d78873d system/KernelVersion: new library 2020-05-05 14:30:56 +02:00
Max Kellermann 9815d10137 system/FileDescriptor: move to io/ 2020-05-05 14:27:03 +02:00
Rosen Penev 3540cf26b1 replace exit and _exit with std variants
_exit and std::_Exit are identical, expect the latter is standard C++.

Added several functions to the std namespace as a result of headers.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-26 18:44:09 -07:00
Rosen Penev 97425d56e7 remove gcc_unused
[[maybe_unused]] (introduced in C++17) is standard C++.

https://clang.llvm.org/docs/AttributeReference.html#maybe-unused-unused
says that this is equivalent to the GNU unused attribute.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:21 -07:00
Rosen Penev 591f51f3d3 replace noreturn attribute with standard C++ version
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-16 00:08:18 -07:00
Rosen Penev a2f5a63bbc replace stdint.h with cstdint
The former is deprecated by C++14. The standard says they are the same:

The header defines all types and macros the same as the C standard library
header<stdint.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:39 -07:00
Rosen Penev c846ee0d1b replace stdarg.h with cstdarg
The former was deprecated in C++14. The Standard says they are the same:

The contents of the header<cstdarg>are the same as the C standard library
header<stdarg.h>, with the following changes: The restrictions that ISO C
places on the second parameter to the va_start macro in header<stdarg.h>
are different in this International Standard. The parameter parmN is the
rightmost parameter in the variable parameter list of the function
definition (the one just before the...).219If the parameter parmN is a
pack expansion (17.5.3) or an entity resulting from a lambda capture
(8.1.5), the program is ill-formed, no diagnostic required. If the
parameter parmN is of a reference type, or of a type that is not
compatible with the type that results when passing an argument for which
there is no parameter, the behavior is undefined.

Also changed va_list to the std:: namespace version, which is the same.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:03:12 -07:00
Rosen Penev 69a51e12c9 replace signal.h with csignal.h
The former was deprecated with C++14. The standard says they are the same:

The contents of the header<csignal>are the same as the C standard library
header<signal.h>.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 18:56:51 -07:00
Rosen Penev edc4989d9c change errno.h to cerrno
The former is deprecated by C++14. It's also functionally the same.

From the standard:

19.4
The header<cerrno>is described in Table 43. Its contents are the same as
the POSIX header<errno.h>,except that errno shall be defined as a macro.
[Note: The intent is to remain in close alignment with the POSIX
standard.] A separate errno value shall be provided for each thread.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:51:16 -07:00
Rosen Penev ab9f5d2067 replace assert.h with cassert
The former was deprecated with C++14.

According to the C++11 and C++17 standards, both files are identical.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 15:25:38 -07:00
Max Kellermann 72ec641f0d *: use auto 2020-02-01 14:02:43 +01:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann a72878c5b9 io/FileDescriptor: add method FullRead() 2019-12-17 20:21:11 +01:00
Max Kellermann 683d5848f4 Merge tag 'v0.21.17'
release v0.21.17
2019-12-16 23:44:20 +01:00
Max Kellermann ce093be12c system/Error: add FormatFileNotFound() 2019-12-04 12:33:38 +01:00
Max Kellermann 2c276770f0 util/PrintException, ...: update copyright 2019-12-04 12:33:36 +01:00
Max Kellermann 75a592f629 system/Error: move code to IsErrno() 2019-12-04 12:33:33 +01:00
Max Kellermann a478af6759 util/PrintException, ...: update copyright 2019-08-19 19:11:59 +02:00
Max Kellermann 4c2434788f system/FileDescriptor: add method IsRegularFile() 2019-08-19 19:11:53 +02:00
Max Kellermann b94de51ac4 system/Error: move code to IsErrno() 2019-07-12 17:11:14 +02:00
Max Kellermann d663f81420 include cleanups (powered by iwyu) 2019-07-05 09:59:58 +02:00
Max Kellermann a139279575 Copyright year 2019 2019-06-17 11:17:30 +02:00
Max Kellermann e0d5d88104 Log: make LogLevel the first parameter
Prepare for templated functions.
2019-05-23 12:17:59 +02:00
Max Kellermann 5641c4baa6 system/Clock, fs/FileInfo: move FILETIME specific code to time/FileTime.hxx 2019-05-08 16:02:13 +02:00
Max Kellermann 96f889276f system/Clock: GetProcessUptimeS() returns std::chrono::duration 2019-05-08 15:58:01 +02:00
Max Kellermann c176d94598 system/ByteOrder: move to util/ 2019-03-08 10:21:10 +01:00
Max Kellermann 38f0c16904 system/UniqueFileDescriptor: add CreatePipeNonBlock() 2019-02-27 23:30:56 +01:00
Max Kellermann da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann 56bded07b1 system/UniqueFileDescriptor: import std::swap 2019-02-19 12:36:54 +01:00
Max Kellermann db144a43ad system/Open: add OpenWriteOnly(), OpenDirectory() 2019-02-19 12:16:41 +01:00
Max Kellermann 5965f62b56 system/EpollFD: include cleanup 2019-02-19 11:51:52 +01:00
HyShai 18c042d4cf remove non-block call
This is similar to https://github.com/MusicPlayerDaemon/MPD/commit/b177bffa6a5f1b69639b6cd759dcb16fdd76e5e2, in that it fixes the Windows issue of connecting to the open socket. Also, the listen_socket is set to AcceptNonBlock after the connection anyways.
2018-12-18 15:23:40 -05: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 bba22c9c8c system/FileDescriptor: check __linux__ instead of __linux
`__linux` is the deprecated non-standard macros which appears to be
not present at all on PowerPC.

Closes #398
2018-11-02 16:50:38 +01:00
Max Kellermann f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +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 fe2f7a3e5a configure.ac: add automake conditional "LINUX" 2018-08-22 16:09:40 +02:00
Max Kellermann 98eed1f5ab system/EpollFD: use class UniqueFileDescriptor 2018-08-22 16:09:40 +02:00
Max Kellermann 5d0a463f09 system/{Epoll,Event,Signal}FD: relicense to BSD-2 2018-08-22 15:40:45 +02:00
Max Kellermann dd461400fb system/EPollFD: rename to EpollFD 2018-08-22 15:40:45 +02:00
Max Kellermann b1390ec27f system/UniqueFileDescriptor: make the "int" constructor public 2018-08-22 15:40:45 +02:00