Commit Graph

120 Commits

Author SHA1 Message Date
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 5348f8c9c8 copyright year 2021 2021-01-01 19:54:28 +01:00
Max Kellermann 9815d10137 system/FileDescriptor: move to io/ 2020-05-05 14:27:03 +02:00
Max Kellermann 12b97bbe38 Merge tag 'v0.21.22'
release v0.21.22
2020-04-02 18:02:10 +02:00
Max Kellermann afe2aaa5f6 fs/io/GzipOutputStream: increase buffer size to 16 kB
Reduce I/O overhead.
2020-04-02 17:17:58 +02:00
Max Kellermann 9b11caa0e6 fs/io/BufferedReader: larger default buffer (4 kB -> 16 kB)
Reduce I/O overhead.
2020-04-02 17:17:27 +02:00
Max Kellermann 9c3e1d450a fs/io/GunzipReader: increase buffer size to 64 kB
Reduces I/O overhead while reading a compressed database file.
2020-03-31 15:07:39 +02:00
Rosen Penev ba3ff10ccd remove false ifdef
The entire section falls under the else path of #ifdef _WIN32. Checking
for it makes no sense. Probably some refactoring mistake.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-20 17:56:33 -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 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 2db8bcc353 replace stddef.h with cstddef
The former is deprecated with C++14. The standard says both are the same:

The contents and meaning of the header<cstddef>are the same as the C
standard library header<stddef.h>,except that it does not declare the type
wchar_t, that it also declares the type byte and its associated
operations (21.2.5), and as noted in 21.2.3 and 21.2.4.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-03-12 19:04:38 -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 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
Rosen Penev b64fdae938 [clang-tidy] use override instead of virtual
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2020-01-31 21:27:26 -08:00
Max Kellermann 2817bf9e95 copyright year 2020 2020-01-18 19:23:49 +01:00
Max Kellermann b449627265 fs/io/Reader: relicense to BSD-2 2019-12-16 17:13:55 +01: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 afdaaba045 fs/io/BufferedOutputStream: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann 1cfc0cb874 fs/io/AutoGunzipReader: use std::unique_ptr<> 2019-04-26 14:55:00 +02:00
Max Kellermann 3882c97545 fs/io/AutoGunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann bf9f690c70 fs/io/GunzipReader: add noexcept 2019-04-26 14:55:00 +02:00
Max Kellermann 392b783c9e fs/io/TextFile: add noexcept 2019-04-26 14:44:27 +02:00
Max Kellermann 6d86902a02 fs/io/TextFile: use std::unique_ptr<> 2019-04-26 14:42:54 +02:00
Max Kellermann da4bb4c298 fs/io/OutputStream: update include guard 2019-02-19 12:39:29 +01:00
Max Kellermann 5b8ff61799 fs/io/BufferedOutputStream: add WithBufferedOutputStream() 2019-02-19 12:37:53 +01:00
Max Kellermann cfe22502ab fs/io/StdioOutputStream: add noexcept 2019-01-22 09:03:49 +01:00
Max Kellermann cf23fd8774 fs/io/FileOutputStream: add constructor with directory fd 2019-01-21 21:10:02 +01:00
Max Kellermann dee8872395 fs/io/FileOutputStream: move code to Open() 2019-01-21 21:09:34 +01: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 f5c9071494 *: copyright year 2018 2018-10-31 17:54:59 +01:00
Max Kellermann 2148d4bb31 fs/io/FileOutputStream: fix -Wcomment 2018-10-31 17:18:44 +01:00
Max Kellermann e79d06d595 fs/io/FileOutputStream: don't use O_TMPFILE on Android
Fixes writing to Context.getCacheDir().
2018-10-31 17:12:21 +01:00
Max Kellermann c60cf944f5 fs/io/FileOutputStream: add macro HAVE_O_TMPFILE 2018-10-31 17:10:52 +01:00
Max Kellermann 19d9ce260a fs/io/FileOutputStream: disallow copying 2018-09-03 14:36:01 +02:00
Max Kellermann 0642ce4795 fs/io/FileOutputStream: make linkat() mandatory on Linux 2018-08-21 19:02:03 +02:00
Max Kellermann d11e1d5880 fs/io/FileOutputStream: add "noexcept" 2018-08-21 18:56:14 +02:00
Max Kellermann b143477774 fs/io/BufferedReader: add "noexcept" to constructor 2018-08-21 18:52:57 +02:00
Max Kellermann d092a88a93 system/Open: new UniqueFileDescriptor constructing library 2018-08-21 18:27:39 +02:00
Max Kellermann ab7597b089 fs/io/FileReader: use class UniqueFileDescriptor 2018-08-21 18:26:36 +02:00
Max Kellermann 84df470008 fs/io/FileReader: use std::exchange() 2018-08-21 18:26:34 +02:00
Max Kellermann 5ca0b7a28f fs/io/FileReader: add "noexcept" 2018-08-21 18:26:09 +02:00
Max Kellermann 21d621e7ad fs/io/FileReader: simplify includes 2018-08-21 18:26:09 +02:00
Max Kellermann ec54754e22 Compiler.h: move to util/ 2018-08-20 16:19:17 +02:00
Max Kellermann b98263e86f fs/io/OutputStream: relicense under BSD-2 2018-07-19 14:02:37 +02:00
Max Kellermann 97f670658f util/StringFormat: new utility library 2018-01-24 13:28:28 +01:00
Max Kellermann 6246d36fe6 Merge branch 'v0.20.x' 2017-12-16 20:56:06 +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