Skip to content

Commit d0fde6f

Browse files
committed
v0.2.0
1 parent 4d4d0fd commit d0fde6f

6 files changed

Lines changed: 81 additions & 81 deletions

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ project(c4core
66
include(./cmake/c4Project.cmake)
77
include(./compat.cmake)
88

9-
c4_project(VERSION 0.1.11
9+
c4_project(VERSION 0.2.0
1010
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
1111

1212
option(C4CORE_INSTALL "create install target" ON)

changelog/0.2.0.md

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
### Breaking changes
2+
3+
- [PR#111](https://github.com/biojppm/c4core/pull/111) - Rename formatting overloads accepting `c4::append`:
4+
- `catrs(append_t, ...) -> catrs_append(...)`
5+
- `catseprs(append_t, ...) -> catseprs_append(...)`
6+
- `formatrs(append_t, ...) -> formatrs_append(...)`
7+
- [#PR101](https://github.com/biojppm/c4core/pulls/101): As part of the `substr` ctor cleanup, the `to_substr(char (&arr)[N])` overload no longer decays to `char*` inside. This changes calling code by now returning a `substr` with length equal to `N-1` instead of `strlen(arr)` as before:
8+
```c++
9+
// longer than "foo", ie longer than {'f', 'o', 'o', '\0'}:
10+
char arr[] = "foo\0\0\0\0\0\0";
11+
assert(strlen(arr) == 3);
12+
assert(sizeof(arr) == 9);
13+
14+
// previously:
15+
assert(to_substr(arr).len == 3);
16+
// now:
17+
assert(to_substr(arr).len == 9);
18+
19+
// the breaking change happens only with arrays:
20+
assert(to_substr((char*)ptr).len == 3); // as before
21+
```
22+
23+
### New features
24+
25+
- [#PR101](https://github.com/biojppm/c4core/pulls/101): For `substr` and `csubstr`:
26+
- add simultaneous ctors from `char[]` and `char*`. Using SFINAE to narrow the `char*` overload prevents it from overriding the `char[]` overload. Thanks to @huangqinjin for the idea (see [#97](https://github.com/biojppm/c4core/issues/97)).
27+
- remove unneeded constructors of `csubstr` from non-const chars.
28+
- to each single-argument ctor, add corresponding functions `to_csubstr()` and `to_substr()` to enable clients coercing their types in generic code such as `c4::cat()` and `c4::format()`.
29+
- Add interop with `std::string_view` when the standard is at least C++17 ([#PR101](https://github.com/biojppm/c4core/pulls/101)):
30+
- provided in the header [`c4/std/string_view.hpp`](src/c4/std/string_view.hpp)
31+
- similarly to existing interop headers, this is opt-in and requires explicit inclusion
32+
- implemented:
33+
- `to_csubstr()` (since `std::string_view` is not writeable, cannot provide `to_csubstr()`)
34+
- `to_chars()` (since `std::string_view` is not writeable, cannot provide `from_chars()`)
35+
- comparison operators
36+
- `substr`: split `.first_not_of()` and `.last_not_of()` into different overloads, removing the defaulted `start` parameter:
37+
- `.first_not_of(T, start=0)` -> `.first_not_of(T)` , `.first_not_of(T, start)`
38+
- `.last_not_of(T, start=npos)` -> `.first_not_of(T)` , `.first_not_of(T, npos)`
39+
This may or may not result in a speedup.
40+
- [PR#105](https://github.com/biojppm/c4core/pull/105): Add macros in `c4/language.hpp` for compile-time flow of exceptions:
41+
- `C4_EXCEPTIONS`: defined when exceptions are enabled
42+
- `C4_IF_EXCEPTIONS(code_with_exc, code_without_exc)`: select statements for exceptions enabled/disabled
43+
- `C4_IF_EXCEPTIONS_(code_with_exc, code_without_exc)`: select code tokens for exceptions enabled/disabled
44+
- [PR#105](https://github.com/biojppm/c4core/pull/105): Add macros in `c4/language.hpp` for compile-time flow of RTTI:
45+
- `C4_RTTI`: defined when rtti is enabled
46+
- `C4_IF_RTTI(code_with_rtti, code_without_rtti)`: select statements for rtti enabled/disabled
47+
- `C4_IF_RTTI_(code_with_rtti, code_without_rtti)`: select code tokens for rtti enabled/disabled
48+
- [PR#109](https://github.com/biojppm/c4core/pull/109): Add partial support for XTENSA processors (missing implementation of `c4::aalloc()`). See [rapidyaml#358](https://github.com/biojppm/rapidyaml/issues/358).
49+
- [PR#119](https://github.com/biojppm/c4core/pull/119) Add LoongArch cpu support.
50+
- Add compiler annotation helper macros: `C4_ASSUME`, `C4_NODISCARD`, `C4_DEPRECATED`, `C4_UNREACHABLE_AFTER_ERR`
51+
52+
53+
### Fixes
54+
55+
- Fix [#126](https://github.com/biojppm/c4core/issues/126): bad `Exception` being used with `C4_ERROR_THROWS_EXCEPTION`.
56+
- [PR#132](https://github.com/biojppm/c4core/pull/132):
57+
- Fix typo `C_4MSVC_VERSION_2019` in `src/compiler.hpp` ([#124](https://github.com/biojppm/c4core/issues/124)).
58+
- Add check for definition of `__GNUC__` in `gcc-4.8.hpp` ([#125](https://github.com/biojppm/c4core/issues/125)).
59+
- [PR#121](https://github.com/biojppm/c4core/pull/121) - Fix compile on armv8 due to broken macro definition; see [#122](https://github.com/biojppm/c4core/issues/122) and [#94](https://github.com/biojppm/c4core/issues/94).
60+
- [PR#129](https://github.com/biojppm/c4core/pull/129) - Support android by enabling `aalloc()`'s call to `memalign()`, available for API 16+.
61+
- [PR#115](https://github.com/biojppm/c4core/pull/115) - Refactor of `c4::blob`/`c4::cblob`. Use SFINAE to invalidate some of the constructors.
62+
- [PR#110](https://github.com/biojppm/c4core/pull/110)/[PR#107](https://github.com/biojppm/c4core/pull/107) - Update fast_float.
63+
- [PR#108](https://github.com/biojppm/c4core/pull/108) - Fix preprocessor concatenation of strings in `C4_NOT_IMPLEMENTED_MSG()` and `C4_NOT_IMPLEMENTED_IF_MSG()`.
64+
- [PR#106](https://github.com/biojppm/c4core/pull/106) - Fix include guard in the gcc 4.8 compatibility header, causing it to be missing from the amalgamated header. See also [#125](https://github.com/biojppm/c4core/issues/125): there was no check for `__GNUC__` being defined.
65+
- [PR#123](https://github.com/biojppm/c4core/pull/123) - Ensure the gcc 4.8 compatibility header is installed (fixes [#103](https://github.com/biojppm/c4core/issues/103)).
66+
- [PR#105](https://github.com/biojppm/c4core/pull/105) - Fix existing throw in `c4/ext/sg14/inplace_function.h`. Ensure tests run with exceptions disabled and RTTI disabled. Add examples of exceptional control flow with `setjmp()/std::longjmp()`.
67+
- [PR#104](https://github.com/biojppm/c4core/pull/104)/[PR#112](https://github.com/biojppm/c4core/pull/112) - Fix pedantic warnings in gcc, clang and MSVC
68+
- [PR#104](https://github.com/biojppm/c4core/pull/104) - Fix possible compile error when `__GNUC__` is not defined
69+
- Inject explicit `#include <charconv>` on the amalgamated header. The amalgamation tool was filtering all prior includes, thus causing a compilation error. Addresses [rapidyaml#364](https://github.com/biojppm/rapidyaml/issues/364).
70+
- [PR#117](https://github.com/biojppm/c4core/pull/117): Windows: fix compilation with MSVC/clang++.
71+
- Windows: add missing `C4CORE_EXPORT` to `c4::base64_valid()`, `c4::base64_encode()` and `c4::base64_decode()`.
72+
73+
74+
### Thanks
75+
76+
- @zangruochen
77+
- @yrHeTaTeJlb

changelog/current.md

Lines changed: 0 additions & 77 deletions
Original file line numberDiff line numberDiff line change
@@ -1,77 +0,0 @@
1-
### Breaking changes
2-
3-
- [PR#111](https://github.com/biojppm/c4core/pull/111) - Rename formatting overloads accepting `c4::append`:
4-
- `catrs(append_t, ...) -> catrs_append(...)`
5-
- `catseprs(append_t, ...) -> catseprs_append(...)`
6-
- `formatrs(append_t, ...) -> formatrs_append(...)`
7-
- [#PR101](https://github.com/biojppm/c4core/pulls/101): As part of the `substr` ctor cleanup, the `to_substr(char (&arr)[N])` overload no longer decays to `char*` inside. This changes calling code by now returning a `substr` with length equal to `N-1` instead of `strlen(arr)` as before:
8-
```c++
9-
// longer than "foo", ie longer than {'f', 'o', 'o', '\0'}:
10-
char arr[] = "foo\0\0\0\0\0\0";
11-
assert(strlen(arr) == 3);
12-
assert(sizeof(arr) == 9);
13-
14-
// previously:
15-
assert(to_substr(arr).len == 3);
16-
// now:
17-
assert(to_substr(arr).len == 9);
18-
19-
// the breaking change happens only with arrays:
20-
assert(to_substr((char*)ptr).len == 3); // as before
21-
```
22-
23-
### New features
24-
25-
- [#PR101](https://github.com/biojppm/c4core/pulls/101): For `substr` and `csubstr`:
26-
- add simultaneous ctors from `char[]` and `char*`. Using SFINAE to narrow the `char*` overload prevents it from overriding the `char[]` overload. Thanks to @huangqinjin for the idea (see [#97](https://github.com/biojppm/c4core/issues/97)).
27-
- remove unneeded constructors of `csubstr` from non-const chars.
28-
- to each single-argument ctor, add corresponding functions `to_csubstr()` and `to_substr()` to enable clients coercing their types in generic code such as `c4::cat()` and `c4::format()`.
29-
- Add interop with `std::string_view` when the standard is at least C++17 ([#PR101](https://github.com/biojppm/c4core/pulls/101)):
30-
- provided in the header [`c4/std/string_view.hpp`](src/c4/std/string_view.hpp)
31-
- similarly to existing interop headers, this is opt-in and requires explicit inclusion
32-
- implemented:
33-
- `to_csubstr()` (since `std::string_view` is not writeable, cannot provide `to_csubstr()`)
34-
- `to_chars()` (since `std::string_view` is not writeable, cannot provide `from_chars()`)
35-
- comparison operators
36-
- `substr`: split `.first_not_of()` and `.last_not_of()` into different overloads, removing the defaulted `start` parameter:
37-
- `.first_not_of(T, start=0)` -> `.first_not_of(T)` , `.first_not_of(T, start)`
38-
- `.last_not_of(T, start=npos)` -> `.first_not_of(T)` , `.first_not_of(T, npos)`
39-
This may or may not result in a speedup.
40-
- [PR#105](https://github.com/biojppm/c4core/pull/105): Add macros in `c4/language.hpp` for compile-time flow of exceptions:
41-
- `C4_EXCEPTIONS`: defined when exceptions are enabled
42-
- `C4_IF_EXCEPTIONS(code_with_exc, code_without_exc)`: select statements for exceptions enabled/disabled
43-
- `C4_IF_EXCEPTIONS_(code_with_exc, code_without_exc)`: select code tokens for exceptions enabled/disabled
44-
- [PR#105](https://github.com/biojppm/c4core/pull/105): Add macros in `c4/language.hpp` for compile-time flow of RTTI:
45-
- `C4_RTTI`: defined when rtti is enabled
46-
- `C4_IF_RTTI(code_with_rtti, code_without_rtti)`: select statements for rtti enabled/disabled
47-
- `C4_IF_RTTI_(code_with_rtti, code_without_rtti)`: select code tokens for rtti enabled/disabled
48-
- [PR#109](https://github.com/biojppm/c4core/pull/109): Add partial support for XTENSA processors (missing implementation of `c4::aalloc()`). See [rapidyaml#358](https://github.com/biojppm/rapidyaml/issues/358).
49-
- [PR#119](https://github.com/biojppm/c4core/pull/119) Add LoongArch cpu support.
50-
- Add compiler annotation helper macros: `C4_ASSUME`, `C4_NODISCARD`, `C4_DEPRECATED`, `C4_UNREACHABLE_AFTER_ERR`
51-
52-
53-
### Fixes
54-
55-
- Fix [#126](https://github.com/biojppm/c4core/issues/126): bad `Exception` being used with `C4_ERROR_THROWS_EXCEPTION`.
56-
- [PR#132](https://github.com/biojppm/c4core/pull/132):
57-
- Fix typo `C_4MSVC_VERSION_2019` in `src/compiler.hpp` ([#124](https://github.com/biojppm/c4core/issues/124)).
58-
- Add check for definition of `__GNUC__` in `gcc-4.8.hpp` ([#125](https://github.com/biojppm/c4core/issues/125)).
59-
- [PR#121](https://github.com/biojppm/c4core/pull/121) - Fix compile on armv8 due to broken macro definition; see [#122](https://github.com/biojppm/c4core/issues/122) and [#94](https://github.com/biojppm/c4core/issues/94).
60-
- [PR#129](https://github.com/biojppm/c4core/pull/129) - Support android by enabling `aalloc()`'s call to `memalign()`, available for API 16+.
61-
- [PR#115](https://github.com/biojppm/c4core/pull/115) - Refactor of `c4::blob`/`c4::cblob`. Use SFINAE to invalidate some of the constructors.
62-
- [PR#110](https://github.com/biojppm/c4core/pull/110)/[PR#107](https://github.com/biojppm/c4core/pull/107) - Update fast_float.
63-
- [PR#108](https://github.com/biojppm/c4core/pull/108) - Fix preprocessor concatenation of strings in `C4_NOT_IMPLEMENTED_MSG()` and `C4_NOT_IMPLEMENTED_IF_MSG()`.
64-
- [PR#106](https://github.com/biojppm/c4core/pull/106) - Fix include guard in the gcc 4.8 compatibility header, causing it to be missing from the amalgamated header. See also [#125](https://github.com/biojppm/c4core/issues/125): there was no check for `__GNUC__` being defined.
65-
- [PR#123](https://github.com/biojppm/c4core/pull/123) - Ensure the gcc 4.8 compatibility header is installed (fixes [#103](https://github.com/biojppm/c4core/issues/103)).
66-
- [PR#105](https://github.com/biojppm/c4core/pull/105) - Fix existing throw in `c4/ext/sg14/inplace_function.h`. Ensure tests run with exceptions disabled and RTTI disabled. Add examples of exceptional control flow with `setjmp()/std::longjmp()`.
67-
- [PR#104](https://github.com/biojppm/c4core/pull/104)/[PR#112](https://github.com/biojppm/c4core/pull/112) - Fix pedantic warnings in gcc, clang and MSVC
68-
- [PR#104](https://github.com/biojppm/c4core/pull/104) - Fix possible compile error when `__GNUC__` is not defined
69-
- Inject explicit `#include <charconv>` on the amalgamated header. The amalgamation tool was filtering all prior includes, thus causing a compilation error. Addresses [rapidyaml#364](https://github.com/biojppm/rapidyaml/issues/364).
70-
- [PR#117](https://github.com/biojppm/c4core/pull/117): Windows: fix compilation with MSVC/clang++.
71-
- Windows: add missing `C4CORE_EXPORT` to `c4::base64_valid()`, `c4::base64_encode()` and `c4::base64_decode()`.
72-
73-
74-
### Thanks
75-
76-
- @zangruochen
77-
- @yrHeTaTeJlb

tbump.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# github_url = "https://github.com/<user or organization>/<project>/"
33

44
[version]
5-
current = "0.1.11"
5+
current = "0.2.0"
66

77
# Example of a semver regexp.
88
# Make sure this matches current_version before

test/test_install/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(c4core
44
HOMEPAGE_URL "https://github.com/biojppm/c4core"
55
LANGUAGES CXX)
66
include(../../cmake/c4Project.cmake)
7-
c4_project(VERSION 0.1.11
7+
c4_project(VERSION 0.2.0
88
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
99

1010
if(C4CORE_TEST_INSTALL_PACKAGE_MODE)

test/test_singleheader/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(c4core
44
HOMEPAGE_URL "https://github.com/biojppm/c4core"
55
LANGUAGES CXX)
66
include(../../cmake/c4Project.cmake)
7-
c4_project(VERSION 0.1.11
7+
c4_project(VERSION 0.2.0
88
AUTHOR "Joao Paulo Magalhaes <dev@jpmag.me>")
99

1010
# amalgamate c4core to get the single header

0 commit comments

Comments
 (0)