Commit Graph

182 Commits

Author SHA1 Message Date
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 release v0.21.17
-----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCgAuFiEEA5IzWngIOJSkMBxDI26KWMbbRRIFAl34Bg0QHG1heEBtdXNp
 Y3BkLm9yZwAKCRAjbopYxttFEmOvD/4/gBb1kIOQduz+ZV79LHPGeqDoIJBm8VWg
 t9R1Mpt0flqC8+RcXFK/P0kUifBO5fu+a1DbHHijUvDNLYpUsCiXyxTpES9gGh54
 7djEeqi1suoLpMUt4zkUEHGTp2dGUTmyewE1TuF1sZi2xlPgOeWXEX7a0xWs4zdG
 WI4CojUSkQGVAI2XZ7xIKP1v368B9F6AbqTK4zkzjNbTCv5VfESGlxdde0NXqU2e
 /bjil1aT2kdcks3ddeT4llyGIUzn1PzOyA6LQvmVXLSAtz9Rr/hHA+qkR19a4CCt
 PXxE0xClhhmZglzPuES0sRqBbwG99dPzA1ajTOtielwMrlFx+OceRfUnfdgqpPqd
 HTkEzMGsQ2PMMbE8R9DF5GU8B9xAcnKMh2g3/9KGStbocGSFWahLRObkHEhC5uJu
 g5ncQio3o/AtlBirywn/lkd6CYRDvMheMVOTHtv4/ZN0hIONMXCb6u1SQfqnX7qb
 fRP2UP9VUpPI9MUfOn/0uqM8/zXb5SMRe78p9UIYCF+mEDST190VxsdMjiBp/Xug
 Pktlec72iyiNHCavp04nXkt2kBrfSIFFaAQ0Qlp4huRV1k3Ur672NHtwuPLv8ORH
 xLec8On6nWVuuu5kC0F+4KxTlu6u2CMwH+wVr7t/D4rrD1iVo39MtElTBawZZC6+
 8EapnNHyGg==
 =A+Dp
 -----END PGP SIGNATURE-----

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 b177bffa6a, 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
Max Kellermann
d092a88a93 system/Open: new UniqueFileDescriptor constructing library 2018-08-21 18:27:39 +02:00
Max Kellermann
d036e20826 system/FileDescriptor: add openat() wrapper 2018-08-21 18:15:37 +02:00
Max Kellermann
4f2163e76c system/FileDescriptor: include cleanup 2018-08-20 17:25:42 +02:00
Max Kellermann
eef66dee04 system/FileDescriptor: pass FileDescriptor to CheckDuplicate() 2018-08-20 17:23:14 +02:00
Max Kellermann
7ad440ca1c net/SocketDescriptor: make eventfd() and signalfd() mandatory on Linux 2018-08-20 17:16:07 +02:00
Max Kellermann
13b3e9e7b3 system/FileDescriptor: make inotify_init1() mandatory on Linux 2018-08-20 17:12:50 +02:00
Max Kellermann
8106929d60 system/FileDescriptor: add pipe2() wrapper 2018-08-20 17:05:29 +02:00