16 Commits

Author SHA1 Message Date
Ben Clayton
93b861004e examples: Suffix package exe with .exe on Windows
Without this the vscode extension cannot find the example executable, and the example fails.

Also use $USERPROFILE instead of  $HOME for finding the `.vscode` user directory for installing the extension.

Bug: #12
2020-01-17 20:07:55 +00:00
Ben Clayton
cdc19ac4d9 Serialization: Correctly encode structs with no fields
Empty structs were being serialized as `null`, when they should have been serialized as `{}`.

This was due to the type inference on the serializer - where no calls to `field()` would result in the default `null` type.

To solve this, the `serialize(const void* object, const std::initializer_list<Field>&)` inline helper has been promoted to a virtual function (and renamed to `fields()`).
The JSON serializer implementation of this now first sets the object type to `object`, even if there are no fields to serialize.

Added test for this.

Fixes: #10
2020-01-06 15:00:24 +00:00
Ben Clayton
3a10d4cabd Format all source files 2020-01-06 15:00:24 +00:00
Ben Clayton
8633abaf88 Add clang-format-all.sh to format all project sources 2020-01-06 15:00:24 +00:00
Ben Clayton
1be9bb6712 launch.json - fix name of unittests to launch 2020-01-06 15:00:24 +00:00
Ben Clayton
d19d8f83c9
Address #7 nits and fix compiler warning (#9)
Compiler warning was signed / unsigned compare.
2019-12-31 21:04:57 +00:00
kuafuwang
73d697eac4 Fix Response type info, make response 'body' field optional
The `body` field of the Response is optional. Do not error if it is missing.

If the typeinfo of the response. This was incorrectly using the Request type.

Authored by kuafuwang, squashed by ben-clayton.
2019-12-31 20:58:33 +00:00
Ben Clayton
eab43f3518 net::Server: Fix onError parameter default.
The onError parameter of Server::start was default initialized with
OnError(), which is an 'invalid target', not a no-op implementation.

Replace with a true no-op implementation.
2019-12-05 15:12:56 +00:00
Ben Clayton
cc7b68a365 CMakeLists.txt: Make it easier to control options from dependee projects. 2019-12-02 13:55:45 +00:00
Ben Clayton
dc3b3eaeb3 CMakeLists.txt: Disable MSVC warning from third_party
`nlohmann/json` raises a `size_t` to `int` MSVC warning that will fail the build if `CPPDAP_WARNINGS_AS_ERRORS` is enabled.
Given that this is not our code, the best we can do is to make an exception for this warning.
2019-11-26 17:59:58 +00:00
Ben Clayton
010e3e3c86 CMakeLists.txt: Make it easier to specify third_party vars.
Only set the third_party directory variables if they're not already set
(by the dependee project).
2019-11-18 13:00:26 +00:00
Ben Clayton
44d158805c Reimplement std::future and std::promise to workaround TSAN false positives 2019-11-14 08:10:16 +00:00
Ben Clayton
1f7f48904a Fix memory leak in src/socket.cpp 2019-11-14 00:37:38 +00:00
Ben Clayton
d13d4a4151 GCC build fixes 2019-11-14 00:29:38 +00:00
Ben Clayton
a4b9640ffc Add Kokoro presubmit scripts 2019-11-14 00:09:46 +00:00
Ben Clayton
2dfd15462f Initial drop of cppdap 2019-11-08 21:58:50 +00:00