Commit Graph

58 Commits

Author SHA1 Message Date
Max Kellermann fe5d0ce827 Merge branch 'v0.20.x' 2018-01-20 00:04:35 +01:00
Max Kellermann 38d56dddf1 lib/icu/Compare: allow copying 2018-01-19 23:49:50 +01:00
Max Kellermann 914df18bf9 Main, ...: catch any exception, not just std::runtime_error 2017-12-19 10:56:23 +01: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 828f5f8384 lib/icu/CaseFold: disable broken strxfrm() callback 2017-09-20 23:55:14 +02:00
Max Kellermann 1295a1272a lib/icu/Compare: add fallback using strcasecmp() and strcasestr()
Our IcuCaseFold() fallback using strxfrm() is not actually case
insensitive.  This commit fixes the problem by switching to
strcasecmp().  That function is not guaranteed to support UTF-8, but
it's the best we can do in this sparse situation.

Closes #111
2017-09-20 23:43:27 +02:00
Max Kellermann d0497dba92 lib/icu/Compare: OO wrapper for IcuCaseFold() 2017-09-20 23:32:55 +02:00
Max Kellermann 42914e8227 lib/icu/CaseFold: add "noexcept" 2017-09-20 23:32:54 +02:00
Max Kellermann 5620f16330 lib/icu/Collate: move IcuCaseFold() to CaseFold.cxx 2017-09-20 23:11:58 +02:00
Max Kellermann be024d4ad7 lib/icu/Collate: remove unnecessary assert() 2017-09-20 23:05:31 +02: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 2e182e84c3 thread/Mutex: remove ScopeLock, use std::lock_guard directly 2017-01-03 07:11:57 +01:00
Max Kellermann 22dcca9832 util/Error: remove obsolete class 2016-11-10 12:58:26 +01:00
Max Kellermann 6d409d27ca lib/icu: migrate from class Error to C++ exceptions 2016-11-02 09:54:13 +01:00
Max Kellermann bec6fa4ad7 lib/icu/Converter: throw exception on error 2016-04-21 14:03:27 +02:00
Max Kellermann 21f17270a1 lib/icu/Util: UCharFromUTF8() throws on error 2016-04-21 11:20:41 +02:00
Max Kellermann 423cd5900e lib/icu/Util: fold UCharToUTF8Throw() into UCharToUTF8() 2016-04-21 10:58:21 +02:00
Max Kellermann b9f535cd49 lib/icu/Win32: throw exception on error 2016-04-21 10:15:40 +02:00
Max Kellermann 225984822d lib/icu/Win32: use std::unique_ptr 2016-04-13 11:53:35 +02:00
Max Kellermann 01b68db30e lib/icu/Converter: Create() throws exception on error 2016-04-13 10:04:19 +02:00
Max Kellermann 4eaa82fd22 lib/icu/Util: add overload which throws exception 2016-04-12 22:08:48 +02:00
Max Kellermann a497cc46f9 lib/icu/Util: use std::unique_ptr 2016-04-12 22:07:23 +02:00
Max Kellermann 178f737971 lib/icu/Collate: use std::unique_ptr 2016-04-12 21:55:14 +02:00
Max Kellermann 74963bce9d lib/icu/Collate: use class AllocatedArray 2016-04-12 21:55:14 +02:00
Max Kellermann 33a4dbe1e5 lib/icu/Util: use class AllocatedArray 2016-04-12 21:42:14 +02:00
Max Kellermann dce36d3e55 lib/icu/Util: remove obsolete documentation 2016-04-12 21:32:56 +02:00
Max Kellermann 1aee89f5ea *: include cleanup (using iwyu) 2016-03-01 22:08:13 +01:00
Max Kellermann 1d67aa7bf2 update copyright year to 2016 2016-02-26 17:54:05 +01:00
Max Kellermann 6f7bfa71a9 lib/icu/Collate: remove GLib implementation
There is not much use in GLib: on Windows, we have a native API for
string collation, and the rest uses either libicu or the standard C
library calls.
2015-06-27 16:05:54 +02:00
Max Kellermann fb3564fbe7 lib/icu/Collate: use LCMapStringEx() on Windows 2015-06-27 15:52:37 +02: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 a03be5a8a6 lib/icu/Converter: add missing <> 2015-06-26 16:49:25 +02:00
Max Kellermann 8d11577ff2 lib/icu/{Converter,Collate}: return AllocatedString 2015-06-25 23:44:16 +02:00
Max Kellermann c7712e2ef0 lib/icu/Collate: fall back to strxfrm() 2015-06-25 23:01:29 +02:00
Max Kellermann 61fa770644 lib/icu/Collate: fix indent 2015-06-25 22:55:57 +02:00
Max Kellermann 334bd73792 lib/icu/Collate: fall back to strcoll() instead of strcasecmp() 2015-06-23 13:26:45 +02:00
Max Kellermann 090ce262c4 lib/icu/Collate: use CompareStringEx() on Windows 2015-06-23 13:20:41 +02:00
Max Kellermann aecfcaa8a2 lib/icu/Win32: wrappers for WideCharToMultiByte(), MultiByteToWideChar() 2015-06-23 13:20:11 +02:00
Max Kellermann 712ed555e6 Copyright year 2015 2015-01-01 19:48:13 +01:00
Max Kellermann 412bedb697 Merge branch 'v0.19.x' 2014-12-26 14:40:32 +01:00
Max Kellermann 95f84afd33 fs/Traits, ...: work around -Wtautological-pointer-compare
New in clang 3.6.
2014-12-26 14:34:03 +01:00
Max Kellermann bc00c38f9d lib/icu/Converter: add ICU-based backend 2014-12-01 21:56:48 +01:00
Max Kellermann 0f35016773 lib/icu/Converter: add TODO comment 2014-11-30 19:08:38 +01:00
Max Kellermann c641ca90a9 lib/icu/Collate: move code to Util.cxx 2014-11-30 10:53:05 +01:00
Max Kellermann 87c88fcb27 fs/Charset: move code to wrapper class IcuConverter
Prepare for a ICU-based backend without GLib.
2014-11-30 00:31:13 +01:00
François Revol e2e5cddcaa icu: include strings.h for strcasecmp
Again, POSIX says strcasecmp is not in string.h.
2014-08-16 07:53:08 +02:00
Max Kellermann 1d324176d1 lib/icu/Init: call u_init() and u_cleanup()
Make valgrind happy.
2014-06-10 23:21:09 +02:00