From 75860105024957e6789db881941eb20b4ee8d4f2 Mon Sep 17 00:00:00 2001 From: ToMe25 <38815969+ToMe25@users.noreply.github.com> Date: Thu, 11 Jan 2024 16:36:14 +0100 Subject: [PATCH] Force using C++11, since that is required for this project --- lib/utils/include/utils.h | 1 + platformio.ini | 13 ++++++++----- test/test_uzlib_gzip_wrapper/decompress.cpp | 4 ++-- 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/lib/utils/include/utils.h b/lib/utils/include/utils.h index 3756a0b..92c10e3 100644 --- a/lib/utils/include/utils.h +++ b/lib/utils/include/utils.h @@ -13,6 +13,7 @@ #ifndef SRC_UTILS_H_ #define SRC_UTILS_H_ +#include #include namespace utils { diff --git a/platformio.ini b/platformio.ini index 09ad382..f603f8c 100644 --- a/platformio.ini +++ b/platformio.ini @@ -10,7 +10,7 @@ [platformio] name = "ESP WiFi Thermometer" -default_envs = +default_envs = esp32dev esp32dev_debug esp32dev_ota @@ -29,13 +29,13 @@ framework = arduino monitor_speed = 115200 upload_speed = 921600 extra_scripts = post:shared/compress_web.py -lib_deps = +lib_deps = ArduinoOTA ESPAsyncWebServer = https://github.com/me-no-dev/ESPAsyncWebServer.git marvinroger/AsyncMqttClient@^0.9.0 adafruit/DHT sensor library@^1.4.4 milesburton/DallasTemperature@^3.11.0 -board_build.embed_txtfiles = +board_build.embed_txtfiles = wifissid.txt wifipass.txt otapass.txt @@ -43,13 +43,16 @@ board_build.embed_txtfiles = mqttpass.txt data/index.html data/error.html -board_build.embed_files = +board_build.embed_files = data/gzip/main.css.gz data/gzip/index.js.gz data/gzip/manifest.json.gz data/gzip/favicon.ico.gz data/gzip/favicon.png.gz data/gzip/favicon.svg.gz +build_flags = + -std=c++11 + -Wall test_framework = unity [debug] @@ -58,7 +61,7 @@ build_flags = -D CORE_DEBUG_LEVEL=5 [env:native] platform = native -framework = +framework = lib_deps = UZLibGzipWrapper [env:native_debug] diff --git a/test/test_uzlib_gzip_wrapper/decompress.cpp b/test/test_uzlib_gzip_wrapper/decompress.cpp index 6b58dde..be2b5b1 100644 --- a/test/test_uzlib_gzip_wrapper/decompress.cpp +++ b/test/test_uzlib_gzip_wrapper/decompress.cpp @@ -92,12 +92,12 @@ void setUp() { if (uncompressed_path) { const size_t u_len = std::strlen(uncompressed_path); compressed_path = new char[u_len + 4]; // 3 for .gz plus NUL byte. - strncpy(compressed_path, uncompressed_path, u_len); + strncpy(compressed_path, uncompressed_path, u_len + 1); strncpy(compressed_path + u_len, ".gz", 4); const size_t bc_len = std::strlen(BASE_COMMAND); compress_command = new char[bc_len + u_len + 1]; - strncpy(compress_command, BASE_COMMAND, bc_len); + strncpy(compress_command, BASE_COMMAND, bc_len + 1); strncpy(compress_command + bc_len, uncompressed_path, u_len + 1); }