Max Kellermann
dfaf08743c
*: check defined(_WIN32) instead of defined(WIN32)
...
Only _WIN32 is defined by the compiler, and WIN32 is not standardized
and may be missing.
Closes #169
2017-12-12 10:22:20 +01:00
Max Kellermann
d9552d8a6d
android/build.py: support NDK r16
2017-12-12 10:01:47 +01:00
Max Kellermann
b177bffa6a
system/EventPipe: fix WSAEINPROGRESS on Windows
...
Apparently, connecting a socket to a loopback address can block on
Windows, and a non-blocking socket will return WSAEINPROGRESS. This
broken PoorSocketPair() in commit 2119e4fd3e
, which made the socket
non-blocking right from the start. This fix postpones the
ioctlsocket(FIONBIO) call until after the connect().
Closes #134
2017-10-24 20:09:11 +02:00
Max Kellermann
a6e62479be
system/Error: include cleanup
2017-09-13 17:49:37 +02:00
Max Kellermann
6c825064ea
system/Error: add more "noexcept"
2017-09-13 17:48:13 +02:00
Max Kellermann
13d02968bd
system/FileDescriptor: Close() should not be called on undefined object
...
It does not do much harm - but it causes an unnecessary (failing)
system call.
2017-09-13 17:43:13 +02:00
Max Kellermann
e576556149
system/UniqueFileDescriptor: remove duplicate "using" statements
2017-09-13 17:41:15 +02:00
Max Kellermann
66e74900df
system/UniqueFileDescriptor: expose CheckDuplicate()
2017-09-13 17:40:33 +02:00
Max Kellermann
aadc735d71
system/FileDescriptor: mention class UniqueFileDescriptor in API documentation
2017-09-13 17:39:29 +02:00
Max Kellermann
a13897cf6f
system/FileDescriptor: add CheckDuplicate()
2017-09-13 17:37:28 +02:00
Max Kellermann
b188ae0e5c
system/FileDescriptor: use _WIN32 instead of WIN32
2017-09-13 17:36:48 +02:00
Ryan Walklin
318f80d113
Fix EventPipe file descriptors
2017-08-17 12:21:01 +10:00
Max Kellermann
b57a272f67
system/EPollFD: throw exception instead of raising fatal error
2017-08-11 09:39:47 +02:00
Max Kellermann
33b4114534
system/fd_util: remove unused library
2017-08-11 09:20:15 +02:00
Max Kellermann
7a4457402f
system/EventPipe: use FileDescriptor::CreatePipeNonBlock()
2017-08-11 09:19:00 +02:00
Max Kellermann
9056dcaf7d
system/FileDescriptor: add method CreatePipeNonBlock()
2017-08-11 09:15:22 +02:00
Max Kellermann
2119e4fd3e
system/EventPipe: use class UniqueSocketDescriptor in PoorSocketPair()
2017-08-11 09:09:04 +02:00
Max Kellermann
bcd5190f1d
system/EventPipe: throw exception instead of raising fatal error
2017-08-11 09:09:04 +02:00
Max Kellermann
d705a92e43
net/IPv4Address: new class
2017-08-11 09:09:04 +02:00
Max Kellermann
699f41e114
system/EventPipe: use AtScopeExit() in PoorSocketPair()
2017-08-11 08:30:37 +02:00
Max Kellermann
7484bc31b4
system/FileDescriptor: implement CreatePipe() on Windows
2017-08-11 08:15:47 +02:00
Max Kellermann
5a495cc165
system/fd_util: remove unused function close_socket()
2017-08-10 19:47:57 +02:00
Max Kellermann
9ff4717738
system/fd_util: remove unused function accept_cloexec_nonblock()
2017-08-10 19:47:40 +02:00
Max Kellermann
0c1740982d
system/fd_util: remove unused function open_cloexec()
2017-08-10 19:46:23 +02:00
Max Kellermann
eb0ff32efb
system/FileDescriptor: add Open() overload with wchar_t path
2017-08-10 19:34:52 +02:00
Max Kellermann
0800d9427c
system/fd_util: remove unused function socket_cloexec_nonblock()
2017-08-10 17:40:14 +02:00
Max Kellermann
fb0dbce15b
system/EventFD: use class UniqueFileDescriptor
2017-08-10 12:14:56 +02:00
Max Kellermann
8333551331
system/SignalFD: use class UniqueFileDescriptor
2017-08-10 12:13:41 +02:00
Max Kellermann
292d794806
system/UniqueFileDescriptor: new auto-closing FileDescriptor wrapper
2017-08-10 12:01:17 +02:00
Max Kellermann
91ce76af9d
system/FileDescriptor: add methods EnableCloseOnExec(), DisableCloseOnExec()
2017-08-10 11:54:26 +02:00
Max Kellermann
33bd9e80bb
system/FileDescriptor: add method IsReadyForWriting()
2017-08-10 11:53:43 +02:00
Max Kellermann
d310f3e9b7
system/FileDescriptor: add method IsValid()
2017-08-10 11:52:22 +02:00
Max Kellermann
8c832f4c50
system/FileDescriptor: use std::exchange()
2017-08-10 09:55:11 +02:00
Max Kellermann
0a379fc514
system/ByteOrder: fix byte order detection on FreeBSD/aarch64
...
Patch from
https://svnweb.freebsd.org/ports/head/audio/musicpd/files/patch-src_system_ByteOrder.hxx?revision=441921&view=co
(with a tiny modification)
Closes #59
2017-05-29 20:37:14 +02:00
Max Kellermann
71f0ed8b74
*: add "noexcept" to many, many function prototypes
...
This eliminates some overhead, because the compiler doesn't need to
consider these functions throwing.
2017-05-08 14:44:49 +02:00
Max Kellermann
6eea56861b
AUTHORS, ...: update my email address
2017-01-17 11:54:55 +01:00
Max Kellermann
5900253b85
update copyright year
2017-01-03 20:48:59 +01:00
Max Kellermann
837134daef
system/Clock: remove obsolete MonotonicClock*() functions
...
We're using std::chrono::steady_clock now. No need to duplicate code.
2016-12-28 22:24:09 +01:00
Max Kellermann
4011899846
system/PeriodClock: use std::chrono::steady_clock
2016-12-28 22:23:45 +01:00
Max Kellermann
e786207cc2
system/PeriodClock: indent with tabs
2016-12-28 01:18:42 +01:00
Max Kellermann
c6e1ca1c22
system/Error: use std::generic_category() for errno on Windows
...
It's wrong to use std::system_category() for both GetLastError() and
errno on Windows. Apparently, everybody uses std::generic_category()
for errno values, which appears to be a safe choice.
Some discussion on this confusing topic can be found here:
https://stackoverflow.com/questions/28746372/system-error-categories-and-standard-system-error-codes
2016-12-04 20:07:11 +01:00
Max Kellermann
30dc473697
system/Error: allow using errno functions on Windows
...
The Windows standard library emulates part of POSIX, which includes
errno.
2016-12-04 20:07:09 +01:00
Max Kellermann
14885f25b4
system/FatalError: remove the obsolete class Error overloads
2016-11-10 12:55:08 +01:00
Max Kellermann
fc7d3f64c0
input/Plugin: migrate open() from class Error to C++ exceptions
2016-09-09 18:15:01 +02:00
Max Kellermann
d0dae177cf
release v0.19.19
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJXvAb+AAoJECNuiljG20USLukP/1dWwG4U3eQllGtwmKYEuGT8
x8bFImW3zziQgzzQNos8ZyB/7Q9wFDwl90q2Shyg778sk8WgBLVdn1hLhDRyodkg
iTAbnuBeX0GoQO2vZ62jY/xtsSMwCguNMbJe5Yybq+uZ2EYLQO8NWsvy/qZzZRB6
9s78IfQodN/vbKg8cJDPP1ZFvlhC+RfrOJbhwkAhh3D0xkpYjumW636ewcpD5Crk
T+OT035konZEcH2hOy89tleFifo+/nosiJQXL5/RdfIVAy+rWj9HbKMT9Wlb2EO0
iqvbjfC8rAt4a15Y8l/C42m1xhLFtRvI7O5I5wH8zqwpgRfCuG21Kw49zWFQ9md/
tX2urKZC6QsvxfHx4J6ot+SFQJB/VZ1fufG1ZBTHVNp7eJ++mWE5pR79EbCLurlj
x7cN1ZM7wsQfkw8MOsKr+sJqIGkU9sZSHHh3PhEkI83fEssYaAOGtkPuTqU0w/37
wHV2laFD58SOagVPbQlhIdK6MnkiTR8RvV9j6ERywLnFNMBMiI9j7ij7zoDMKjSU
E60JzIR4xUPWtQg91BwM5sJdqZw7xybgNBn0rMt+6AoA0CQseAnPRxA9gstrWR1/
FYRPUzrf9brpvXEsT8R2tXcjNLNYgKzT3GxHEQj1k2MJiVe+1SztiYIi77JPLJfn
MevaiCy/Ho3ZeQKygxVq
=GsV+
-----END PGP SIGNATURE-----
Merge tag 'v0.19.19'
release v0.19.19
2016-08-23 10:27:39 +02:00
Thomas Klausner
de0752fd56
system/ByteOrder: gssupport non-x86 NetBSD
2016-08-23 10:15:54 +02:00
Max Kellermann
a61f153df7
system/Error: add missing include
2016-07-02 13:59:47 +02:00
Max Kellermann
1d67aa7bf2
update copyright year to 2016
2016-02-26 17:54:05 +01:00
Max Kellermann
8e0e4d7c04
system/FileDescriptor: add method Skip()
2016-02-19 18:18:12 +01:00
Max Kellermann
08754e6ce7
system/Error: add IsAccessDenied()
2015-12-29 12:56:26 +01:00
Max Kellermann
672e18cac9
system/Error: fix duplicate strerror() call
...
Apparently, the std::system_error constructor appends strerror()
already.
2015-12-27 06:05:53 +01:00
Max Kellermann
fe60c52c70
system/Error: add MakeErrno(), MakeLastError()
2015-12-18 01:08:16 +01:00
Max Kellermann
93f4590453
system/Error: add IsFileNotFound()
2015-12-18 00:54:23 +01:00
Max Kellermann
3092e5a8a5
system/Error: helper library for constructing std::system_error
2015-12-16 00:07:51 +01:00
Max Kellermann
90e7ace980
release v0.19.10
...
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
iQIcBAABCAAGBQJVhsF2AAoJECNuiljG20US2OUQAIyDcaUCFgUa2CYa7MftCPGc
dYJFwf+6Y2fJdSXcogYZmXNKNjFbPAZ4qqGdoNfI5a0rLxMarmL4DyjziAWi3ETB
MOkZK65Y5ySyyw69e+i/XsOwOn8rm6jDuwHKpT7wVJNjvZ8nA8esvu5b1Ief5LBd
UwEmn5DtKjA7dErHEYd2YvMK0xm+YmoKXuhmJKAn3sQdCEldgH4T5BCdOqmfrHWX
BYmNxmP3PU9Tqi7XHTSFZJn6vWiXhOoWr4Cb7K54j49sRV2B4QMWX1CLyK4+Jwmk
NZwD1IoGtoks5twfMTA9F9dBV/CPAWT69E0LIvaFJwCyoPCEnEi6k41bRAWK7P65
QwKxdtY/GZnVFpiqXba+wkD6VBa5wmkjS10+cIBhz3CVCEE+N5YacubUw5JieYg3
kOG2htSF1YP/Mo+IAObO9doQWHnDUavVhhpQ8UyqQ1bDMsmaEpfE16TRmlY/l5wx
Aor2p6D3c0E0IGpEwjOl6T9pDql4dyTdrRLLXJ6oD9iYv2rDdahctBRdyFZ1mRwX
oNUz8bfGDrshHVvwjQTr2b4O+w+yc+RSuJcyCGGcn5LakBuiM6vYNYuZzq3Yj/RK
Wk7RErVsbtY4ZRH06Lf5MSM5TflnrfQmzkUB0rZ0XoDyweoHOHPyzKhvBaKhadNh
UnEx4kCOvWdjFXUVWH3Q
=MrVf
-----END PGP SIGNATURE-----
Merge tag 'v0.19.10'
2015-06-21 16:06:02 +02:00
Max Kellermann
980187f856
system/PeriodClock: make IsDefined() "constexpr"
2015-06-20 15:33:17 +02:00
Max Kellermann
077e95da85
system/FileDescriptor: add method Tell()
2015-03-24 21:59:34 +01:00
Max Kellermann
dd4beea44c
system/FileDescriptor: Close() returns bool
2015-03-03 23:04:25 +01:00
Max Kellermann
5b48d59769
system/FileDescriptor: add "mode" parameter to Open()
2015-03-03 22:29:09 +01:00
Max Kellermann
4dec12fcfc
system/FileDescriptor: move O_NOCTTY|O_CLOEXEC to Open()
2015-03-03 22:20:51 +01:00
Max Kellermann
f677f42be7
system/FileDescriptor: remove bogus assertions
2015-03-03 21:48:45 +01:00
Max Kellermann
cd776ff1a8
system/FileDescriptor: fix WIN32 checks
2015-03-03 19:44:32 +01:00
Max Kellermann
40a587bbaf
system/FileDescriptor: new wrapper class for a file descriptor
2015-03-03 17:14:30 +01:00
Max Kellermann
818d729d8b
system/fd_util: remove unused functions
2015-03-03 17:07:52 +01:00
Max Kellermann
821bc6d777
system/ByteOrder: use GCC built-ins if available
2015-02-12 11:05:02 +01:00
Max Kellermann
42890b9acf
system/{Resolver,Socket{Error,Util}}: move to new library libnet.a
2015-02-10 22:06:06 +01:00
Max Kellermann
557bee61d5
Merge branch 'v0.19.x'
2015-01-29 22:55:18 +01:00
PHO
39abd3ecb4
Avoid integer overflow in MonotonicClock{S,MS,US}
...
This is Darwin specific: the previous implementation was causing an integer
overflow when base.numer is very large. On PPC Darwin, the timebase info is 1000000000/33330116 and this is too large for integer arithmetic.
2015-01-29 08:34:37 +01:00
Max Kellermann
712ed555e6
Copyright year 2015
2015-01-01 19:48:13 +01:00
Max Kellermann
08bf4f74a9
system/FatalError: add FatalSystemError() overload with WIN32 error code
2014-12-05 00:19:07 +01:00
Max Kellermann
a838a03412
system/FatalError: use FormatMessage() instead of g_win32_error_message()
2014-12-05 00:15:30 +01:00
Max Kellermann
b3f5b4932c
configure.ac: add macro MPD_ENABLE_AUTO_PKG
...
Simplify the definition of many build options.
2014-11-21 22:19:57 +01:00
Max Kellermann
77f2cd6513
Merge branch 'v0.18.x'
2014-08-24 13:15:17 +02:00
Thomas Klausner
c38f29ce56
system/ByteOrder: <endian.h> is a non-standard header that only Linux provides.
2014-08-23 14:27:44 +02:00
Max Kellermann
664fc76ac7
system/Resolver: use nullptr instead of NULL
2014-07-30 18:44:40 +02:00
Max Kellermann
f68d2f7c7f
system/fd_util: export fd_set_cloexec()
2014-03-15 20:03:31 +01:00
Max Kellermann
7d353bbe2a
configure.ac: always define _GNU_SOURCE on Linux
...
Make sure glibc gives us all features.
2014-03-15 18:27:09 +01:00
Max Kellermann
e8789d7cb9
system/FatalError: remove GError support
2014-02-18 23:05:40 +01:00
Max Kellermann
6eda79d02d
system/EPollFD: add epoll_create1() fallback for Android
2014-02-18 09:54:35 +01:00
Max Kellermann
4f83c60296
copyright year 2014
2014-01-13 22:31:55 +01:00
Max Kellermann
d5dfe7d457
configure.ac: add option "--disable-glib"
...
Allows building without GLib. This fails to compile currently,
because GLib is still used in the MPD core.
2013-12-15 18:43:12 +01:00
Max Kellermann
635d6a19ef
util/Tokenizer, ...: include cleanup
2013-12-15 18:33:26 +01:00
Max Kellermann
777844ae0c
system/SocketError, ...: use strerror() instead of g_strerror()
...
Avoid GLib.
2013-12-15 18:32:07 +01:00
Max Kellermann
0c53e8c2d0
system/Resolver: use std::string to allocate internal buffer
...
No GLib memory allocation.
2013-12-04 14:27:28 +01:00
Max Kellermann
e1901e97c2
system/Resolver: sockaddr_to_string() returns std::string()
...
No GLib memory allocation.
2013-12-04 08:43:55 +01:00
Denis Krjuchkov
65b24ce557
Clock.cxx: provide all arguments for GetProcessTimes
...
All parameters seem mandatory, otherwise this call makes MPD crash.
2013-11-29 15:21:31 +06:00
Max Kellermann
f90abe9530
include cleanup using iwyu
2013-11-28 11:50:54 +01:00
Max Kellermann
51de8fd10a
Volume, Output: use new class PeriodClock instead of GTimer
2013-11-25 22:09:46 +01:00
Max Kellermann
529b4bd185
Stats: use monotonic clock instead of GTimer
...
Reduce GLib usage.
2013-11-24 21:14:38 +01:00
Max Kellermann
85b51e4e77
Stats: use GetProcessTimes() on WIN32 to determine MPD uptime
...
Don't use GTimer if the operating system is able to tell us the
uptime.
2013-11-24 20:41:00 +01:00
Florian Schlichting
51ec499c89
system/ByteOrder: testing for endianness in a more general way
...
Fixes build tests on ia64 and mipsel by testing for endianness in a
more general / portable way.
2013-11-21 23:04:49 +01:00
Max Kellermann
3a4df25db2
util/ByteOrder: add comments
2013-11-21 23:04:31 +01:00
Max Kellermann
37cf78ef45
util/ByteOrder: indent the preprocessor directives
...
Improve readability.
2013-11-21 23:03:28 +01:00
Denis Krjuchkov
740d8ec5ab
system/fd_util.h: avoid symbol conflict with statically linked libmpdclient
2013-11-18 16:35:22 +06:00
Max Kellermann
ed436c6f0c
system/ByteOrder: fix big-endian support
...
D'oh!
2013-11-05 22:08:53 +01:00
Natanael Copa
3f21581a81
add various missing headers
...
Fixes building with gcc-4.8
Signed-off-by: Natanael Copa <ncopa@alpinelinux.org>
2013-11-05 11:08:36 +01:00
Max Kellermann
7adfea8ca2
system/resolver: return path of UNIX domain sockets
...
getnameinfo() doesn't work well - it always returns "localhost".
2013-11-04 19:13:05 +01:00
Max Kellermann
8c834a4ff6
system/FatalError: use _exit() instead of exit()
...
Skip the global destructors. We don't need them here - we bail out as
quickly as we can.
2013-10-30 23:42:16 +01:00
Max Kellermann
8c01004219
system/FatalError: move code to Abort()
2013-10-30 23:41:02 +01:00
Max Kellermann
163848ab3b
fd_util: avoid unnecessary fcntl() calls
2013-10-29 13:02:53 +01:00
Max Kellermann
8118bc93a8
FatalError: remove unused GError overload
2013-10-20 13:10:09 +02:00
Max Kellermann
5e26e2ab1d
system/ByteOrder: new library for byte ordering / endianess
...
Replacing GLib macros.
2013-10-16 22:09:44 +02:00
Max Kellermann
0c13703da3
system/clock: convert to C++
2013-10-15 09:38:12 +02:00
Max Kellermann
be2951b45f
gcc.h: rename to Compiler.h
2013-10-15 09:21:59 +02:00
Max Kellermann
e4e80ff0cb
*: use WIN32 instead of G_OS_WIN32
2013-10-15 08:33:44 +02:00
Max Kellermann
060814daa8
Log: new logging library API
...
Prepare to migrate away from GLib. Currently, we're still using GLib
as a backend.
2013-10-02 08:57:55 +02:00
Max Kellermann
7a4c9f5f4c
mpd_error.h: remove obsolete header
...
Migrate the remaining callers to FatalError().
2013-09-05 18:26:46 +02:00
Max Kellermann
fccba1af2a
use standard snprintf() instead of GLib g_snprintf()
2013-09-05 09:21:53 +02:00
Max Kellermann
ee9e238179
system/SocketError: un-inline constructor
...
Reduces header dependencies.
2013-09-04 23:36:30 +02:00
Max Kellermann
29030b54c9
util/Error: new error passing library
...
Replaces GLib's GError.
2013-09-04 18:14:22 +02:00
Max Kellermann
c9fcc7f148
system/resolver: convert to C++
2013-09-04 18:02:09 +02:00
Max Kellermann
81175b0717
system/EPollFD: fix typo in Add()
2013-08-10 11:52:31 +02:00
Max Kellermann
dff05c71e6
event/EPollFD: basic support for Linux epoll
2013-08-07 19:44:43 +02:00
Max Kellermann
f2ce8c3b62
event/EventFD: move to libsystem
2013-08-07 11:52:26 +02:00
Max Kellermann
4223657ab8
event/SignalMonitor: use signalfd() if available
2013-08-07 11:03:47 +02:00
Max Kellermann
b70d38dc10
Makefile.am: move sources to libsystem.a
2013-08-07 10:31:31 +02:00