enable warnings as errors

This commit is contained in:
Caelan Sayler
2024-10-19 22:20:49 +01:00
committed by Caelan
parent 9a61a240fb
commit 0cddc1f045
2 changed files with 6 additions and 4 deletions

View File

@@ -2,7 +2,8 @@ fn main() {
cxx_build::bridge("src/lib.rs") cxx_build::bridge("src/lib.rs")
.file("src/bridge.cc") .file("src/bridge.cc")
.flag_if_supported("/std:c++17") .flag_if_supported("/std:c++17")
// .warnings_into_errors(true) .flag_if_supported("/EHsc")
.warnings_into_errors(true)
.define("VELOPACK_LIBC_EXPORTS", Some("1")) .define("VELOPACK_LIBC_EXPORTS", Some("1"))
.std("c++17") .std("c++17")
.compile("velopack_libc"); .compile("velopack_libc");

View File

@@ -294,7 +294,8 @@ VPKC_EXPORT bool VPKC_CALL vpkc_download_updates(vpkc_update_manager_t* pManager
clear_last_error(); clear_last_error();
try { try {
if (!pUpdate) { if (!pUpdate) {
throw new std::runtime_error("pUpdate is a required parameter"); set_last_error("pUpdate is a required parameter");
return false;
} }
UpdateManagerOpaque* pOpaque = reinterpret_cast<UpdateManagerOpaque*>(*pManager); UpdateManagerOpaque* pOpaque = reinterpret_cast<UpdateManagerOpaque*>(*pManager);
@@ -309,13 +310,13 @@ VPKC_EXPORT bool VPKC_CALL vpkc_download_updates(vpkc_update_manager_t* pManager
set_last_error(e.what()); set_last_error(e.what());
return false; return false;
} }
} }
VPKC_EXPORT bool VPKC_CALL vpkc_wait_exit_then_apply_update(vpkc_update_manager_t* pManager, vpkc_asset_t* pAsset, bool bSilent, bool bRestart, char** pRestartArgs, size_t cRestartArgs) { VPKC_EXPORT bool VPKC_CALL vpkc_wait_exit_then_apply_update(vpkc_update_manager_t* pManager, vpkc_asset_t* pAsset, bool bSilent, bool bRestart, char** pRestartArgs, size_t cRestartArgs) {
clear_last_error(); clear_last_error();
try { try {
if (!pAsset) { if (!pAsset) {
throw new std::runtime_error("pAsset is a required parameter"); set_last_error("pAsset is a required parameter");
return false;
} }
UpdateManagerOpaque* pOpaque = reinterpret_cast<UpdateManagerOpaque*>(*pManager); UpdateManagerOpaque* pOpaque = reinterpret_cast<UpdateManagerOpaque*>(*pManager);