Commit Graph

26 Commits

Author SHA1 Message Date
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 ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
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 788e3b31e1 *: remove "pure" and "const" attributes from throwing functions
The "pure" and "const" attributes are not so well-defined, and a
recent clang version implements an optimization which pushes the
definition's boundary beyond what I believed it was.  clang now
assumes that functions declared "pure" cannot throw exceptions, even
if they lack the "noexcept" specification.

When compiled with this new clang version, MPD will crash randomly if
an exception happens to get thrown by such as "pure" function
(https://github.com/MusicPlayerDaemon/MPD/issues/41).

This commit removes all such misplaced "pure" and "const" attributes,
closing #41.
2017-05-08 17:25:06 +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 5900253b85 update copyright year 2017-01-03 20:48:59 +01:00
Max Kellermann 22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann 6513ff92a7 fs/Charset: throw exception on error 2016-04-21 14:23:55 +02:00
Max Kellermann 01b68db30e lib/icu/Converter: Create() throws exception on error 2016-04-13 10:04:19 +02:00
Max Kellermann 9b85446808 util/StringPointer: rename typedef pointer to pointer_type 2016-04-12 22:53:06 +02:00
Max Kellermann 1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann 3fa4dad418 lib/icu/Converter: remove GLib implementation
We don't need this anymore: Win32 doesn't use this library at all, and
everything else has either iconv() or libicu.
2015-06-26 16:51:18 +02:00
Max Kellermann 0756607e32 lib/icu/Converter: add iconv() implementation 2015-06-26 16:49:25 +02:00
Max Kellermann 73bd6af0f9 fs/Charset: hard-code Windows to ACP
Don't define HAVE_FS_CHARSET, and make GetFSCharset() return "ACP"
instead of "UTF-8".  Ignore the configuration setting, which had no
effect anyway.
2015-06-22 22:20:10 +02:00
Max Kellermann eb174d5ba3 fs/{Allocated,}Path,Charset: use PathTraitsFS typedefs 2015-02-25 19:17:45 +01:00
Max Kellermann 712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann bc00c38f9d lib/icu/Converter: add ICU-based backend 2014-12-01 21:56:48 +01:00
Max Kellermann 4f80a129f1 fs/Charset: return std::string from PathFromUTF8()
Don't expose pointer that requires the caller to invoke g_free(),
because that's GLib-only.
2014-11-30 00:28:27 +01:00
Max Kellermann 563db580ae fs/Charset: add DeinitFSCharset() 2014-11-29 23:47:48 +01:00
Max Kellermann 125daea16a fs/Charset: add macro HAVE_FS_CHARSET 2014-11-29 23:36:44 +01:00
Max Kellermann fd2c6b8a4b fs/Charset: return Error on SetFSCharset() failure
Don't abort the process, let the caller decide instead.
2014-11-29 23:36:44 +01:00
Max Kellermann 4f83c60296 copyright year 2014 2014-01-13 22:31:55 +01:00
Max Kellermann 7fec2b02d4 fs/Charset: GetFSCharset() returns "utf-8" by default
If fs_charset is empty, i.e. we're using the default "utf-8",
GetFSCharset() should return exactly that instead of an empty
std::string.
2013-10-17 22:47:09 +02:00
Max Kellermann f951e5356b fs/Charset: don't allow nullptr arguments 2013-10-17 22:39:06 +02:00
Max Kellermann 080ee87e07 fs/Path: move configuration code to Config.cxx 2013-10-17 22:29:03 +02:00