Skip to content

Commit 7d8468d

Browse files
Merge pull request #23 from dreamer-coding/main
Patch update to resolve an issue found from C++
2 parents 9672d02 + ae47f42 commit 7d8468d

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ Before getting started, make sure you have the following installed:
4646
# ======================
4747
[wrap-git]
4848
url = https://github.com/fossillogic/fossil-test.git
49-
revision = v1.0.5
49+
revision = v1.0.6
5050

5151
[provide]
5252
fossil-test = fossil_test_dep

code/logic/fossil/_common/platform.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,12 @@
1818
#include "common.h" // for introspection data
1919

2020
#ifdef __cplusplus
21-
extern "C"
22-
{
21+
extern "C" {
2322
#endif
2423

2524
// Utility function to get the architecture
2625
static inline char* _fossil_test_get_architecture(void) {
27-
char* arch = malloc(10 * sizeof(char));
26+
char* arch = (char*)malloc(10 * sizeof(char)); // Explicit cast for C++
2827
if (arch == NULL) {
2928
return NULL;
3029
}
@@ -62,7 +61,7 @@ static inline char* _fossil_test_get_architecture(void) {
6261

6362
// Utility function to get the OS name
6463
static inline char* _fossil_test_get_os_name(void) {
65-
char* os_name = malloc(20 * sizeof(char));
64+
char* os_name = (char*)malloc(20 * sizeof(char)); // Explicit cast for C++
6665
if (os_name == NULL) {
6766
return NULL;
6867
}
@@ -95,7 +94,7 @@ static inline int _fossil_test_get_num_cpus(void) {
9594
#elif defined(__APPLE__)
9695
int num_cpus;
9796
size_t size = sizeof(num_cpus);
98-
if (sysctlbyname("hw.ncpu", &num_cpus, &size, xnull, 0) == 0) {
97+
if (sysctlbyname("hw.ncpu", &num_cpus, &size, NULL, 0) == 0) {
9998
return num_cpus;
10099
} else {
101100
return 1; // Default to 1 if unable to get the number of CPUs

meson.build

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
project('Fossil Test', 'c', 'cpp',
22
meson_version: '>=1.3.0',
33
license: 'MPL-2.0',
4-
version: '1.0.5',
4+
version: '1.0.6',
55
default_options: ['c_std=c18', 'cpp_std=c++20'])
66

77
subdir('code')

0 commit comments

Comments
 (0)