Skip to content

Commit ac08b42

Browse files
committed
misc: Removed dead code in cbindgen.toml, added developer notes, tweaked some readme wording.
1 parent 8d97f5e commit ac08b42

File tree

3 files changed

+40
-17
lines changed

3 files changed

+40
-17
lines changed

DEV_NOTES.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Developer notes
2+
3+
## CMake Integration
4+
We temporarily use a forked version of https://github.com/corrosion-rs/corrosion
5+
to enable linking the Rust crate as C rather than C++.
6+
7+
The "corrosion" directory has been added as:
8+
9+
```
10+
git subtree add --prefix corrosion https://github.com/amunra/corrosion master --squash
11+
```
12+
13+
and is being maintained as:
14+
15+
```
16+
git subtree add --prefix corrosion https://github.com/amunra/corrosion master --squash
17+
```
18+
19+
Until our outstanding pull request with the upstream project is resolved.
20+
See: https://github.com/corrosion-rs/corrosion/pull/188.
21+
22+
23+
## Building without CMake
24+
For development, you may also call `cargo build` directly.
25+
By default, this will not build the `C` FFI layer.
26+
27+
For that, call `cargo build --features ffi`.
28+
29+
If you are editing the C functions and what to see the resulting generated
30+
header file, call `cargo build --features cbindgen`.
31+
32+
Note that to reduce compile time we don't use cbindgen in the header we ship.

README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ To understand the protocol in more depth, consult the
3737

3838
## Using this Library
3939

40-
Start with the [build instructions](BUILD.md), then read guide for including
41-
this library as a [dependency to your project](DEPENDENCY.md).
40+
Start with the [build instructions](BUILD.md), then read the guide for including
41+
this library as a [dependency from your project](DEPENDENCY.md).
4242

4343
Once you've all set up, you can take a look at our examples:
4444

@@ -79,7 +79,7 @@ See a [complete example in C++](examples/line_sender_cpp_example.cpp).
7979
The API is sequentially coupled, meaning that methods need to be called in a
8080
specific order.
8181
82-
For each row you need to specify a table name and at least one symbol or
82+
For each row, you need to specify a table name and at least one symbol or
8383
column. Symbols must be specified before columns.
8484
Once you're done with a row you must add a timestamp calling `at` or `at_now`.
8585
@@ -103,7 +103,7 @@ a failure.
103103
You may then call `line_sender_error_msg(err)` and
104104
`line_sender_error_get_code(err)` to extract error details.
105105
106-
Once handled, the error object *must* be disposed by calling
106+
Once handled, the error object *must* be disposed of by calling
107107
`line_sender_error_free(err)`.
108108
109109
On error you must also call `line_sender_close(sender)`.

cbindgen.toml

Lines changed: 4 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,21 +40,12 @@ includes = [] # ["my_great_lib.h"]
4040
no_includes = true
4141

4242
after_includes = """
43-
#if defined(LINESENDER_DYN_LIB)
44-
# if defined(_MSC_VER)
45-
# if defined(LINESENDER_EXPORTS)
46-
# define LINESENDER_API __declspec(dllexport)
47-
# else
48-
# define LINESENDER_API __declspec(dllimport)
49-
# endif
50-
# elif (__GNUC__ >= 4)
51-
# define LINESENDER_API __attribute__ ((visibility("default")))
52-
# else
53-
# error "Compiler unsupported or badly detected."
54-
# endif
43+
#if defined(LINESENDER_DYN_LIB) && defined(_MSC_VER)
44+
# define LINESENDER_API __declspec(dllimport)
5545
#else
5646
# define LINESENDER_API
57-
#endif"""
47+
#endif
48+
"""
5849

5950
# #ifdef __cplusplus
6051
# extern "C" {

0 commit comments

Comments
 (0)